PASSPORT Knowledge Base
Macros

Date Published: October 21, 2008

Title

Sample Macro to Detect PASSPORT Version

Product

PASSPORT Web to Host

Emulation Types

TN3270, TN5250, VT, SCO ANSI, Wyse 60

Issue

I need to detect what PASSPORT Web to Host version my users are running so I can instruct them to upgrade to the current version.  How can this be done?

Solution

The latest Web to Host version, 2007-1516-1, allows for older client versions to connect and work with the new version on the server.  However, the client will not see any of the new enhancements and fixes available in the new version.  It is recommended that the client be upgraded to the new version as soon as possible.  To do this, the administrator can write a simple macro to check for the client version number at launch time.  Follow the steps below to do this:

  1. Copy the macro below to your macro folder on the PASSPORT Web to Host server (i.e. C:\Program Files\PASSPORT eClient Admin\Eclient\3270dsp\Macros):

    Sub ZMain()
    strVer= GetPassportVersion ( )
    If strVer <> "Version 2007-1516-1" Then
    MsgBox "You're running an old Web to Host client,"&strVer &". Please contact your System Administrator to upgrade to the latest version.",,"PASSPORT Web to Host"
    End If
    End Sub
  1. Follow the steps below to configure your PASSPORT Web to Host session to use it as a Start Up macro:
    1. Start the PASSPORT Web to Host Administrator program.
    2. Open the session to configure.
    3. Select the Miscellaneous tab.
    4. Enable the Startup Macro check box.
    5. Choose the appropriate macro from the drop-down list.
    6. Click OK to save.
  2. When the session is launched next time, the Startup Macro will run and detect which PASSPORT Web to Host client version is running on the user's PC.

Note: “Version 2007-1516-1” is used as an example in the script.  You will need to change the version number to the corresponding version of Web to Host that you are running.

More Information

Sub ZMain()

Dim iRet

strVer= GetPassportVersion ( )

If strVer <> "Version 2007-1516-1" Then

iRet= MsgBox ("You're running an old Web to Host client," & strVer & ". Please contact your System Administrator to upgrade to the latest version.",4,"PASSPORT Web to Host")

If iRet = 6 Then

iRet = Shell ("C:\Program Files\Internet Explorer\iexplore.exe " & "http://www.zephyrcorp.com", 1)

End IF

End If

End Sub

 

Note: replace "http://www.zephyrcorp.com" with your desired web page.

Keywords

sample, macro, detect, PASSPORT, version, startup