Example

The SessionSetupDemo prodedure uses the SetupSession method to change the current terminal model. It calls the Get3270TerminalModel function, which uses the TerminalModel property to return a string containing the name of the currently configured terminal model.

Sub SessionSetupDemo()

'Changes the current session setup and

'displays the new terminal model.

 With Session

  If .Connected Then .Disconnect

  .SetupSession rc3270Terminal, rc3270MODEL3E, rcTelnet

  .Hostname = "Myhost"

   MsgBox "The current terminal model is " & Get3270TerminalModel

 End With

End Sub

 

Function Get3270TerminalModel() As String

'Returns the name of the currently configured Terminal model.

'This example is only valid for 3270 terminal sessions.

 

 Select Case Session.TerminalModel

  Case rc3270MODEL2

   Get3270TerminalModel = "Model 2 24x80"

  Case rc3270MODEL2E

   Get3270TerminalModel = "Model 2 24x80 Extended"

  Case rc3270MODEL3

   Get3270TerminalModel = "Model 3 32x80"

  Case rc3270MODEL3E

   Get3270TerminalModel = "Model 3 32x80 Extended"

  Case rc3270MODEL4

   Get3270TerminalModel = "Model 4 43x80"

  Case rc3270MODEL4E

   Get3270TerminalModel = "Model 4 43x80 Extended"

  Case rc3270MODEL5

   Get3270TerminalModel = "Model 5 27x132"

  Case rc3270MODEL5E

   Get3270TerminalModel = "Model 5 27x132 Extended"

  Case rcAnyModel

   Get3270TerminalModel = "<Any Model>"

  Case Else

   Get3270TerminalModel = "unknown"

 End Select

End Function