MemVar Class |
|
命名空间: XSharp
MemVar 类型公开以下成员。
| 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. |
|
动态内存变量(PUBLIC、PRIVATE、PARAMETERS)仅在 X# 语言和运行时中用于兼容性。 在大多数情况下,类型可以和应该被替换为词法作用域变量,如 LOCAL 和 GLOBAL。 |