creating variable in the runtime - Forum

Forum Navigation
You need to log in to create posts and topics.

creating variable in the runtime

Is there any way to create a variable in the runtime?

I don't understand you very well @asmat...
This will create a variable with name "myvar":

SetVar [myvar] "value"

You can also create variable collections using objects:

CreateEmptyObject [mycollection]
SetVar [mycollection.name] "Peter"
SetVar [mycollection.surname] "Smith"

It's also possible to create composed variables:

SetVar [num] "1"
SetCompVar [myvar[num]] "Hi! It works"
AlertBox "Variable value:" "[myvar1]" ""

Or this to get a composed variable value:

SetVar [num] "1"
SetCompVar [myvar[num]] "Hi! It works"
GetCompVar [result] [myvar[num]]
AlertBox "Variable value:" "[result]" ""

 

 

Vadim, asmat and Samuel Vanneste have reacted to this post.
VadimasmatSamuel Vanneste