This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Extra! X-treme Hotspot assignments

One of my macros brings up an information page with some of the items being static. I created Hotspot assignments for these static items to run certain macros. My macro and hotspot assignments work wonderfully. The difficulty I’m having, is sharing the hotspot file with people using my macro.  There are far too many assignments for each user to reassign them, which is why I shared a copy the hotspot file with my macro.   The issues are that no one seems able to use my HotSpot.ehs without receiving error when trying to load it in settings.   Could someone please explain one or all of the following.

  1. How do I share a .ehs file correctly when distributing a Macro?
  2. How do I programmatically assign HotSpot.ehs to their session?
  3. How do I programmatically create hotspot assignments?

 I’ve been reading for guidance, but not getting what I need out of that reference.


Mainframe Access
  • Suggested Answer

    Hi David, 

    1. Just drop the HotSpot scheme into a known location, just like you do with your macro, or ini files.

    2. The Session.HotSpotScheme is a read/write property, so you can set the hotspot scheme in a startup macro (or in a layout file which you use to launch your sessions (natrually after you have launched a session in the layout).

    Here is the sample from the Extra! Basic 9.4 help (courtesy of WinHLP32 from an old XP installation).

    HotSpotScheme Property Example

    This example displays the name of the hotspot scheme of the active session.

    Sub Main()
    Dim Sys As Object, Sess As Object
    Set Sys = CreateObject("EXTRA.System")
    'Assumes an open session
    MsgBox "The current HotSpot scheme is " + Sys.ActiveSession.HotSpotScheme + "."
    End Sub

    © 1996 - 2004, Attachmate Corporation. All rights reserved.

    Note: I would pass the full path to the .ehs file

    3. As for programatically modifying the HotSpot files, if you want to do this on the fly, then you would have to update the .ehs file (these have an ini format, we covered reading ini files in an earlier thread, writing to ini files is also possible using WritePrivateProfileString 

    Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, _
    ByVal lpKeyName As String, ByVal lpString As String, ByVal lpFileName As String) As Long

    I would us this to update existing ini entries, for new hotspots I would just add to the bottom of the file (don't forget a trailing CRLF it might be important).

    Looking at your assignments above it looks like you may be passing the Page number as a command line parameter (which we discussed in an earlier thread). You could reduce the number of defined hotspots if you were to just use "PAGE" and not "PAGE XXX". Then in your macro you can use the Screen.LastClickEvent to get the screen position for the string and parse the page number from the screen, and you would not need to pass it on the command line.

    Here is a old macro from my archives that demos host to parse a url from the screen from a hotspot launched macro

    Sub Main
    Dim Sys As Object
    Dim Sess As Object
    Dim MyScreen As Object
    Dim MouseEvent As object

    Set Sys = CreateObject("EXTRA.System") ' Gets the system object
    Set Sess = Sys.ActiveSession
    Set MyScreen = Sess.Screen
    Set MouseEvent = MyScreen.LastMouseEvent ' Gets an Area object

    MyRow = MyScreen.GetString(MouseEvent.Top, 1, MyScreen.Cols)
    DontStop = 1
    Tom = 0
    If InStr(Tom+1,MyRow, "http://",1) = 0 then Exit Sub
    Do While DontStop > 0
    Tom = InStr(Tom+1,MyRow, "http://",1)
    If Tom > 0 then
    EndCol = InStr(Tom, MyRow, " ", 1 )
    If EndCol >= MouseEvent.Left and MouseEvent.Left >= Tom then
    Link = MyScreen.GetString(MouseEvent.Top, Tom, EndCol-Tom)
    Shell("C:\Program Files\Internet Explorer\IEXPLORE.EXE " & Link)
    Exit Do
    End If
    DontStop = 0
    End If
    End Sub