Jump to content
Sign in to follow this  
tophe

A question on arrays

Recommended Posts

If I add a few units (named P1, P2, P3 etc.) to an array through a trigger by:

activation: MyUnitArray = + thisList

What will the format be?

Will it be [P1,P2,P3] or ["P1","P2","P3"]?

The reason I'm wondering is because I want to use the IN command to check for a specific unit in the Array.

Like this:

if (P1 in MyUnitArray) then {hint "P1 is in the array"}

Would that work?

Share this post


Link to post
Share on other sites

Just the unit names, no quotation marks (e.g. [p1,p2,p3]).

And, yes, the in test will work.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×