When using macros to configure settings for OpenSystems connections, do the following:
In this example, the macro retrieves the connection type and displays it in a message box.
Note: This sample code is intended to illustrate a concept, and it shows only the code that is relevant to that concept. It may not meet the security requirements for a specific environment, and it should not be used exactly as shown. We recommend that you add security and error-handling code to make your projects more secure and robust. Attachmate provides this sample code "AS IS" with no warranties.
Sub DisplayCurrentConnection ()
Dim how As ConnectionTypeOption
Dim msg As String
how = ThisTerminal.ConnectionType
If how = ConnectionTypeOption.ConnectionTypeOption_None Then
msg = "There is no connection currently configured."
End If
If how = ConnectionTypeOption.ConnectionTypeOption_BestNetwork Then
msg = "The current Connection Type is" &"BestNetwork"
End If
If how = ConnectionTypeOption.ConnectionTypeOption_COMSerialPort Then
msg = "The current Connection Type is " & "COMSerialPort"
End If
If how = ConnectionTypeOption.ConnectionTypeOption_Modem Then
msg = "The current Connection Type is " & "Modem"
End If
If how = ConnectionTypeOption.ConnectionTypeOption_Rlogin Then
msg = "The current Connection Type is " & "RLogin"
End If
If how = ConnectionTypeOption.ConnectionTypeOption_SesureShell Then
msg = "The current Connection Type is " & "SecureShell"
End If
If how = ConnectionTypeOption.ConnectionTypeOption_Telnet Then
msg = "The current Connection Type is " & "Telnet"
End If
If how = ConnectionTypeOption.ConnectionTypeOption_VT_MGR Then
msg = "The current Connection Type is " & "VT_MGR"
End If
MsgBox(msg)
End Sub