Post Reply 
Bug? accessing LOCAL var in shared scope
12-03-2014, 11:42 PM (This post was last modified: 12-03-2014 11:48 PM by Snorre.)
Post: #2
RE: Bug? accessing LOCAL var in shared scope
Hello lenborje,

I think you shouldn't use LOCAL outside functions.
To my knowledge there are 3 types of variables:
a: LOCALs inside functions: only accessible and existent within the function.
b: global (in program context) but not EXPORTed: only accessible within the program, but keeping their value even if the program is left (a kind of private vars).
c: EXPORTed: accessible from everywhere and also keeping their value.

The first type has to be declared inside a function, the last two types have to be declared outside functions:

EXPORT c;
b;
myFunction() BEGIN LOCAL a; END;

Type b variables are a nice feature to preserve some program state without polluting the variable menu and without having to fear the user or another program may accidently set them to an invalid value.

Greetings
(sorry, English is not my mother tongue)
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Bug? accessing LOCAL var in shared scope - Snorre - 12-03-2014 11:42 PM



User(s) browsing this thread: 1 Guest(s)