Page 1 of 1

among not working the way it should with numbers

Posted: Tue Jul 07, 2015 1:00 am
by Da_Elf
trying this where tileTypeNumber is 2

Code: Select all

if tileTypeNumber is among the words of "1 2 3 4 5 6" then
   put "VideoAloneTemplate" into templateMaster
end if
but it refuses to find 2 in that list. the numbers are separated by spaces so they should be recognised as words shouldn't they?
i tried setting itemDelimiter to comma then setting the list to "1,2,3,4,5,6" and used "among the items of" but it still didnt work

Re: among not working the way it should with numbers

Posted: Tue Jul 07, 2015 2:28 am
by dunbarx
Hi.

Something hidden is fouling up the works? Because that code surely works if the "2" is surrounded by spaces:

Code: Select all

on mouseUp
   put 2 into tileTypeNumber
   if tileTypeNumber is among the words of "1 2 3 4 5 6" then answer "Yep!"
end mouseUp
The code fragment ..." if tileTypeNumber is among the words of "1 2 3 4 5 6" then..." is direct from your post.

Craig Newman

Re: among not working the way it should with numbers

Posted: Tue Jul 07, 2015 3:19 am
by Da_Elf
you were right. there was something messing it up. thats. it gave me the right idea to look at the creation of the 2 rather than looking at the use of "among"