Getting Acquainted with NMENU

Since the sole function of NMENU is to cause a scripted file to execute, there is little to learn about NMENU.BAT except its syntax. The command is followed by the menu filename.


NMENU Syntax

nmenu filename

Replace filename with the menu filename.


What Menus Look Like

Figure 37 shows the display created by a single-window menu with only three options. Whether a menu displays one or more windows, the top and bottom bars of the screen remain the same.

The top bar always displays the NMENU version number on the left and the day, date, and time on the right. The bottom bar displays the available options.

Figure 37
A Single-Window Menu

When you create menus with multiple windows, the windows cascade from left to right (see Figure 39). Window sizing is automatically determined by the content of each window.


What Makes Menus Work

You create menu files with a text editor and save the file with a .SRC extension. Then you use the MENUMAKE program to compile the file. It is given a .DAT extension and, as a compiled file, is no longer editable. Any edits must be made to the .SRC file and then the .SRC file must be recompiled.


Elements of a Menu

There are three primary elements to every menu: MENU, ITEM, and EXEC. As these elements are expanded and repeated, controlled options are displayed within each window.

Figure 38 shows the .SRC file used to create the menu in Figure 37. This file shows how these three elements are used. Details about these elements and their options are covered later in the chapter.

Figure 38
Primary Elements of a Menu


Combining the Elements

Figure 39 illustrates a menu with 10 windows, created by including 10 MENU commands in the same file. Each window is automatically sized and cascaded across the screen.

Figure 39
A Multiple-Window Menu


Menu Creation Steps

There are generally six steps to follow when considering a new menu. The relationship between steps is shown in Figure 40.

Figure 40
Charting the Steps in Creating a Menu


Procedure

Each step in the flowchart is explained below.

  1. Plan and design your menu. Before starting, answer the following questions:

    • Who is it for?
    • What do the users need access to?
    • Should they have access to a NetWare prompt?
    • Should they be forced to log out when exiting?
    • How complex is the menu? Will it need to be in multiple files?

  2. Use a text editor to create your menu with a .SRC extension.

  3. Compile the .SRC file with the MENUMAKE program. This will create a .DAT version of the file.

    The results of any errors occurring during the compile process, including detailed error messages per line of script, are displayed on your screen. Fix the errors in the .SRC version of the file according to the error messages, and then recompile. When you have eliminated all of the errors, continue with Step 4.

  4. Run NMENU filename.dat to verify that it does what you expect.

  5. Change the program if needed, as described in Step 3, and then repeat Step 4. When Step 4 is successful, go on to Step 6.

  6. Provide access to the intended users by placing the .DAT file in an appropriate directory and granting sufficient rights to the users.

    NOTE:  Information on placement of files and required rights is in Making Menus Work.

Following these six steps can help you learn how to use the scripting language and how to manage the menu files you create.

Use of the NMENU program is almost unlimited. When considering the uses for menus, remember that they can be as simple as presenting available application programs (see Figure 41).

Figure 41
Example of a Simple Menu

They also can be more complex, such as guiding data entry for cataloging (see Figure 42).

Figure 42
Example of a More Complex Menu

The text used to create the four menus shown in this section (Figure 37, Figure 39, Figure 41, and Figure 42) is included in Example Menu Programs.

Before you look at how these menus were created, however, you should be familiar with the guidelines for planning menus and with the scripting language rules.



Previous | Next