MaxZ80 - Chapter 14

The tail end of MENU.MNU looks like this:

#$<
<
                            System Menu<
<
                       D. Change B.DSK to dbase.dsk<
                       W. Change B.DSK to work.dsk<
<
                       Z. Issue Z-System command<
<
#<
@ echo h%>i there!<
? !echo %>run OR swim daily!<
D chgdsk b: dbase.dsk;jetldr b0:saved.ndr<
W chgdsk b: work.dsk;jetldr b0:saved.ndr<
Z !"Your command: "<
V !echo 6/4/2007<
##<

This is a System menu. You bring it up by typing $ and, when asked for
a password, the word SYSTEM, in capital letters. The $ following the #
that introduces the display section of this menu is the signal that
this is a System menu. Unlike regular menu pages, the existence of
this page is not apparent from the prompt line at the bottom of the
menu. System menus are intended for administrator applications. Here,
we have our first example of the MYZ80 CHGDSK command. You can build
any number of virtual disc files and, on the fly, change the active
A:, B: or C: disc to any .DSK file you've previously built. That's
what the D and W menu picks do. .DSK files can hold up to about 8 MB.

@ echo h%>i there!

in the command definition section of this menu illustrates another
MENU feature. The @ character does not correspond to any key you might
hit, like the D and the W. It defines a command that is automatically
issued by MENU when this menu comes up. ECHO is a Resident Command
Package command. ECHO displays its command tail on the screen. A
mechanism which supports sending control (non-printing) characters to
the screen and also a way to get upper-case or lower-case characters
to display is built into ECHO. A caret preceding the character means
send the control character. To send the caret itself, precede it with
a %. The % character followed by a < or > means send what follows in
upper-case or lower-case. There's an @ command in the first menu that
reads

@ echo ^i^ip%>ress ^[(%^%<c^[) %>to exit %<menu^j

which causes the message



to appear right after the main menu. The Terminal Capabilities
character strings to turn highlighting on and off are used to make the
^C bright.

While writing this Chapter, I used the Log Shell, LSH. It logs the
commands you issue and lets you recall them by hitting your up or down
arrow keys. Once recalled, you may use the right and left arrow keys
to move forward and backward in the command, inserting and / or
deleting characters, before finally hitting the Enter key.

The first screen shot in Chapter 1 showed a command prompt that
included a highlighted time, a named directory and a >>. The following
does not show the highlighting but otherwise it's what was in that
shot.

6:57 A0:MOUSE>>

LSH is doing this. If you type Esc S (for Save), the prompt will lose
one > and any command you subsequently issue will be saved in LSH's
log file, which is named LSH.VAR and which is kept in A1:. Esc S is a
toggle, so if you issue another Esc S, you'll get the >> back and your
commands will no longer be saved. Esc T will toggle the time display.
Esc Esc will put you in full screen mode, where all your previously
issued commands may been seen. Here's what this looks like :
 
A0:MOUSE  9:44 -
----------------------
dir
filedate /-
exit
cls
sil:
rdump sil:rdump12k.sil -p -l1
ff cmp
b1:
ld cmp30c.lbr
exit
----------------------

Occasionally, I clear my history, which I do via an ARUNZ alias clh.

clh silent shctrl p`era a1:lsh.var`lsh

This quietly (because of silent) pops the shell stack (via the shctrl
utility), thus getting rid of LSH as a shell. It then deletes the log
file, using another Resident Command package command, era, and,
finally, it reinvokes LSH. Those `s are what the silent utility has
been configured to use for the character to use to separate commands
in a multiple command line.

I appealed to LSH while writing this when I was verifying that the
first menu's @ command worked. That's a complicated command to type
and so I hit Esc S to log the command and then typed it. I did have to
appeal to the editing capabilities mentioned above and finally got it
typed correctly.