I am writing a function where I call other functions from within the main function. I am not using static/structures and I don't have global variables or strings. I am wondering if it is safe to reuse local variables or strings in the other functions? I should know the answer to this but I'm not 100% sure.
In my limited testing it seems OK for example to have a loop using variable i and to call another function within that loop that also uses i. The two variable are treated independently by Igor. Is this correct?
All local variables, strings, structs (objects) which are not passed-by-reference to other functions can only be accessed/changed in that function. Global objects (global variables/strings, non-free waves, non-free datafolders) are surviving the end of a function run (they are "persistent").
All local variables, strings, structs (objects) which are not passed-by-reference to other functions can only be accessed/changed in that function. Global objects (global variables/strings, non-free waves, non-free datafolders) are surviving the end of a function run (they are "persistent").
October 30, 2015 at 03:43 am - Permalink
October 30, 2015 at 03:48 am - Permalink