QMGetVar()

Top  Previous  Next

 

The QMGetVar() function returns the value of an @-variable from the server.

 

 

Format

 

VBQMGetVar(ByVal Name as String) as String

 

Cchar * QMGetVar(char * Name)

 

ObjStr = Session->GetVar(Name)

 

where

 

Nameis the name of the @-variable to be returned. The leading @ symbol may be omitted.

 

 

The QMGetVar() function returns the value of an @-variable as a string. If the named variable does not exist, a null string is returned.

 

In the C API library, the dynamic memory allocated for the returned string must subsequently be freed by the calling program.

 

 

Examples

 

VB

SelectedCount = QMGetVar("@SELECTED")

C

SelectedCount = QMGetVar("@SELECTED");

QMBasic

SelectedCount = Session->QMGetVar("@SELECTED")

 

The above program fragment returns the value of the @SELECTED variable.

 

Note that the C example leaves variable SelectedCount pointing to dynamically allocated memory areas that must be released using QMFree() when no longer needed.