Click or drag to resize

IVarGetSelf Function

Return the contents of an instance variable.

Namespace:  XSharp.RT
Assembly:  XSharp.RT (in XSharp.RT.dll) Version: 2.10
Syntax
 FUNCTION IVarGetSelf(
	oObject AS Object,
	symInstanceVar AS STRING
) AS USUAL
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#
CLASS GetVars
        EXPORT cName
        INSTANCE cPhone
        PROTECT cID
        HIDDEN cPassWord
METHOD Init CLASS GetVars
        cName := "Adam"        
        cPhone := "4460"
FUNCTION Start()
        LOCAL oVars AS OBJECT
        oVars := GetVars{}
        ? IVarGetSelf(oVars, #cName)                        // Adam
        ? IVarGetSelf(oVars, #cPhone)                        // 4460
See Also