ScriptUO
Official ScriptUO EasyUO Scripts => Script Debug => Topic started by: slyone on February 18, 2012, 06:41:27 AM
-
I'm trying to create a variable name dynamically. The test code I am using is below:
set %var1 10
set %var2 string
set % , %var1 , %var2 XXXXX
display % , %var1 , %var2
halt
I want the variable to be "%10string" and to have a value of XXXXX. But when I use the display command it shows the string %10string rather than the value XXXXX.
Can anyone help?
-
You have to use a combination of the dot operator and the concatenation operator.
set %var1 10
set %var2 string
set % . %var1 , %var2 Worked
display %10string
halt
-
For what you are doing, you would need to use an intermediate step in order to Extract the Data from your Dynamic Variable.
set %Var1 10
set %Var2 String
set %Temp %Var1 , %Var2
set % , %Temp Worked
display % . %Temp
Halt
The Easiest way to get around this is just to Bypass the Var2.
set %Var1 10
set %String , %Var1 Worked
Display %String . %Var1
halt
Once you get the Hang of it, its not Tooo Bad.
-
You have to use a combination of the dot operator and the concatenation operator.
set %var1 10
set %var2 string
set % . %var1 , %var2 Worked
display %10string
halt
For what you are doing, you would need to use an intermediate step in order to Extract the Data from your Dynamic Variable.
set %Var1 10
set %Var2 String
set %Temp %Var1 , %Var2
set % , %Temp Worked
display % . %Temp
Halt
The Easiest way to get around this is just to Bypass the Var2.
set %Var1 10
set %String , %Var1 Worked
Display %String . %Var1
halt
Once you get the Hang of it, its not Tooo Bad.
Thank you!!