I have experimented (and searched) but can't seem to find a way to set a script variable (Array element) from the console or xml (UI) file. I can retrieve values but not set them. whats the right way to do this other than calling a atom?
to read i am doing this:
echo ${Script[test].VariableScope.HideID[${Script[test].VariableScope.HideIDcnt}]}
I have tried quite a few variations of:
Script[test].Variable[HideID[${Script[test].VariableScope.HideIDcnt}]]:Set[${99}]
and nada happens, the echo will show original value rather than the new value.
the test script:
variable int HideID[50]
variable int HideIDcnt=1
function main()
{
HideID[2]:Set[19]
HideID[1]:Set[72]
do
{
if ${QueuedCommands}
ExecuteQueued
waitframe
}
while 1
}
Thanks. Hopefully I am just having a brain fart and the answer is simple.
arrays in UI XML
Moderators: Lavish Software Team, Moderators
The simple answer is you can set the variable as global instead of script-scope and access it the same way you would in the script.
I'd have to do some digging to get you a proper example with script-scope, and I'm moving in a couple days so that's not something I have time to do at the moment
Code: Select all
variable(global) int HideIDcnt