I needed this same info for a different use and found an answer that worked. After seeing this answer I'm loading a dictionary and using the constructed string to match the key but....
I seemed to be able to cast the constructed string as my predefined variable by using Eval.
example:
strRegValue = Eval("g_str" & strName & "RegValue")
strMessage = Eval("g_str" & strName & "Msg")
strCommand = Eval("g_str" & strName & "Command")
wscript.Echo strRegValue
wscript.Echo strMessage
wscript.Echo strCommand
Returned my g_str......... variables for each strname in my loop.
I'm new here so hate to speak out but seems to work for me..
|