Page 1 of 1

Processing all the graphics on a card

Posted: Mon Jan 26, 2009 8:49 pm
by AlexAdams
I need to loop through all the graphics on a card. Evaluating properties and customer properties and setting properties and custom properties. How do I loop through all the graphics?

Thanks,

Posted: Mon Jan 26, 2009 9:29 pm
by FourthWorld
Objects can be referred to by their ordinal number (e.g., "control 1" for any object on the card, or "graphic 1" for just objects of that type).

The "repeat" control structure has a form which lets you increment a counter variable (e.g., "repeat with i = 1 to 10").

The number of objects of a given type can be determined by simply asking:
"get the number of graphics".

So putting these ingredients together we get this recipe:

Code: Select all

repeat with i = 1 to the number of grcs
   put the customProperties of grc i into tMyPropsArray
   -- do something with those
end repeat

Posted: Mon Jan 26, 2009 11:29 pm
by AlexAdams
Thanks Richard. That sounds like exactly what I need.