IApplication GetSession (Method)
Determine the number of active sessions and retrieve information about each of the sessions.
Function GetSessions(buffer As String, buf_size As Long) As Long
Parameters
No | Name | Type | Optional | Default | Description |
---|---|---|---|---|---|
1 | buffer | String | No | - | Buffer to hold the session information |
2 | buf_size | Long | No | - | Buffer size. It must be defined as minimum 12*(number of active sessions) characters. It will contain the number of active 3270 screen sessions on return. |
Return Code | Description | ||||
JGS_OK | Success | ||||
JGS_MEMORY | Not enough memory | ||||
JGS_PARAMETERERROR | Invalid buffer size | ||||
JGS_SYSERROR | The function failed due to a system error |
Remarks
The return value of buf_size is set when the return code is JGS_OK or JGS_PARAMETERERROR. Â If you receive a return code of 2, use buf_size to recalculate the necessary value for the size of buffer (and the value for buf_size on the call).
Sample Code
Dim myString as String * (26 * 12 + 1)
Dim result as Long
Dim bufsize as Long
bufsize = 26 * 12 + 1
myString = ""
result = sess.GetSessions(myString, bufsize)
QWS3270 Automation copyright © Jolly Giant Software Inc. All rights reserved.