GetVariable Method
Applies To
AdvancedTcl Object
Prototype
GetVariable(Interpreter As Long, VariableName As String, VariableValue As String, Flags As Long, Reserved As Long) As Long
Input
The "Interpreter" parameter, which must be a valid interpreter pointer. The "VariableName" parameter, which contains the name of the variable to query. The "Flags" parameter, which can be any of the valid variable flags in the TCLBVariableFlags enumeration. The "Reserved" parameter, which is reserved for future use and must be zero.
Output
The "VariableValue" parameter is modified to contain the value of the variable. Initially, the "VariableValue" parameter must be NULL (vbNullString).
Returns
Undefined.
COM Results
S_OK: Success.
E_INVALIDARG: Either a NULL pointer was passed or the "Interpreter" parameter is invalid.
Side Effects
None.
Description
This method is a wrapper around the Tcl_GetVar function. The value of the variable is placed into the "VariableValue" parameter.
Notes
None.
Example
Private Sub Command1_Click()
    Dim poTcl As TclBridge.AdvancedTcl
    Dim plInterpreter As Long
    Dim psOutput As String

    Set poTcl = New TclBridge.AdvancedTcl

    Call poTcl.CreateInterpreter(plInterpreter)

    Call poTcl.SetVariable(plInterpreter, "TestVariable", "test", 0&, 0&)

    psOutput = vbNullString
    Call poTcl.GetVariable(plInterpreter, "TestVariable", psOutput, 0&, 0&)

    Call poTcl.DeleteInterpreter(plInterpreter)

    Set poTcl = Nothing
End Sub