Click or drag to resize

MemVar Class

X#
Internal type that implements the Dynamic Memory Variables.
Inheritance Hierarchy
Object
  MemVar

Namespace:  XSharp
Assembly:  XSharp.RT (in XSharp.RT.dll) Version: 2.19
Syntax
 CLASS MemVar
Request Example View Source

The MemVar type exposes the following members.

Constructors
  NameDescription
Public methodMemVar
Initializes a new instance of the MemVar class
Top
Properties
  NameDescription
Public propertyName
Name of the memory variable.
Public propertyValue
Value of the memory variable. The default is NIL for PRIVATEs and FALSE for PUBLICs.
Top
Methods
  NameDescription
Public methodStatic member_Get
Get the value of a local, private or public (in that order). Throws an exception when the variable does not exist.
Public methodStatic member_GetSafe
Get the value of a local, private or public (in that order). Returns NIL if the value does not exist.
Public methodStatic member_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.
Public methodStatic memberAdd
Add a public memvar or a private memvar to the current level.
Public methodStatic memberClear
Clear a variable by name. Tries to clear a private first and when that is not found then a public
Public methodStatic memberClearAll
Clear all memvar name/value pairs. Does not remove locals. Does not remove privates stack levels.
Public methodStatic memberGetHigherLevelPrivate
Get a memvar object from the stack (if it exists)
Public methodStatic memberInitialize
Public methodStatic memberPrivateFind
Find a private variable. Try on the current level on the stack first and when not found then walk the stack.
Public methodStatic memberPrivatePut
Update a private variable. Does NOT add a new variable
Public methodStatic memberPrivatesCount
Get the total number of unique private variable names.
Public methodStatic memberPrivatesEnum
Get an enumerator for all the unique names of private variables
Public methodStatic memberPrivatesFirst
Get the first unique private variable name.
Public methodStatic memberPrivatesNext
Get the next unique private variable name.
Public methodStatic memberPublicFind
Find a public variable
Public methodStatic memberPublicPut
Update a public variable. Does NOT create a new public when there is no variable with that name.
Public methodStatic memberPublicsCount
Gets the total number of public variables.
Public methodStatic memberPublicsEnum
Get an enumerator for all the unique names of public variables
Public methodStatic memberPublicsFirst
Gets the name of the first public variable.
Public methodStatic memberPublicsNext
Gets the name of the next public variable.
Public methodStatic memberRelease
Release a private variable
Public methodStatic memberReleaseAll
Assign NIL to all visible private variables. Hidden privates are not affected.
Public methodStatic memberReleasePrivates
Release all privates at a certain level and higher
Public methodStatic memberTryGet
Try to retrieve the value of a local, private or public (in that order).
Top
Fields
  NameDescription
Public fieldStatic memberGet
Get the value of a local, private or public (in that order). Throws an exception when the variable does not exist.
Public fieldStatic memberGetSafe
Get the value of a local, private or public (in that order). Returns NIL if the value does not exist.
Public fieldStatic memberPut
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.
Top
Remarks
Tip 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.
See Also