Thanks Logain
Ok, now a stupid question thats probably been answered many times, but refuses to show up on a search.
Local and global variables.
I want to make sure I understand properly before I start flinging them about.
Code: Select all
get local variable: name=<varname>
Returns the value of <varname> which is stored on the calling object. If the variable doesn't exist, NULL is returned.
Code: Select all
set local variable: name=<varname> value=<value>
Creates a variable called <varname> on the calling object and sets its value to <value>.
Questions
1. If I call the 'set' command three times using the same <varname>, will I end up with three copies of the local variable attached to the object, or only one copy updated three times?
--- I assume I get one copy of the variable whos value is updated each time I call 'set'.
2. I need to 'get' the variable value every time I want to use it?
--- I assume this is correct.
3. I need to 'set' the variable value every time I want to change it?
--- I assume this is correct.
4. What about arrays?
--- I assume 'get' returns an array ptr which should allow me to directly alter the local array.
--- I assume 'set' would attach the array to the calling object.
--- I assume replacing one array with another would destroy the old and attach the new.
5. How long do the local variable last?
--- I assume the object would retain its local variables until it's destroyed.
6. Global variable behave the same way?
--- I assume this is correct.
Do I pass
