PDA

View Full Version : All items in List


JustasM
02-27-2009, 01:11 PM
Working on one of my projects, I stumbled across another hurdle that I cannot jump.

I would like to create an if/else statement that states:

If <world.object variable> = ANY item from list A , then do.....

However, dragging the list into the appropriate slot only allows these selections:
-first item from list
-last item from list
-random item from list
-i'th item from list (requires you to choose an index number)

Is there no possible way to make Alice check all the objects in the list? If there is, how do you accomplish this?

Thank you in advance.

Ch0pStickS
02-27-2009, 05:09 PM
For that, you don't want a list, you wan't an array. Then you could make a loop that checks the nth index of the array using the index under the advanced loop options variable. So it would loop and check each object in the array to see if it is true or something, and if it did, it would change a variable somewhere else to turn true.

wongwanchap
02-27-2009, 08:45 PM
There is a function call List.contain, that function maybe have what u want.

To see this function, first u need to create a if statement, then drag the List to the condition block, then u will find List.contain function in the pop up menu.

Hope this one can help u.

JustasM
02-28-2009, 04:14 AM
Thank you guys; both of you provided different solutions that both worked! :)

I was able to solve the problem. ;)