How to use variable within a variable

 I have a List Iterator action that is iterating over a set of values. Let's pretend these values are A, B, and C, and that they are assigned to a variable named %ListItem%.

I would like to have variables named DoWorkA, DoWorkB, and DoWorkC for each of A, B, and C, and then check their values (True or False) within the List Iterator to see if some type of work should be done. So:

List Iterator - A, B, C
If %DoWork%ListItem%% = True
   ... do some work
Else
   ... do something else

How can I accomplish this? The software does not let me do a variable inside of a variable. Is there an alternative method I could use to accomplish the same thing?

Thanks.

-Corey
 

Never mind. I found this helpful thread:

https://www.finalbuilder.com/forums.aspx?aff=1&aft=4354&afv=topic

Basically, the thread (and sample provided in the thread) show how to use JScript to set the name of the variable in an action prior to the action being executed. This should work.

-Corey

Here is my specific solution to this problem (for those interested). This is the Javascript I placed in the If action’s Before script. The LHSValues property appears to hold the left handed side values of the If action.

Action.LHSValues.Strings(0) = “%CvsCheckoutFull” + FBVariables.ListItem + “%”;

That seemed to do the trick perfectly.

The If action resides within a List Iterator action that is iterating over these values: Resources, SourceCode, and Tools. The List Iterator stores the value for the current list item in a variable named ListItem. I created these variables that end up getting checked by the If action: CvsCheckoutFullResources, CvsCheckoutFullSourceCode, CvsCheckoutFullTools. Now, I can set these variables to True of False depending on what I want.

-Corey