
MenuScript Editor.
Shareware Version 1.0
Software Copyright (c) 1994 by Peter A. Martin.  All Rights Reserved.

Martin & Associates
9029 Welsh Lane
Abingdon VA 24210-4841
(703) 676-3555


The full-screen editor included with MenuScript is specially designed for
creating and modifying MenuScript script files.  This help file is displayed
internally by the editor to provide information on the various keywords
used by the MenuScript program.

You may add additional comments to this file, but you should ensure that
the keyword preceding each description remains on a line by itself.  The
MenuScript editor uses these words as a "key" for context-sensitive help
in the Assist-Keyword Prompt menu.

 Following are descriptions of valid keywords used by MenuScript Version 1.0:


.BATCH

Purpose:  Defines an option to carry out DOS command(s).

Syntax:   .BATCH[(f[,h])] [display panel text]
           [DOS command]
           [...]

Where:    f = Function Key (1 - 10)
          h = Hot Key Code (See Table 2)

Comments: When a BATCH option is selected, MenuScript terminates and carries
          out the commands from secondary batch file.  The secondary batch
          file then calls first batch file (MENU.BAT) to which causes
          MenuScript to re-run.

          If a specified DOS command is a batch command (.BAT file),
          precede with DOS command CALL or COMMAND /C, e.g.,

          CALL filename.BAT
           or
          COMMAND /C filename.BAT

          Using the command "GOTO QUIT" as a DOS command will prevent
          MenuScript from re-running, leaving the user at the DOS prompt.

Example:  Define an option that will change to a subdirectory named
          C:\MONEY and run a program named POVERTY.EXE.  Option is to be
          selected using either the <F2> key or hotkey combination <Alt-P>
          (Key Code -25).  Display the word "Poverty" as a menu option.

          .BATCH(2,-25) Poverty
          C:
          CD\MONEY
          POVERTY.EXE

Example:  Define an option that will exit MenuScript and return user to DOS.
          Display message instructing user how to re-run program.  Display
          "Exit Program" as an option on the scroll menu.

          .BATCH Exit Program
          cls
          echo Type and enter MENU to return to MenuScript.
          goto quit

Example:  Define an option to branch to a script file named DIAGS.MNU if user
          enters correct password.  Display "System Diagnostics" as option.

          .BATCH System Diagnostics
          pw.exe 10
          if not errorlevel 1 menu.bat diags.mnu

          Note:  PW.EXE is a password-checking program included with
          MenuScript that returns an errorlevel greater than zero if user fails
          the check.  See Password documentation (PW.HLP) for details.

          To make a non-conditional branch to another menu, define option
          using keyword MENU.



.SHELL

Purpose:  Defines an option to either

          -    provide a "DOS Shell", or
          -    carry out specified DOS commands via a secondary command
               processor.

Syntax:   .SHELL[(f[,h])] [display panel text]
          [DOS command]
          [...]

Where:    f = Function Key (1 - 10)
          h = Hot Key Code (See Table 2)

Comments: If no DOS commands are specified, option will "shell to DOS" and
          remain there until user enters "EXIT".  If DOS commands are
          specified, MenuScript carries out commands from secondary command
          processor.

Example:  Define option that enables user to "shell to DOS."  Option is to
          display "DOS Shell" and is to be selected using the <F8> key.

          .SHELL(8) DOS Shell

Note:     Using BATCH keyword is generally preferable to using SHELL to
          carry out DOS command(s).



.MENU

Purpose:  Defines an option to branch to another menu.

Syntax:   .MENU[(f[,h])] [display panel text]
          [filename]

Where:    f = Function Key (1 - 10)
          h = Hot Key Code (See Table 2)

Comments: If filename is not specified, option will return user to previous
          menu.  Implicit extension of .MNU is assumed unless specified.
          If filename does not exist, MenuScript will create it the first time
          it is selected and preload with statements contained in "template"
          script file TEMPLATE.MNU.  Using a DOS "wildcard" character (* or ?)
          as a part of the filename will cause MenuScript to display a
          selectable menu of filenames meeting the file specification.

Example:  Define option to branch to script file named MENU_10.MNU.  Option
          is to be selected using F10 key.  Display Menu #10 as option.

          .MENU(10) Menu #10
          menu_10

          Note that the .MNU extension is optional.

Example:  Define option that will return user to previous menu.  Option is
          to be selected when user presses the <Esc> key.  Don't display
          this option on menu.

          .MENU(,27)

          Note that line following the MENU keyword is left blank.  This
          instructs MenuScript to backup to the previous menu.

          Note:     The MAINMENU.MNU script file is considered the "root"
                    menu.  You cannot backup to a previous menu from the
                    MAINMENU.MNU file.

Example:  Define option that allows user to branch to a script file meeting
          a the file specification *.MNU.  Display "GOTO MENU" as option,
          and define it to be selected using the <F2> key.

          .MENU(2) GOTO MENU
          *.mnu



.QUIT

Purpose:  Defines an option to quit MenuScript.

Syntax:   .QUIT[(f[,h])] [display panel text]

