MemVar Class |
Namespace: XSharp
The MemVar type exposes the following members.
Name | Description | |
---|---|---|
Name | Name of the memory variable. | |
Value | Value of the memory variable. The default is NIL for PRIVATEs and FALSE for PUBLICs. |
Name | Description | |
---|---|---|
_Get | Get the value of a local, private or public (in that order). Throws an exception when the variable does not exist. | |
_GetSafe | Get the value of a local, private or public (in that order). Returns NIL if the value does not exist. | |
_Put | Updates the value of a local, private or public (in that order).
If the value does not exist than a new variable at the current level is created. | |
Add | Add a public memvar or a private memvar to the current level. | |
Clear | Clear a variable by name. Tries to clear a private first and when that is not found then a public | |
ClearAll | Clear all memvar name/value pairs.
Does not remove locals. Does not remove privates stack levels. | |
GetHigherLevelPrivate | Get a memvar object from the stack (if it exists) | |
Initialize | ||
PrivateFind | Find a private variable. Try on the current level on the stack first and when not found then walk the stack. | |
PrivatePut | Update a private variable. Does NOT add a new variable | |
PrivatesCount | Get the total number of unique private variable names. | |
PrivatesEnum | Get an enumerator for all the unique names of private variables | |
PrivatesFirst | Get the first unique private variable name. | |
PrivatesNext | Get the next unique private variable name. | |
PublicFind | Find a public variable | |
PublicPut | Update a public variable. Does NOT create a new public when there is no variable with that name. | |
PublicsCount | Gets the total number of public variables. | |
PublicsEnum | Get an enumerator for all the unique names of public variables | |
PublicsFirst | Gets the name of the first public variable. | |
PublicsNext | Gets the name of the next public variable. | |
Release | Release a private variable | |
ReleaseAll | Assign NIL to all visible private variables. Hidden privates are not affected. | |
ReleasePrivates | Release all privates at a certain level and higher | |
TryGet | Try to retrieve the value of a local, private or public (in that order). |
Name | Description | |
---|---|---|
Get | Get the value of a local, private or public (in that order). Throws an exception when the variable does not exist. | |
GetSafe | Get the value of a local, private or public (in that order). Returns NIL if the value does not exist. | |
Put | Updates the value of a local, private or public (in that order).
If the value does not exist than a new variable at the current level is created. |
Tip |
---|
Dynamic memory variables (PUBLIC, PRIVATE, PARAMETERS) are supported in the X# language and runtime for compatibility only. In most cases the type can and should be replaced with lexically scoped variables, such as LOCALs and GLOBALs. |