The files in this directory comprise a demo program which illustrates
the use and implementation of the shell curses functions.  There are 4
distinct types of files: 

    menus................: menu###.txt
    menu scripts.........: menu###.sh
    data entry...........: entry###.txt
    data entry scripts...: entry###.sh

The "###" represents a numerical menu selection value.

The files are processed in the order shown.  First, the Prompts are
displayed from the "menu###.txt" file.  After the user makes a menu
selection, the "menu###.sh" file is executed.  This file usually
contains a program which generates subsequent menus or data entry files.
If no "menu###.txt" file exists, then the "entry###.txt" file is
processed.  Last, if the "entry###.sh" file exists, it is executed.

Typically, at any menu level ( menu levels will be explained later ) the
"menu###.txt" file exists and the "menu###.sh" file may or may not
exist, depending on the application.  At a data entry level ( data entry
level will be explained later ) the "entry###.txt" file exists and the
"entry###.sh" may or may not exist depending on the application.  If the
"entry###.txt" file does not exist, the "entry###.sh" file directly from
the menu.

Menu files contain the menu prompts which are displayed on the screen. 
The prompts are displayed and numbered in the order in which they exist
in the menu file.  Each line consists of two fields delimited with pipe
characters.  Field one is the menu prompt, field two is the prompt type.
 Currently there are only three prompt types: default, modify, and
delete.  A line in the menu file of "default" type would appear as
follows:

    This is the menu prompt||

The "default" type provides the user with a mechanism to save new data
records to the database table.

A line in the menu file of "modify" type would appear as follows

    This is the modify menu prompt|modify|

The "modify" type provides the user with a mechanism to modify existing
data records in the database table.

A line in the menu file of "delete" type would appear as follows

    This is the delete menu prompt|delete|

The "delete" type provides the user with a mechanism to delete existing
data records in the database table.

The menu screen would appear as follows:

-----------------------------------------------------------------------------
PGMdemo                           French Menus                  aigsco05 i386
SCR                          Written by Dana French                  08/06/94


                    1 = This is the menu prompt
 
                    2 = This is the modify menu prompt
 
                    3 = This is the delete menu prompt


Enter Menu Choice (0 for none)..........?:

-----------------------------------------------------------------------------

The menu files are organized according to the selection value entered by
the user.  The selection value determines the menu level, as mentioned
earlier.  The first "main menu" file is always called "menu.txt".  If
the user selects option "2" from the main menu, then the next menu
displayed is from menu file "menu2.txt".  If the user then selects
option "3" from this menu, the next menu displayed is from the menu file
"menu23.txt".  And so on.

Resuming the previous example from menu23.txt. If the user selects
option "1" and there exists the file "menu231.sh", that file is presumed
to be a shell script and executed.  Menu scripts usually generate
subsequent menu prompt or data entry prompt files.

In our example, "menu231.sh" executes and generates a data entry file
called "entry231.txt".  This file contains the data entry prompts which
are displayed on the screen.  The prompts are displayed and numbered in
the order in which they exist in the data entry prompt file.  Each line
consists of two fields delimited with pipe characters.  Field one is the
data entry prompt, field two is the default value.

A line in the data entry file would appear as follows:

    Entry your first value here|123456789|

Environment variable and programs may also be used as the default
values.  For example:

    Entry your second value here|${LOGNAME}|
    Entry your third value here|`pwd`|

The data entry screen would appear as follows:

-----------------------------------------------------------------------------
PGMdemo                           French Menus                  aigsco05 i386
SCR231                       Written by Dana French                  08/06/94


 1: Enter your first value here..(123456789)?: 
 2: Enter your second value here....(userID)?: 
 3: Enter your third value here..(/some/dir)?: 

 4: Enter line Number to change (0 for none)?: 

-----------------------------------------------------------------------------

At termination of the data entry screen, all user input is evaluated and
default values are inserted, where appropriate, and an environment
variable called "RECORD" is created.  This environment variable contains
each entry field value, delimited by pipe characters.  For instance,
using the default values from the previous data entry screen, the RECORD
environment variable would have the following value:

    RECORD="123456789|userID|/some/dir|"

If the previous menu level was of the "default" type, then a new record
is created from the value of this variable.  If the menu level was of
the "modify" type, the existing record is modified with the new values. 
If the menu level was of the "delete" type, the existing record is
deleted.

Resuming file processing from the current menu level, if the file
"entry231.sh" exists, that file is presumed to be a shell script and
executed.  Data entry scripts usually perform some action using the data
entered on the data entry screen.

If the file "entry231.txt" does not exists and "entry231.sh" does, the
shell script is executed from the menu, bypassing the data entry screen.

 
The minimum files required for a menuing system are as follows:

    demo.sh              The main program module
    ../curses.sh         Shell script containing "curses" functions
    ../frenchMenus.sh    Shell script containing menuing functions
    menu.txt             Menu prompts with at least 1 prompt
    entry1.sh            Shell script to execute from the menu

The "demo.sh" file should be copied, renamed, and modified to reflect
the users objectives.  The demo includes a configuration data entry
screen which is a good idea for all implementations.  This allows each
application to be easily configurable across multiple platforms and
environments.  The "entry###.sh" file associated with the configuration
data entry screen will require require implementation specific
modifications.  This script should create/modify the "config.sh" file.
See the the "entry12.sh" file for an example configuration
implementation.


