Passing a Macro Name as a Parameter
PASSPORT PC to Host, PASSPORT Web to Host
TN3270, TN5250, VT, SCO ANSI, Wyse 60
With Attachmate EXTRA! we were able to run the ebrun.exe program and pass the name of a macro to it as a parameter, for example:
ebrun.exe "C:\EXTRA\Macros\MyMacro.ebm"
How can this be done with PASSPORT?
Using the NavigateTo method of the Session object, a developer can write an application which utilizes the PASSPORT Object Interface to accomplish this.
See the VB example below:
Sub Main()
'--------------------------------------------------------------------------------
' Get the main system object
Dim Sessions As Object
Dim System As Object
Set System = CreateObject("PASSPORT.System") ' Gets the system object
If (System Is Nothing) Then
MsgBox "Could not create the PASSPORT System object. Stopping macro playback."
Stop
End If
Set Sessions = System.Sessions
If (Sessions Is Nothing) Then
MsgBox "Could not create the Sessions collection object. Stopping macro playback."
Stop
End If
'--------------------------------------------------------------------------------
' Set the default wait timeout value
g_HostSettleTime = 3000 ' milliseconds
OldSystemTimeout& = System.TimeoutValue
If (g_HostSettleTime > OldSystemTimeout) Then
System.TimeoutValue = g_HostSettleTime
End If
' Get the necessary Session Object
Dim Sess0 As Object
Set Sess0 = System.ActiveSession
If (Sess0 Is Nothing) Then
MsgBox "Could not create the Session object. Stopping macro playback."
Stop
End If
If Not Sess0.Visible Then Sess0.Visible = True
Sess0.Screen.WaitHostQuiet (g_HostSettleTime)
' Run the macro specified as parameter (i.e. "RunMacro.exe C:/Program Files/PASSPORT/MyMacro.zmc")
Sess0.NavigateTo Command$()
System.TimeoutValue = OldSystemTimeout
End Sub
In order to make use of the PASSPORT Object Layer, you must be using a license code that is enabled for it.
You will also need the latest Microsoft Visual Basic run-time files must be installed and registered on any workstation that will utilize it. For more information or to download the run-time files, please visit the following page on the Microsoft website: http://support.microsoft.com/default.aspx?scid=kb;en-us;Q192461
macro, engine, parameter, object interface