Using macros to establish host connections can be quite useful, particularly if you connect to multiple hosts, or use different connection settings.
If you use OpenSystems hosts, you may also want to use macros to configure your connection settings, especially if you use automation to create Reflection session documents. (If you save the correct host connection information in the session document that contains your macros, you don't need to change connection settings programmatically.)
When using macros to configure settings, use these best practices:
This sample applies only to Open Systems terminals.
Running a Connection Macro |
Copy Code
|
---|---|
Private Sub Terminal_Connected(ByVal sender As Variant, ByVal ConnectionID As Long, ByVal connnectionType As Attachmate_Reflection_Objects_Emulation_OpenSystems.ConnectionTypeOption, ByVal connectionSettings As Variant) 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_SecureShell 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 |