MemVarPutSym Function | |
Assign a value to a memory variable of a given name.
Namespace:
XSharp.RT
Assembly:
XSharp.RT (in XSharp.RT.dll) Version: 2.19
Syntax FUNCTION MemVarPutSym(
symVar AS SYMBOL,
uValue AS USUAL
) AS USUAL
public static Usual MemVarPutSym(
Symbol symVar,
Usual uValue
)
Request Example
View SourceParameters
- symVar
- Type: Symbol
The name of the variable you want to assign to. - uValue
- Type: Usual
The value to assign to the variable.
Return Value
Type:
Usual
The value assigned to
uValue.
Remarks
If a memory variable called
cVarName does not exits, a memory variable called
cVarName is created.
Therefore, MemVarPut(), like VarPut() can be used to create undeclared memory variables.
It should be used instead of a macro.
Tip |
---|
This function allows the direct manipulation of a memory location and should be used with extreme care.
|
Examples
This example uses MemVarPut() to create a memory variable:
1LOCAL cHasName AS STRING
2cHasName := "cPrivate"
3
4MemVarPut(cHasName, "new")
5? cPrivate
This example shows that the newly created variable is a MEMVAR:
1MemVarPut("cVar", "hi")
2? _MEMVAR->cVar
See Also