ZBrushCentral

Can lists be passed around as arguments?

I know I should probably experiment, but it would take quite a while to test all possible cases.

Can lists be passed as arguments? Can they be local vars only (i.e. nonglobal?) Are there any problems if a global list and a local list have the same name?

Thanks,
Ken

Can lists be passed as arguments?
You cannot pass a variable list to a [RoutineCall,…]. You should not approach zscripting that way. As only one Zscript can be active at a time and the variable definitions are cleared upon loading a new zscript, it makes sense to keep variables accessible throughout the active zscript.

Once defined, variable(s) in a zscript are accessible throughout the zscript, i.e global variables. However, if the variable definition is within a container the variable will first be accessible thoughout the zscript when that container has been activated. Your zscript logic will determine the variable(s) availability.

Containers are: [IButtons,..],[ISliders,...],[If,...], etc, basically any command that offers alternative zscript flow.

Variables defined at the root level are available immediately, throughout the zscript. You can think of the root level as a container that is activated once the zscript is loaded.

Are there any problems if a global list and a local list have the same name?

As variables in zscripts are global once defined you can only have one variable of a given name. [VarDef,…]'ing a variable name a second time will not cause any problems nor will it have any effect. A variables first [VarDef,…] is its final. You cannot extend a variable list by redifining it. To do that you need to use memory block commands.