View Full Version : UIM Menus dunction keys
rkc@entrack.com
01-01-1995, 02:00 AM
I am creating menus with UIM. Based on the Aug99 issue in MC. I notice when the menu is created, a few function keys are part of the CRTUIMMNU command. Is there a way to add and remove function keys, or are we limited only to the F3, F12, F9 keys? Thanks. Ron
D.Handy
06-11-2000, 01:10 PM
Ron, <font color=blue>are we limited only to the F3, F12, F9 keys? </font> No. You can define any of the function keys with the :KEYI tag. I place all of my UIM menu key definitions in a separate member which I include with the <font color=blue>.im</font> tag. I do this for consistency among the menus. Some of the keys I condition to only show if the user is a *SYSOPR class, or if the user profile does not have limited capabilities, etc. Here is a subset of one of my standard members. It references conditions and help tags not listed here, but it should give the basic idea: <pre> :KEYI KEY=F1 ACTION=help HELP=f1help. :KEYI KEY=F3 ACTION='exit set' PRIORITY=1 VARUPD=YES HELP=f3exit.F3=Exit :KEYI KEY=F5 ACTION='CMD wrksplf' PRIORITY=3 HELP=f5wrksplf.F5=Spool files :KEYI KEY=F6 ACTION='CMD dspmsg qsysopr' PRIORITY=3 COND=issysopr HELP=f6sysopr.F6=Sysopr messages :KEYI KEY=F8 ACTION='CMD dspmsg' PRIORITY=3 HELP=f8dspmsg.F8=Display messages :KEYI KEY=F9 ACTION=cmdline PRIORITY=2 COND=cmdlineok HELP=f9cmdline.F9=Command line :KEYI KEY=F11 ACTION='CMD go *curlib/*all' PRIORITY=3 COND=cmdlineok HELP=f11goall.F11=Select menu :KEYI KEY=F12 ACTION='cancel set' PRIORITY=1 VARUPD=YES HELP=f12cancel.F12=Cancel :KEYI KEY=F17 ACTION='CMD wrksplf *all' PRIORITY=3 COND=issysopr HELP=f17wrksplf.F17=All spool files :KEYI KEY=F23 ACTION='CMD chgprf inlmnu(&zmnulib/&zmenu)' PRIORITY=6 HELP=f23menu.F23=Set initial menu :KEYI KEY=F24 ACTION=morekeys HELP=f24morekeys.F24=More keys :KEYI KEY=ENTER ACTION=enter HELP=enter. :KEYI KEY=HELP ACTION=help HELP=helphelp. :KEYI KEY=HOME ACTION=home HELP=home. :KEYI KEY=PAGEDOWN ACTION=pagedown HELP=pagedown. :KEYI KEY=PAGEUP ACTION=pageup HELP=pageup. :KEYI KEY=PRINT ACTION=print HELP=print. </pre> Notice that the PRIORITY tag can be used to control grouping of Fx keys with F24 used to cycle between them. Some keys I assign directly to a command string; others I use UIM actions to perform a task or option. Doug
rkc@entrack.com
06-12-2000, 02:34 PM
Thanks very much. Ron
rkc@entrack.com
06-12-2000, 05:33 PM
I am having difficult with the KEYI tag. I am defining it in my D spec in my RPGLE program, using the same CRTUIMMNUR program I downloaded from MC 08/99. I am trying to add the "DSPMSG command' My D spec looks as follows: D #keyi_F6 C ':KEYI KEY=F6 HELP=X ACTION=- D ''CMD DSPMSG' D #key-_f6c C 'F6=DSPMSG' The program compiles. But when I run the CRTUIMMNU command, I get the following error: :KEYI KEY=F6 HELP=X ACTION='DSPMSG CPD5A03 Period missing or attribute value incorrect for KEYI tag CPD5A4E Action text for ACTION attribute not valid on KEYI tag CPD5A8f More than one line of text specified for KEYI tag. F6=DSPMSG I have tried all types of syntax combinations wi quotes. Please help, Ron
D.Handy
06-12-2000, 06:19 PM
Ron, <font color=blue>I am having difficult with the KEYI tag ... using the same CRTUIMMNUR program I downloaded from MC 08/99 ... My D spec looks as follows: <pre> D #keyi_F6 C ':KEYI KEY=F6 HELP=X ACTION=- D ''CMD DSPMSG' D #key-_f6c C 'F6=DSPMSG'</pre></font> Try changing the middle line above to: D ... ''CMD DSPMSG''.' Here is why: the ACTION keyword syntax for issuing a command is <font > color=blue>ACTION='CMD cmdstring'</font> where the single quotes around the command string are required. In RPG, to get a single quote within a source line you must use two adjacent single quotes. You did this prior to the CMD but not after it. RPG didn't complain because you created a constant with the value <font color=blue>...ACTION='CMD DSPMSG</font>. Note that it has a leading quote but not a trailing quote. So when this got placed in the source file, CRTMNU treated it as the beginning of the action for the menu item, but did not find the closing quote until later in the source. This caused the CPD58AF message. Also, since the action quote wasn't closed, it didn't find the period it expected, causing the CPD5A03, etc. If you look at the RPG source closely, you'll see each KEYI definition constant ended with a period. You left it out. Refer to the UIM syntax for all the sorid details. However, the period has to be outside the ACTION clause, and precedes the text (eg F6=DSPMSG). Therefore we need two single quotes after DSPMSG (so the source gets one single quote), then the period, then we add the single quote which ends the RPG constant definition. Putting it all together you get the ''CMD DSPMSG''.' shown above. Does this make any sense? Doug
Guest.Visitor
06-12-2000, 06:26 PM
I'm not sure what the CRTUIMMNUR tool does, I usually just create UIM from source and create the panel group from there. However it looks like you are missing a quote and period and the end of the action. Did you try ?... D #keyi_F6 C ':KEYI KEY=F6 HELP=X ACTION=- D ''CMD DSPMSG''.' D #key-_f6c C '.F6=DSPMSG' I may be way off base, nothing new, but let me know if it works. In the meantime I must check CRTUIMMNUR, it sounds interesting.
rkc@entrack.com
06-13-2000, 05:01 AM
Thanks, I'll give it a try. Also CRTUIMMNUR is the RPG program that is used when the CRTUIMMNU command is created.
rkc@entrack.com
06-13-2000, 03:42 PM
I got it to work. Actually, when I entered "CMD DSPMSG".' on the 2nd line, I got the same error message. I then used 2 single quotes instead on one double quote and it works. The 2nd like looks like...... D... ''CMD DSPMSG''.' I was also wondering how difficult it would be to add other fields to the menu such as DATE, Time, and User? I can't seem to find how the default Field 'System name' is created. Also, is it possible to have a second menu title to appear on the 2nd line. Thanks for your help. Ron
D.Handy
06-13-2000, 07:06 PM
Ron, <font color=blue>I then used 2 single quotes instead on one double quote and it works. The 2nd like looks like...... D... ''CMD DSPMSG''.'</font> Using two single quotes is exactly what I told you to do. The default font used by most browsers makes it hard to see that, but if you read my explanation I explained why dual single quotes were needed. Also, if you try a cut-and-paste from my message you'll see I used two single quotes. <font color=blue>I can't seem to find how the default Field 'System name' is created. Also, is it possible to have a second menu title to appear on the 2nd line.</font> The system name appears because the :PANEL tag specifies the top separator as TOPSEP=SYSNAM, which is one of the reserved word options for the top separator. In case you are not aware of this, the syntax of the UIM language is described in the Appendixes of the OS/400 Application Display Programming manual (SC41-4715-01) which can be found on the web or on your softcopy CD (on my V3R7 CD it is in the Database And Files Bookshelf). However, the appendixes describe the entire UIM language used for various types of UIM panels, and some of the tags can not be used (AFAIK) on a menu. I don't know of a way to add a sub-title line per se (which is not to say it is necessarily impossible, just that I haven't experimented enough to find out). It is possible to create headings within the menu list for a group of menu items. Refer to the :MENUGRP tag. The MC utility you are using supports the MENUGRP tag by using the B(text) and E source lines. Doug
rkc@entrack.com
06-14-2000, 07:42 AM
Thanks for your help. Ron
Powered by vBulletin® Version 4.1.5 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.