status = local ( [ variable ] ) ;
list variable (optional)
- If the variable is global, it is made local, otherwise it is unchanged.
str status
- $ACKNOWLEDGE
The variable was made local, or the program is switched to local scope.
The STATUS variable is set to $ACKNOWLEDGE
%ARGUMENT : Invalid arguments. Usage: status = local ( [ variable ] ) ;
%IDENTIFIER : 'variable' argument is not a valid identifier, literal, or reference
%UNDEFINED : Variable does not exist
In global scope, variables defined will be global in scope.
In local scope, variables defined will be local in scope.
If a variable is local, it can be redefined in global scope. Any previous global variable is overwritten and the local definition no longer exists.
If a variable is global, it can be redefined in local scope. Any previous local variable is overwritten and the global definition no longer exists.
Global variables (and methods) created by the concept instance have a super-global scope, they are visible to all instances providing the instance has not already defined the variable in local or global scope. If the instance un-defines its own global and local copies of the variable, then the variable defined in the concept instance becomes visible. Local variables created in the concept instance are not accessible by other instances and visa versa.
A common mistake when trying to create a local variable over top of a global variable is not to typedef it. For example:
// Define global scope global ; // Define a global variable (we didn't use a typedef, so the type is 'list' a = 100 ; // Define local scope local ; // The following statement simply overwrites the global variable 'a' a = 101 ; // But the next statement creates a new local variable because it was typedef'd int a = 1 ;