Basically, depending on where the code for a function is placed in the physical code, it will act as if certain variables haven't been created. If a function it placed below the variable declaration, it will behave as expected. If it is placed above the variable declaration, the function will treat the variable as if it didn't exist. It is seen better when OPTION STRICT is enabled because it throws a "undefined variable" error, but it is not necessary, nor does the variable need to be declared explicitly. It happens with strings and values, real and integer.
Here are some examples:
OPTION STRICT 'Here, the variable declaration is before the function. VAR G=42 ?FUNCTION() END COMMON DEF FUNCTION() VAR R=G RETURN R ENDOutput: 42
OPTION STRICT COMMON DEF FUNCTION() VAR R=G RETURN R END 'Here the variable declaration comes after the function. VAR G=42 ?FUNCTION() ENDOutput: Undefined variable in 0:4 (EDIT: Forgot to add VAR to variable declarations.)