OIA Property Example

This example uses the Screen object's OIA property to reference the OIA object. The OIA object is then used to:

image\b.gif return the OIA image as a character string for parsing and evaluation (Value property),

image\b.gif determine whether or not the OIA has been updated since the last time the OIA object was accessed (Updated property),

image\b.gif return the status of the XCLOCK portion of the OIA (XStatus property),

image\b.gif return the session connection status (ConnectionStatus property),

image\b.gif and, return session errors (ErrorStatus 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

' This returns (and displays) the current OIA message as a string.

 OIAValue$ = MyScreen.OIA.Value

 MsgBox "Current OIA message codes for this session: " + OIAValue$

' The following If statement displays a message if the

' OIA has been updated.

 If MyScreen.OIA.Updated = 1 Then

  MsgBox "The OIA has been updated!"

 End If

' The following If statement displays status messages pertaining to

' user-entered host commands and/or data.

 If MyScreen.OIA.XStatus = 1 Then

  MsgBox "You have entered an invalid number."

 ElseIf MyScreen.OIA.XStatus = 2 Then

  MsgBox "You have entered non-numeric data in a numeric field."

 ElseIf MyScreen.OIA.XStatus = 3 Then

  MsgBox "You have attempted to enter data in a protected field."

 ElseIf MyScreen.OIA.XStatus = 4 Then

  MsgBox "You have attempted to type past the end of a field."

 ElseIf MyScreen.OIA.XStatus = 5 Then

  MsgBox "The host is busy processing your request."

 ElseIf MyScreen.OIA.XStatus = 6 Then

  MsgBox "The function you requested is unavailable."

 ElseIf MyScreen.OIA.XStatus = 7 Then

  MsgBox "Unable to print to requested printer."

 ElseIf MyScreen.OIA.XStatus = 8 Then

  MsgBox "The system has locked your keyboard during processing."

 ElseIf MyScreen.OIA.XStatus = 9 Then

  MsgBox "You have entered an invalid character."

 End If

' 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

' The following If statement displays status messages pertaining to

' host/client communication.

 If MyScreen.OIA.ErrorStatus = 1 Then

  MsgBox "A configuration mismatch has occurred."

 ElseIf MyScreen.OIA.ErrorStatus = 2 Then

  MsgBox "A communications hardware problem has occurred."

 ElseIf MyScreen.OIA.ErrorStatus = 3 Then

  MsgBox "A physical connection problem has occurred."

 End If

End Sub