I have seen this written two different ways to write a global variable to the session (not to mention the third ._$SESSION method)
I am wondering what the difference is between these two:
$my_var = {my_field01};
sc_set_global($my_var);
$my_var = {my_field01};
sc_set_global([my_var]);
They both seem to work, but without more debug info it’s hard to tell if there is any benefit or drawback to one or the other.
For example,
Does the first left-square-bracket in “sc_set_global([” … instruct the parser that a variable is to be processed …
-OR Does the dollar-sign in “sc_set_global($” … instruct the parser that the variable is noted and no square-brackets are needed?
I’m confused as to why it can be done 2 different ways but they both seem to serve the same purpose. (but only while “setting” the variable)
It seems like “sc_set_global([my_var])” (according to programming logic) would require that [my_var] is already set, since the use of the square-bracket enclosure usually means to ScriptCase that it should read an existing variable.
Did I miss something? – Which method is proper/correct?