While there's an industry movement for Web-enabling RPG programs, many people don't realize they can also mouse-enable PC5250 green screens. Mouse-enablement allows administrators to set up clickable hotspots inside a PC5250 session. Those hotspots allow users to activate function keys, launch macros and scripts, execute strings on a 5250 screen as if they had been typed on an AS/400 command line or an input-capable field, and launch a Web-browser from inside an RPG program.
Hotspot mouse-enablement helps Windows-centric users become a little more comfortable using green-screen-based Client Access PC5250. And it's available in all versions of IBM's Client Access Express for Windows software as well as in the older Client Access for Windows 95/NT V3R2M0 offering.
How to set up hotspots
In Express Client PC5250, you enter the Hotspots setup dialogue by selecting Edit-Preferences-Hotspots from the PC5250 menu bar. If you're using Client Access for Windows 95/NT, you get to this dialogue by clicking on Assists-Hotspots from the menu bar. The functionality is basically the same in both Client Access products, but the Client Access for Windows 95/NT options are slightly different from what I describe here.
The Hotspots dialogue is separated into two areas that define different types of hotspots you can activate for your users: Point-and-Select Hotspots and Point-and-Select commands. Here's how these hotspot settings work:
Point-and-Select Hotspots activate existing OS/400 and PC functions by using a mouse. Those functions include F-Key activation, macros and scripts, and being able to launch a browser from within PC5250. In this section of the Hotspots dialogue, you'll find check boxes for setting up PFnn, FPnn, Fnn, and nn screen literals to serve as clickable F-key enablers. For example, if I activate the Fnn check box in the dialogue, then anytime I double-click on a screen literal that matches the 'Fnn' pattern (F3=Exit, for example), it sends the corresponding F-key defined by the 'nn' part of the pattern to OS/400 (F3 or '3' in this case). If I also activate the PFnn, FPxx, or nn check boxes in the Hotspots dialogue, PC5250 would send an F3 command to OS/400 if I double-clicked on any 'PF3', 'FP3', or '3' literal in an existing green-screen. Those check boxes transform on-screen literals into mouse-enabled F-key generators for PC5250 users.
For Web sites, if I write an RPG program that displays a URL for a particular Web site (http://www.search400.com, for example) and I activate the Execute URL check box on the Hotspots dialogue, double-clicking on the on-screen URL literal starts up a Web browser on my client machine that connects to the specified Web address. For this function to work properly, however, you need to display the target Web site as a completely formed URL preceded by an 'http://' designation.
The final Point-and-Select Hotspot function is to execute PC5250 macros or scripts by clicking on the name of the macro on a PC5250 screen. If I activate the Execute macro/script check box on the Hotspots dialogue, then I could execute a macro simply by double-clicking on the macro's name on a PC5250 screen. The macro would be executed at the spot where my PC5250 cursor currently resides. So double-clicking on the word 'calc', for example, would cause PC5250 to look for a macro or script called 'calc', execute the macro or script and return any input literals to the first input-capable field after the screen location where my PC5250 cursor is currently residing. If there isn't any macro or script available with that name, PC5250 will display an error message.
To make things easier for Point-and-Select Hotspots, PC5250 can display any available hotspots as 3-D buttons by selecting the 3-D Buttons check boxes listed under each of the hotspot activation check boxes. The 3-D Buttons check boxes will highlight any PFnn, FPnn, Fnn, nn, and URL literals, as well as any existing macro or script name literals as button-like icons on your PC5250 screen. Another side effect of turning on 3-D buttons is that your users can activate the functions by single-clicking on the buttons rather than double-clicking on the literals as described above.
Point-and-Select Commands hotspot settings have a different function. They allow you to perform two actions by using your mouse: You can feed a specific string followed by an Enter character to your PC5250 session; or you can send an Enter character to your session from a specific position on your screen. Here's how those settings work.
The Enter at cursor position check box on the Hotspots dialogue allows you to send an Enter character to your OS/400 host from your current PC5250 cursor position by double-clicking at that position. So if you had a list of items on your screen in a sub-file, for example, and you wanted to send an Enter character from the third item on the screen, you could double-click on the third item.
The Enter string at cursor position check box allows you to double-click a literal on your green-screen, and PC5250 will then copy that literal to the first input-capable field on your screen followed by an Enter character. So if you activate this hotspot option, you can hard-code a list of acceptable literals for an input field on your display screen and your user could then double-click the literal he wants to send to the program. PC5250 would copy the literal to the input field along with an Enter character to send it to the host system for processing. There is one drawback with this technique, however. PC5250 limits the number of characters that can be sent with this option to nine. So for literals that are bigger than nine characters, this really isn't an option.
Since on-screen literals can match any number of these hotspot options, PC5250 uses a hierarchy that determines the order hotspot definitions are processed when a user clicks on a hotspot. Hotspot literal matches are processed in the following order:
- Point-and-Select URLs
- Point-and-Select PFnn, FPnn, Fnn, and nn matches
- Point-and-Select macro and script matches
- Point-and Select commands for entering a specific string at a specific position
- Point-and-Select commands for sending an Enter key at a specific position
So if there is any conflict in hotspot matching, this is how PC5250 will resolve the problem.
Give it a try
Hotspots can be valuable aids for Windows-dependent users to better navigate PC5250 green screens. You may want to give them a try to see if they can help users in your shop.
About the author: Joe Hertvik is an editor for Midrange Server and an IT consultant and freelance writer who specializes in middleware, network infrastructure, and iSeries and AS/400 issues. Joe can be reached at firstname.lastname@example.org.
- Use PC5250 program in CA Express V5R1 to decrease macro playback time
- OS/400 Discussion Forum: Post your questions, and get answers from other iSeries users as well as search400 experts.
- Search400's Best Web Links on Systems Management
This was first published in November 2001