Previous Topic: Obtaining Help Text for a Menu OptionNext Topic: Security Considerations


Messages and the Menu Program

i OS has sophisticated message handling facilities that enable you both to provide a continuous dialogue between user and machine, and to obtain an audit log. The Toolkit display menu program helps you to make full use of i OS messages, and includes the following features:

For example, the following impromptu message will cause HELLO SAILOR to appear on line 24 of the menu display:

SNDPGMMSG MSG(‘HELLO SAILOR’)

While this predefined message:

ADDMSGD MSGID(USR0001) MSGF(QUSRMSG) MSG(‘&1 Pints today
&2’) SECLVL(‘Must be gold top.’) FMT((*DEC 3) (*CHAR 10) )

will cause the message "002 Pints today please" to appear on line 24 if it is sent to the menu program by your own CL program:

SNDPGMMSG MSGID(USR0001) MSGF(QUSRMSG) MSGSend the message directly to a named program message queue. If you have nested invocations of application programs - program A calling program B calling program C - you may wish to send messages directly to the Toolkit menu program by name. Such messages should be sent to the Toolkit menu message handling program YDMNGOC. For example:

SNDPGMMSG MSGID(USR0001) MSGF(QUSRMSG) MSGDTA(‘002please’) TOPGMQ(*SAME YDMNGOC)

The menu program provides a completion message for each option executed. The message (YMN0027 in the Toolkit message file, YYYYMSG) has the form:

Last option was "N." "option text"

Use of this feature can reduce the amount of CL programming that you have to do.