I'm having a little problem with how I'm trying to use a variable. Here is an example:
Basically, during the course of my script, a bunch of variables get set to yes or no (VarA, VarB, VarC). I have the list of these variables stored in an Array (MyArray). Several times during my script I want to check each of these variables (over 15 of them in reality), and instead of having 15 separate checks, I want to loop through them.
${MyArray->Shift} "VarA"
${MyArray->Shift} "VarB"
${MyArray->Shift} "VarC"
StrCpy $VarA yes
StrCpy $VarB no
StrCpy $VarC Yes
StrCpy $0 0
Loop:
IntCmp $0 3 Done 0 Done
${MyArray->Read} $1 $0
MessageBox MB_OK $$$1
IntOp $0 $0 + 1
Goto Loop
Done:
The problem is when I actually try to use the variable, in a MessageBox in the example above, I only get the variable name, and not its value. I'm using '$$$' above to add 1 $ to the result of the Array Read. So the first time through the loop, $1 gets set the VarA, and then is displayed as $VarA in the MessageBox. However I really want to see 'yes' in the message box.
I realize I'm really using one variable which points to a value that happens to be equal to another variable, and expecting to see the second variable's value. If I could somehow use nesting or concatenation to use the second variable initially, and get the desired value, that would be great. Let me know if I'm just crazy, and there is a much better way to do this.
Thanks for looking.
- Jnuw