Where:    f = Function Key (1 - 10)
          h = Hot Key Code (See Table 2)

Example:  Define key to exit MenuScript.  Select using <F10> key or
          hotkey <Alt-Q> (Key Code -16).   Display "Quit" as option.

          .QUIT(10,-16) Quit



.SETUP

Purpose:  Defines option to access internal setup menu.

Syntax:   .SETUP[(f[,h])] [display panel text]

Where:    f = Function Key (1 - 10)
          h = Hot Key Code (See Table 2)

Example:  Define option to select setup menu using hotkey <Alt-S>.

          .SETUP(,-31)



.EDIT

Purpose:  Used to define an option to edit script file.

Syntax:   .EDIT[(f[,h])] [display panel text]

Where:    f = Function Key (1 - 10)
          h = Hot Key Code (See Table 2)

Example:  Define option to edit script file using hotkey <Alt-E>.

          .EDIT(,-18)



.TITLE

Purpose:  Defines display panel title.

Syntax:   .TITLE display panel text

Example:  Display "MAIN MENU" as a menu title.

          .TITLE MAIN MENU



.NOEDIT

Purpose:  Disables editing menu from within MenuScript.

Syntax:   .NOEDIT

Example:  Disable default <Ctrl-Enter> hotkey and any other EDIT keywords.

          .NOEDIT



.WIPE

Purpose:  Specifies method of clearing screen when options are selected.

Syntax:   .WIPE n

Where:    n = Screen wipe mode (1 to 13)

Comments:

Example:  Specify display panel to clear using Wipe Method #3.

          .WIPE 3



.INPUT

Purpose:  Prompts for user input following BATCH or SHELL keyword.

Syntax:   .INPUT [l],"prompt text",v[,d],[-c|-n]

Where:     l = length of input field
           v = variable name.  Any occurances of the variable name you
               specify in the DOS commands associated with the option
               will be replaced by the input entered by the user.
               Special variable %fspec can be used to display picklist
               of files meeting file spec as defined by default variable
               below.
           d = variable default
          -c = capitalize input
          -n = accept numeric input only

Example:  Prompt user to enter his/her first name in a 10-character
          field, capitalize input:

          .INPUT 10, "Enter your first name",name$,,-c
           echo Your name is name$.

Example:  Prompt user to select file from list of files meeting
          filespec C:\*.BAT:

          .INPUT "Select file",%fspec,c:\*.bat
           echo You selected %fspec
           echo Path is %path
           echo File is %file
           echo Extension is %ext

           Note: In the above example, MenuScript will break the selected
           file into three parts:  Path, Filename (w/o extension), and
           Extension (including "."), and assign them to %path, %file, and
           %ext.  For example, if user selected C:\AUTOEXEC.BAT, the above
           option would display

           You selected C:\AUTOEXEC.BAT
           Path is C:\
           File is AUTOEXEC
           Extension is .BAT


.COLOR

Purpose:  Specifies display panel colors.

Syntax:  .COLOR [Color1][,Color2][,Color3][,Color4]

Where:    Color1 = Title Color
          Color2 = Function Key Menu Color
          Color3 = Scroll Menu Normal Color
          Color4 = Scroll Menu Highlighted Color

Comments: Colors are specified using integers in Table 1.  Leaving any
          parameter blank will retain current setting.

Example:  Specify display panel with the following colors:

          .COLOR 112,31,112,7
                 :   :  :   :
                 :   :  :   :.. Scroll Menu Highlighted Color
                 :   :  :...... Scroll Menu Normal Color
                 :   :......... Function Key Color
                 :............. Title Color



.BORDER

Purpose:  Specify display panel borders.

Syntax:   .BORDER n

Where:    n = 0     No border
          n = 1     Single line border
          n = 2     Double line top, single line sides
          n = 3     Single line top, double line sides
          n = 4     Double line top, double line sides
          n > 4     Use actual ASCII character as border

Example:  Specify a single-line border around display panel areas.

          .BORDER 1



.SHADOW

Purpose:  Specify shadow effect on display panel areas.

Syntax:   .SHADOW n

Where:    n = 0     No shadows
          n = 1     Display shadow

Example:  Cause display panel to use shadow effect.

          .SHADOW 1



.POSITION

Purpose:  Specify positions of display panel areas.

Syntax:   .POSITION n

Where:    n = 1     Center scroll menu, function key menu on bottom
          n = 2     Function key menu on left, scroll menu on right
          n = 3     Scroll menu on left, function key menu on right

Example:  Specify a display panel with function keys on the left and
          scroll menu on the right.

          .POSITION 2



.ERROR

Purpose:  Specify the color, sound, and timeout of error messages.

Syntax:   .ERROR [boxColor][,sound][,timeout]

Where:    boxColor = value from Table 1
          sound    = 0 to 10
          timeout  = 0 to 99 seconds

Comments: Leaving any parameter blank will retain current setting.

Example:  Display error messages in a red box with bright brown letters;
          use sound #9, display for 5 seconds (or untiluser presses a key):

          .ERROR 78, 9, 5



