Translate page

VBS_Start (Method)


IApplication::VBS_Start

Start an instance of QWS3270 by specifying startup parameters.  Only one session with any session ID can be open at one time.  This means that the session ID actually assigned may or may not be the one requested!


Function VBS_Start(qws_path As String, host As String, [sess_id As Variant = "A"], [port As Long = 23], [term_type As String = "IBM-3278-2-E"], [lu_name As String]) As Long

Parameters

 

NoNameTypeOptionalDefaultDescription
1qws_pathStringNo-

Fully qualified path to QWS3270 application

2hostStringNo-

Host to connect to. (either IP address or host name)

3sess_idVariantYes"A"

Session ID the user is requesting. On return will contain the assigned session ID which may or may not be different

4portLongYes23

Remote host port number

5term_typeStringYes"IBM-3278-2-E"

Requested terminal type. This parameter must be in the same form as the terminal types listed in QWS3270

6

lu_name

String

Yes

-

Requested LU Name

Return Code

Description

JGS_OK

Success

JGS_PARAMETERERROR

Missing or invalid parameter or invalid session ID

JGS_SYSERROR

The function failed due to a system error

JGS_TOO_MANY_SESSIONS

Only one session is allowed for any session ID (see Remarks)

JGS_CREATE_PROCESS

Unable to create new process for QWS3270 application

Remarks

We will attempt to start the application with the specified session ID. If that ID is already in use, we will find the last (Z – A) open session ID and use that one. It is important to compare the returned session ID with the requested one before using it to connect to the session.  If all 26 session IDs are already in use, you will not be able to add another session and the new instance of QWS3270 will display an error.

Sample Code

Dim myPath as String
Dim myHost as String
Dim mySession as Variant
Dim result as Long
myPath = "C:\Program Files\QWS3270\qws3270p.exe"
myHost = "locis.loc.gov"
mySession = "A"
result = sess.VBS_Start(myPath, myHost, mySession)


Back to IApplication members


QWS3270 Automation copyright © Jolly Giant Software Inc. All rights reserved.