From: Charley Shanks To: All
I wrote a CL program that acts like a menu when called-using a display file with the Send Receive File (SNDRCVF) command. It works great. I decided that I would like to be able to use the GO command so it could be used like a normal menu-GO MYMENU. I ran the Create Menu (CRTMNU) command and specified TYPE(*PGM). It created successfully. When I typed in GO MYMENU, I received an error message: "Total parameters passed does not match number required." I know what that normally means, but my CL program does not require any parameters. What's up?
From: Ernie Malaga To: Charley Shanks
The GO command passes parameters to the program that displays the menu. I wrote an article titled "Creating Program-Style Menus" in the August 1992 issue of MC. To save you from having to read the article, the parameters needed are:
o CHAR(10). Name of the menu. o CHAR(10). Library that contains the menu. o BIN(2). Return code. If you're using CL, you can use CHAR(2).
The return code is an output parameter. Your program must set it to -1 if the user pressed F3 (use x'FFFF' in CL). If the user pressed F12, the program must set this parameter to -2 (x'FFFE' in CL). If the user pressed the Home key, set it to -4 (x'FFFC' in CL).
From: Charley Shanks To: Ernie Malaga
Thanks. Before getting your response, I looked up the CRTMNU command-it explains it there. When all else fails, read the book. I use your Complete CL book, and have always been pleased, but I couldn't find anything about CL menus in it. Maybe in a future edition?
From: Wayne James To: Charley Shanks
Upgrade to V2R2 and use User Interface Manager (UIM) menus. You will be very pleasantly surprised with the ease and functionality you get. And you only need one object.
From: Charley Shanks To: Wayne James
Are UIM menus only available with V2R2? I'm on V2R2, anyway. I only think of panel group "help windows" when I think of UIM. Where do I get more info on UIM menus? Do they allow you to do everything a CL menu would?
From: Wayne James To: Charley Shanks
I don't remember when they were first fully supported. They are documented in the Programming for Displays manual. Check out the CD-ROM. There are examples in QUSRTOOL. Read the docs carefully and enjoy. The functionality is just great and you can even do great help.
Editor's Note: Look for Ernie Malaga's article on UIM menus in an upcoming issue of Midrange Computing.
LATEST COMMENTS
MC Press Online