GefObject.GetVariable (method)

Returns a GefObjectVariable relative to an object.
Syntax: Set GefObjectVariable = object.GetVariable ( Name )
Name As String -
Description: This method will look up a variable relative to the object. If a variable with the given ID exists in the object, that variable is returned. Otherwise it asks its parent to resolve the reference. This continues for each parent, up to and including the screen itself.

If the variable ID begins with a backslash(\), the variable ID is an absolute reference and is searched for at the screen level. For example "\station3\alarm\point" will return the variable named point from the object named "alarm" in the group named "station3".

The Variables property of a GefObject lets you access only the variables associated with that object.


Sub GefObject_GetVariable()
    Dim oCimObj As GefObject
    Dim oCimObjVar As GefObjectVariable
    Set oCimObj = CimGetObject
    Set oCimObjVar = oCimObj.GetVariable("Variable1")
    MsgBox "The screen variable Variable1 has a " & _
        "value of " & oCimObjVar.Value
End Sub
See Also: Variables