Click or drag to resize

Functions.VarPut Method

Assign a value to a field or a memory variable of a given name.

Namespace:  XSharp.RT
Assembly:  XSharp.RT (in XSharp.RT.dll) Version: 2.07
Syntax
 FUNCTION VarPut(
	cVar AS STRING,
	uValue AS USUAL
) AS USUAL
View Source

Parameters

cVar
Type: String
The name of the variable or field you want to Assign to
uValue
Type: __Usual
The value to assign to the variable

Return Value

Type: __Usual
Remarks
If a field or memory variable with the specified name does not exist, then a new a memory variable is created. This function like MemVarPut(), can be used to create undeclared memory variables. It should be used instead of a macro.
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