does variable = NIL clean variable away?
Posted: Wed Sep 18, 2019 6:40 pm
I am quite often using something following:
My assumption has been that I create a "local var" that would get destroyed after returning from the function.
However, now I am wondering if I have misunderstood something.
For in case varcheck = true, then does "var" still get destroyed after being returned from function because it is local variable.
Or is it actually so that my first "var = NIL" doesn't actually do anything, but at varcheck = true situation, "var" is created as a global variable?
Code: Select all
function func()
var = NIL
if varcheck = true then var = 1
return(var)
endfunctionHowever, now I am wondering if I have misunderstood something.
For in case varcheck = true, then does "var" still get destroyed after being returned from function because it is local variable.
Or is it actually so that my first "var = NIL" doesn't actually do anything, but at varcheck = true situation, "var" is created as a global variable?