ConnectionStatus Property Example

This example uses the Screen object's OIA property to reference the OIA object. The OIA object is then used to return the session connection status (ConnectionStatus property).

Sub Main

 Dim Sys As Object

 Dim Sess As Object

 Dim MyScreen As Object

' This gets the System object

 Set Sys = CreateObject("EXTRA.System")

' Assumes an open session

 Set Sess = Sys.ActiveSession

 Set MyScreen = Sess.Screen

' The following If statement displays status messages pertaining to

' your host connection.

 If MyScreen.OIA.ConnectionStatus = 1 Then

  MsgBox "This session currently connected to a mainframe application."

 ElseIf MyScreen.OIA.ConnectionStatus = 2 Then

  MsgBox "The control program has established contact."

 ElseIf MyScreen.OIA.ConnectionStatus = 3 Then

  MsgBox "This session is not connected to a mainframe application."

 End If

End Sub