Click or drag to resize

MemVarGet Function

X#
Return the contents of a memory variable.

Namespace:  XSharp.RT
Assembly:  XSharp.RT (in XSharp.RT.dll) Version: 2.21
Syntax
[NeedsAccessToLocalsAttribute(FALSE)]
 FUNCTION MemVarGet(
	cVarName AS STRING
) AS USUAL
Request Example View Source

Parameters

cVarName
Type: String
The name of the memory variable.

Return Value

Type: Usual
Remarks
MemVarGet() is used instead of a macro when the name of the variable is in a string.
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.
Examples
This example uses MemVarGet() to retrieve the contents of a memory variable:
X#
1cPrivate := "hi"
2cHasName := "cPrivate"
3// Instead of ? &cHasName, use this:
4? MemVarGet(cHasName)            // hi
See Also