OpenSession

Starts a BlueZone Display session.

Parameters:

SessionTypeVal  -  0 - Mainframe; 1 - iSeries; 2 - VT

SessionIdentifierVal  -  1 for S1, 2 for S2, 3 for S3, … , 99 for S99.

ConfigFileStr  -  Name of the BlueZone Configuration File.

TimeoutVal  -  Number of seconds before returning with error.

WaitPaintsVal  -  Number of screen paints before proceeding with script.

Returns:

0 for success; or a non-zero error code.  See Error Codes for a complete listing of error code descriptions.

Remarks:

The OpenSession function will wait for the specified number of screen paints to occur in the BlueZone session before continuing with script execution.  This number is usually one (1) on mainframe systems and two (2) on AS/400 systems.  If the number of seconds specified in the TimeoutVal parameter elapses before the number of specified screen paints have occurred in the BlueZone session, then OpenSession will return with a non-zero error code.

The CloseSession function can be used to end a session started with the OpenSession function.

Example:

UserId = "John"

Password = "Smith"

ResultCode = OpenSession( 0, 2, "System2.Zmd", 60, 2 )

If ( ResultCode ) Then

   MsgBox "Error connecting to host system!", 0

   End Sub

End If

 

ResultCode = EMConnect( "A" )

If ( ResultCode ) Then

   MsgBox "Error connecting to session A!", 0

   End Sub

End If

'continue with script execution

CloseSession 0, 2