.WALLPAPER

Purpose:  Specify background used by display panel.

Syntax:   .WALLPAPER filename | [ASCIIvalue][,color]

Where:    filename   = binary text screen file
          ASCIIvalue = character to use for background
          color      = color to use for background from Table 1

Comments: There are two basic types of background "wallpaper" you can use:

          1.   An ASCII character which will fill the screen in a color of
               your choosing.

          2.   A text image saved in a binary file.

Example:  Use image saved in file MSCRIPT.SCR as background wallpaper.

          .WALLPAPER MSCRIPT.SCR

Example:  Fill screen will ASCII character 177, green foreground on a blue
          background (Color Code 18, see Table 1).

          .WALLPAPER 177,18



.CHAIN

Purpose:  Chains options in another script file into current script file at
          runtime.

Syntax:   .CHAIN filename

Where:    filename = name of script file

Comments: Options from specified script file will be included in current menu
          file at location of CHAIN statement.

Example:  Function key option definitions are included in script file
          FKEYS.MNU.  To include these definitions in current script file,
          use

          .CHAIN fkeys




                    TABLE 1: Single-Digit Screen Color Chart

              Black   Blue  Green   Cyan   Red  Magenta Brown  White

Black           0      16     32     48     64     80     96    112
Blue            1      17     33     49     65     81     97    113
Green           2      18     34     50     66     82     98    114
Cyan            3      19     35     51     67     83     99    115
Red             4      20     36     52     68     84    100    116
Magenta         5      21     37     53     69     85    101    117
Brown           6      22     38     54     70     86    102    118
White           7      23     39     55     71     87    103    119
Gray            8      24     40     56     72     88    104    120
Bright Blue     9      25     41     57     73     89    105    121
Bright Green   10      26     42     58     74     90    106    122
Bright Cyan    11      27     43     59     75     91    107    123

Bright Red     12      28     44     60     76     92    108    124
Bright Magenta 13      29     45     61     77     93    109    125
Bright Brown   14      30     46     62     78     94    110    126
Bright White   15      31     47     63     79     95    111    127

MenuScript uses the above single-digit numbers to represent
foreground/background screen color combinations.  For example, the
number 48 defines black characters on a cyan background; 23 defines
white characters on a blue background, and so forth.




                       TABLE 2: Keyboard Codes

                            With     With       With
        Key      Code      Shift     Ctrl        Alt

        ESC       27        27        27
        1!        49        33                  -120
        2@        50        64        -3        -121
        3#        52        35                  -122
        4$        52        36                  -123
        5%        53        37                  -124
        6^        54        94        30        -125
        7&        55        38                  -126
        8*        56        42                  -127
        9(        57        40                  -128
        0)        48        41                  -129
        -_        45        95        31        -130
        _+        61        43                  -131
        BKSP      8         8         127
        TAB       9        -15
        Q         113       81        17        -16
        W         119       87        23        -17
        E         101       69        5         -18
        R         114       82        18        -19
        T         116       84        20        -20
        Y         121       89        25        -21
        U         117       85        21        -22
        I         105       73        9         -23
        O         111       79        15        -24
        P         112       80        16        -25
        [{        91        123       27
        ]}        93        125       29
        ENTER     13        13        10
        CTRL
        A         97        65        1         -30
        S         115       83        19        -31
        D         100       68        4         -32
        F         102       70        6         -33
        G         103       71        7         -34
        H         104       72        8         -35
        J         106       74        10        -36
        K         107       75        11        -37
        L         108       76        12        -38
        ;:        59        58
        '"        39        34
        `~        96        126
        L SHIFT
        \|        92        124       28
        Z         122       90        26        -44
        X         120       88        24        -45

        C         99        67        3         -46

        V         118       86        22        -47
        B         98        66        2         -48
        N         110       78        14        -49
        M         109       77        13        -50
        ,<        44        60
        .>        46        62
        /?        47        63
        R SHIFT
        * PRTSC   42                  16
        ALT
        SPACE     32        32        32         32
        CAPS
        F1        59        -84       -94       -104
        F2        60        -85       -95       -105
        F3        61        -86       -96       -106
        F4        62        -87       -97       -107
        F5        63        -88       -98       -108
        F6        64        -89       -99       -109
        F7        65        -90       -100      -110
        F8        66        -91       -101      -111
        F9        67        -92       -102      -112
        F10       68        -93       -103      -113
        NUM
        SCROLL
        HOME     -71        55        -119
        UP       -72        56
        PGUP     -73        57        -132
        GREY-    -74        45
        LEFT     -75        52        -115
        CENTER              53
        RIGHT    -77        54        -116
        GREY+    -43        43
        END      -79        49        -117
        DOWN     -80        50
        PGDN     -81        51        -118
        INS      -82        48
        DEL      -83        46

Use the above key codes to define a hot key to select a menu option.
For example, the key code for the END key is -79.  To define a batch
mode option that is selected when the END key is pressed, you would
define the option as follows:

.BATCH(,-79) The End
cls
echo You pressed the END key.
pause
