Click or drag to resize

IVarGetSelf Function

X#
Return the contents of an instance variable.

Namespace:  XSharp.RT
Assembly:  XSharp.RT (in XSharp.RT.dll) Version: 2.19
Syntax
 FUNCTION IVarGetSelf(
	oObject AS Object,
	symInstanceVar AS STRING
) AS USUAL
Request Example View Source

Parameters

oObject
Type: Object
The object containing the instance variable.
symInstanceVar
Type: String
The instance variable to get.

Return Value

Type: Usual
The value of symInstanceVar.
Remarks
IVarGetSelf() returns the contents of a specific EXPORT or INSTANCE variable.
The scope throughout the function call is SELF.
Examples
This example uses IVarGetSelf() to retrieve the contents of both EXPORT and INSTANCE variables:
X#
 1CLASS GetVars
 2    EXPORT cName
 3    INSTANCE cPhone
 4    PROTECT cID
 5    HIDDEN cPassWord
 6CONSTRUCTOR CLASS GetVars
 7    cName := "Adam"    
 8    cPhone := "4460"
 9END CLASS
10
11FUNCTION Start()
12    LOCAL oVars AS OBJECT
13    oVars := GetVars{}
14    ? IVarGetSelf(oVars, #cName)            // Adam
15    ? IVarGetSelf(oVars, #cPhone)            // 4460
See Also