AnsweredAssumed Answered

Clearing Global Variables

Question asked by beacon10 on Jan 28, 2018
Latest reply on Feb 1, 2018 by beacon10

I am using a number of global variables in a script as I am referencing different tables in the same script. Local variables are cleared when the scripts end but global variables continue to live until you quit the program. Is it better programming/efficiency to pass and variables to scripts and then pull the results from that script using local variables. I know you can clear global variables one line at a time with something like Set Variable [ $$t ; Value: " " ] OR [$$t ; Value: 0].

Is there a way to clear more than one variable at a time in one line example: [ Set Variable ; Value: {$$t = 0 ; $$u =0 ; $$v = 0 } ]?

 

If there is no such script step, is the only other solution to just have multiple script steps with each clearing/zeroing each global variable one line at a time? Will local variables "live" when changing tables within a script? It seems through my scripts that they don't. Am I missing something here to make my scripts more efficient?

Outcomes