QMLogto()

Top  Previous  Next

 

The QMLogto() function moves to an alternative account. It is analogous to the LOGTO command.

 

 

Format

 

VBQMLogto(ByVal Account as String) as Boolean

 

Cint QMLogto(char * Account)

 

ObjBool = Session->Logto(Account)

 

where

 

Accountis the name of the QM account to be accessed.

 

 

The QMLogto() function attempts to move to the named account. If successful, the function returns True. If unsuccessful, the function returns False and the QMError() function can be used to retrieve a text error message identifying the cause of the failure.

 

If the VOC of the current account contains an executable item named ON.LOGTO, usually a paragraph, this will be executed before moving to the new account.

 

If the VOC of the new account contains an executable item named LOGIN, this will be executed on arrival in the new account.

 

A QMClient session can be recognised within these paragraphs by testing the value of @TTY which will be "vbsrvr" for QMClient.

 

 

Examples

 

VB

If Not QMLogto(Account) Then

  MsgBox QMError(), VBExclamation, "Cannot move to new account"

End If

C

if (!QMLogto(Account))

{

 printf("Cannot move to new account - %s\n", QMError());

 exit;

}

QMBasic

if not(sesxsion->Logto(Account)) then

  stop "Cannot move to new account - " : QMError()

end

 

The above program fragment attempts to move to the account identified Account. If unsuccessful, it displays an error message including the text returned by QMError().