Introduction to the Form and Menu Language Interpreter (FMLI)

Executing commands

This section describes how users execute FMLI commands. A complete discussion of FMLI commands can be found in ``The Form and Menu Language''.

The command menu

The Command Menu is an FMLI-supplied menu that lists a subset of FMLI commands. By default, function key <F7> is labeled <cmd-menu> when a menu (except the Command Menu itself), form, or text frame is current. Pressing the <cmd-menu> SLK causes the Command Menu to appear in the work area:

Command Menu
cancel next-frm
cleanup prev-frm
exit refresh
frm-mgmt unix-system
goto update

The Command Menu will reflect the contents of the commands file. That is, if you rename, redefine, or disable an existing FMLI command in the commands file, or if you define a new command for your application, it will be added to or removed from the Command Menu as appropriate. You execute a command from the Command Menu by selecting it just as you would select an item in any other menu.

The command line

You access the FMLI command line by pressing <CTRL-j> or <CTRL-f> <c>. At the --> prompt, you enter the name and arguments, if any, of the FMLI command you want to execute and press <ENTER>. All FMLI commands can be executed from the command line except those you have disabled in the commands file.

If a message catalogue for a certain language exists in your system, the commands in the command menu will be presented in the respective language. Commands in the command line must always be entered in English even though they might be output in another language in the command menu.

If what you enter on the command line is not a known FMLI command, it is interpreted according to the following default behavior. If what you enter is an integer, the command that will be executed defaults to goto integer; if you enter 2, navigation to frame 2 will occur. If what you enter is anything other than an integer or a known FMLI command, the command that will be executed defaults to open what-is-entered.

You can try using the command line now if you are running the example application. Press <CTRL-j>, enter the command release, and press <ENTER>. This FMLI command returns the release number of the version of FMLI you are currently running. The words FMLI Release 4.2 Pn, where n is the version number, should be displayed on the message line.

If the Command Menu is the current frame when you press <CTRL-j> or <CTRL-f> <c>, the Command Menu will disappear and the command the cursor is currently positioned on will appear on the command line after the prompt.

NOTE: In releases previous to FMLI 4.0, <CTRL-z> was used to access the command line. In UNIX System V Release 4.0, <CTRL-z> is used for job control in jsh or ksh. For that reason, using <CTRL-z> will suspend an FMLI application. To resume the FMLI application, use the fg command. (See the sh(1) manual page for detailed information on job control.)

Screen-labeled function keys

Pressing a screen-labeled function key (SLK) results in the execution of the command defined for that function key. Many of the default FMLI commands shown on the SLKs can also be selected from the Command Menu or executed from the command line. (Not all FMLI commands shown by default on the SLKs appear in the Command Menu, and vice versa, but all FMLI commands can be executed from the command line.) If you have defined a SLK (either in an initialization file or in a frame definition file) to execute an application-specific command or a different FMLI command from the default, then pressing that SLK will execute the command you have defined for that key.

FMLI provides for international SLKs. User-defined SLKs in initialization or frame definition files can be internationalized with the $$<catalogue_name>:<message_no>:<default_message> syntax. See the section ``Writing an internationalized application'' for more details.

On-line help

When a menu, form, or text frame is current, function key <F1> is labeled <HELP> and assigned the FMLI help command by default. Pressing the <HELP> SLK or selecting the help command in the Command Menu results in the FMLI help descriptor being evaluated. Typically, you use the help descriptor to open a text frame that presents information on the use of the frame or command. This can be done using a text frame definition file, or more simply with the textframe command. But you can define help to be anything, such as a message to be printed on the message line or a UNIX system executable.

On-line help is available for each FMLI command. You can request help on a command by pressing <CMD-MENU> to access the Command Menu, navigating to the command for which you want help, and pressing <HELP>. You can do the same thing by entering a command of the form

help command_name

on the command line, where command_name is the name of the command for which you want help.

The on-line help information can be output in languages other than English. To do this, the FMLI message catalogue must be translated.

There are other ways you can provide users with help on the use of your application. You can define a short descriptive tag to be displayed alongside an item in a menu as a ``memory jogger'' on the use of that item. The choices menu that you can define for a field in a form frame can be considered a kind of help. ``Frame definition files'' presents examples of these and other ways to provide users with on-line help. Help can also be provided via any of the FMLI descriptors that display a message on the message line, such as choicemsg, itemmsg, or fieldmsg. The built-in utility message(1fmli) can also be used to display information on the message line.

The on-line help can be encoded with the $$-syntax so that output in different languages is possible. If a text file needs to be read (when using the help descriptor and the readfile command), its different language versions should be stored under <dirname>/LANG/<file>. The default version should be stored in <dirname>/<file>.

Accessing the UNIX System

You can access the UNIX system by selecting the FMLI unix-system command from the Command Menu or by entering the command_name on the command line. When you invoke unix-system, the FMLI screen clears and you are put in a full-screen UNIX shell. When you exit from the UNIX system, a prompt message appears requesting that you press <ENTER> to continue. The FMLI screen returns in the same condition it was in before the unix-system command was issued. You can control user access to the UNIX shell by disabling the unix-system command in the commands file. (See ``The commands file'' for a discussion of how to disable FMLI commands.)

By default, you can run UNIX system commands from the FMLI command line by prefixing an exclamation mark (!) to the command. (Whitespace is ignored before ! when it is used as a UNIX system escape on the command line.) The built-in function run(1fmli) can also be used to execute UNIX system commands from the FMLI command line (see the run(1fmli) manual page for details). You can use the nobang descriptor to disable these features, as described in ``The initialization file''.

Previous topic: Navigating between frames

© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 27 April 2004