Historically, ZFILER is a descendant in the line of file maintenanceì
utilities like SWEEP and NSWP (hence the "filer" part of the name). Fileì
maintenance is generally concerned with copying files, looking at theirì
contents, renaming them, erasing them, and so on. ZFILER provides all theseì
functions and more.
ZFILER's immediate parent was VFILER, where the "V" stood for video. ì
The TCAP facility in Z-System makes it easy for programs to take advantageì
of the full-screen capabilities of whatever video display terminal happensì
to be in use at any time. In contrast to applications under CP/M, Z-Systemì
programs need not be configured to match the terminal. It was, therefore,ì
natural to build a file maintenance program in which the files are displayedìègraphically on the screen. When I decided to explore some new directionsì
with VFILER, to avoid confusion I gave the program the new name ZFILER, forì
Z-System Filer.
The file maintenance tasks described above would not require a shell. ì
Making the program a shell, however, allows it to go beyond the functionsì
included in the program's own code. Because a shell can pass command linesì
to the operating system, ZFILER can perform any operation that the computerì
is capable of. Like a menu system, however, it helps the user by generatingì
the commands automatically at the touch of a key.
When ZFILER is running, the screen is filled with an alphabetizedì
display of the files in a specified directory, and there is a pointer thatì
the user can manipulate using cursor control keys. If we had a mouse toì
move the pointer, it would be a little like having a Macintosh. Actually,ì
it would be a lot more. It would be like having a mouse with fifty buttons! ì
Once the pointer has been positioned on a file, pressing a key (or two orì
Then there is the issue of support for time and date stamping of files. ì
ZFILER contains the code for preserving the time stamps when files areì
copied. So as not to inflict the overhead of this code on those who haveì
not implemented DateStamper (though they should do that!), ZFILER is alsoì
provided in versions with and without the DateStamper code.
If we supported all combinations of the above choices, there would beì
eight different versions of ZFILER. Typically, the distribution libraryì
contains four or five of the combinations. For example, a five-column fileì
display is not particularly compatible with reverse video highlighting,ì
because the reverse video of tagged files runs into the reverse-videoì
pointer.
When you get ZFILER, you have to choose which version you prefer,ì
extract it for the distribution library, and give it a working name (some ofì
the early Z-System shells had to have a specific name, but you can giveì
ZFILER any name you like). I prefer the name ZF, since it is very quick andìèeasy to type, and I will use that name in all the examples that follow.
The general syntax for invoking ZFILER is
ZF filespec
where "filespec" is a standard Z-System ambiguous file specification (thatì
is, it may contain the wildcard characters "?" and "*"). The filespecì
selects the directory area and the files from that area to be included inì
the screen display.
Various parts of the filespec can be omitted. If no filespec is givenì
at all, then "*.*" for the currently logged directory is assumed. ì
Similarly, if only a directory is specified (e.g., B: or 3: or B3: orì
WORK:), then all the files ("*.*") in that directory are displayed. If aì
file name/type is included, then it will serve as a mask on the files to beì
displayed. Thus "ZF WORK:*.DOC" will show only files of type DOC in theì
directory WORK:.
The directory and file mask can both be changed from inside ZFILER asì
well using the "L" or LOG command. I bring this up now because there is aì
confusing difference in the way the "L" command works. VFILER originallyì
allowed one to change only the directory and not the file mask from insideì
the program. To save the user the trouble of typing the colon after aì
directory, its inclusion was made optional. Since users became soì
accustomed to this shorthand, it was carried over into ZFILER. Because ofì
this, if you want to change only the file mask, you must remember to precedeì
it with a colon. Otherwise your mask will be taken as the name of aì
directory (which generally results in an error message).
One brief aside for programmer types. ZFILER can be loaded from anyì
directory. One of the special features of Z-System since version 3.3 of theì
command processor allows a program to find out both its own name and theì
directory from which it was actually loaded, perhaps as the result of a pathì
search. ZFILER builds the shell stack entry to invoke ZFILER under itsì
current name from the directory in which it is actually located. Thisì
sometimes makes it run faster, and it allows ZFILER to be invoked from aì
directory that is not on the search path.
The ZFILER Display
The main ZFILER display contains three parts. At the top of the screenì
there is a message line. In the version of ZFILER that is current at theì
time I am writing this column (version 1.0L), this line contains, from leftì
to right, the following information: (1) the directory that has beenì
selected, in both DU and DIR (named directory) format; (2) the indicatorì
"[PUBLIC]" if that directory is a ZRDOS public directory (if you don't knowì
what this is, just ignore it); (3) the current time of day if DateStamper orì
one of the new DOSs (ZSDOS or ZDDOS) is running; (4) the program's officialì
name and version; (5) the text string "Current File:"; and (6) the name ofì
the file currently being pointed to (this changes as the pointer is moved).
At the bottom of the screen is a command prompt of the form
Command? (/=Help, X=Quit):è
The cursor (don't confuse this with the file pointer) is positioned afterì
this command prompt to indicate that ZFILER is waiting for you to press aì
key.
The center 20 lines of the screen show the selected files. Theì
character string "-->" (only "->" in the five-column display) floats betweenì
the rows of file names and designates the so-called "pointed-to" file. Manyì
of the ZFILER commands automatically operate on this file.
What we have described so far is the main ZFILER screen, but it is notì
the only one. As the command prompt suggests, pressing the slash characterì
(or "?" if you prefer) brings up a help screen that summarizes the built-inì
commands of ZFILER. This help screen replaces the file display but leavesì
the status line at the top and the command line at the bottom, except thatì
"/=Help" changes to "/=Files". As you might, therefore, guess, pressingì
slash again will take you back to the file display screen.
I do not know if anyone makes use of this feature, but all ZFILERì
command operations can be invoked from the help screen. Although you cannotì
see the file pointer, you can manipulate it in the usual way, and you canì
tell what file you are pointing to from the name displayed at the upperì
right on the status line.
ZFILER Commands
I am not going to attempt to describe all of ZFILER's commands, but Iì
will try to list most of them. Basically, the commands fall into severalì
classes.
One classification reflects where the code for the command resides. ì
There are two categories:
A. Built-In Commands
B. Macro Commands
Class A includes the functions for which the code is part of ZFILER. Macroì
commands are like aliases in that they generate command lines that areì
passed to the command processor for execution. These commands make ZFILER aì
shell. In this column I will discuss only the built-in commands, and I willì
take up the more complex subject of macro commands next time.
A second classification depends on what the command acts on. Threeì
categories describe the object of the commands:
1. the pointed-to file
2. a group of tagged files
3. neither of the above
We will begin the discussion with commands of class A3, resident commandsì
that do not perform any action on the files.
Pointer Commands
Class A3 includes the commands that move the file pointer. These areìèshown on the help screen, and I will not list them here. One can move theì
pointer to the next file on the screen or to the previous one (withì
wraparound); up, down, left, or right (with wraparound); to the first orì
last file on the current screen; or to the very first or very last file ofì
those selected by the file mask. One can advance to the next screen ofì
files or to the previous screen. Obviously, some of these functions will beì
redundant in some cases, such as when all the selected files can fit on oneì
screen (think what happens when there is exactly one file selected).
ZFILER learns from the TCAP the control characters sent by any specialì
cursor keys on the keyboard (provided they send a single control characterì
and provided the TCAP has been set up correctly), and it makes them generateì
the up, down, left, and right functions. If the cursor keys generateì
control codes normally used for another function, then that function will beì
lost (the cursor keys take precedence). That can cause problems. Oneì
solution is to eliminate the definition of the cursor keys in the TCAP andì
simply use the default WordStar diamond keys for those functions. ì
Alternatively, one can patch ZFILER to use different keys for its ownì
functions, but this is not straightforward to do, and I will not describe itì
here.
The "J" (Jump) command allows you to jump to a file that you name. ì
This is very handy when there are many files in the display or when the fileì
you want is not on the current screen. Press the "J" key, and you will beì
prompted for a file name. You do not have to enter the exact name. ZFILERì
automatically converts what you type into a wildcard filespec, and it findsì
the first file that matches. For example, if you enter only "Z" followed byì
a return, this is equivalent to "Z*.*", and ZFILER will move the pointer toì
the first file that starts with a "Z". Similarly, if you enter ".D", ZFILERì
will move to the first file with a file type that starts with "D".
The "J" function is very handy; however, there is more. Many peopleì
are not aware that you may press control-J to repeat the same search andì
find the next matching file. The search will wrap around from the end ofì
the files back to the beginning. This function is not listed on the helpì
screen because I could not find room for it.
Other Non-File Commands
Some other commands that do not act on files are: X, L, A, S, E, H, Z,ì
and O. "X", as the command prompt reminds you, is used to exit from ZFILER. ì
Besides terminating the current execution of the program, it also removesì
ZFILER's entry in the shell stack (if it did not, you would just reenter itì
right away).
We already spoke about the "L" (Log) command earlier. The "A"ì
(Alphabetize or Arrange or Alpha sort) toggles the way in which the filesì
are sorted, namely alphabetically by the file name or by the file type. ì
The "S" (Status) command prompts you for a disk drive letter and then tellsì
you the amount of space remaining on that disk.
The "E" command (refresh scrEEn -- I know that's stretching things, butì
"R" was already used) redraws the screen. You might think that this wouldì
never be needed, but there are two circumstances in which it comes in veryì
handy. One is when ZFILER is being used on a remote system. It is trueìèthat very few RASs make ZFILER available, but I do on Z-Node #3. If you getì
some line noise, the screen can become garbled. Then the "E" key can beì
used to draw a fresh screen.
The other circumstance in which the "E" command saves the day is withì
Backgrounder-ii if you do not have a screen driver (I don't for my Conceptì
108 terminal -- never got around to writing one, partly because all theì
programs I use frequently have a redraw key like this one). I simply defineì
a BGii key macro specifying "E" as the "redraw" key, save the keyì
definitions to ZFILER.BG, and attach that definition to ZF.COM. Thenì
whenever I swap tasks back into ZFILER, BGii simulates my pressing the "E"ì
key, and the screen is redrawn. This often gives a faster screen refreshì
than one gets with a full-fledged screen driver.
The "H" (Help) command generates a macro command to invoke the Z-Systemì
HELP facility. To tell the truth, I have not used this and don't evenì
remember precisely what it does. I would have to look at the source code.
The "Z" (Z-system) command prompts you for a command, and whatever youì
enter is passed on to the Z-System multiple command line buffer forì
execution. When that command line is complete, ZFILER is reinvokedì
automatically.
When you use the "Z" command, you will normally be logged into theì
directory that is currently displayed. However, this will not always beì
possible. ZFILER allows you to select directories with user numbers from 0ì
to 31. Unless you are using a version of ZCPR33 or ZCPR34 with the HIGHUSERì
option enabled, you cannot log into user areas above 15. In that caseì
ZFILER will put you in the directory your were in when you invoked ZFILER. ì
In any case, the command prompt will indicate the directory from which yourì
command line will be executed.
Since commands you run using the "Z" function may put some informationì
on the screen that you would not want ZFILER to obliterate immediately,ì
there is a flag set that signals ZFILER to prompt you and to wait for you toì
press a key before putting up its display. Here is a tip for advancedì
users. If you enter your command line with one or more leading spaces, thisì
shell-wait flag will not be set, and ZFILER will return without your havingì
to press a key. The leading spaces are stripped from the command lineì
before it is passed to the command processor. This means that you cannotì
use a leading space to force invocation of the extended command processorì
(ECP); you have to use the slash prefix instead. A space and a slash willì
force invocation of the ECP and will disable the shell-wait flag.
The final command in class A3 is the "O" (Options) command. It is aì
complex topic, and I will leave it for next time. If you can't wait untilì
then, experiment with it. It should not be able to do any harm to yourì
system.
Single-File Built-In Functions
Now let's discuss the commands in class A1, the built-in commands thatì
act on the pointed-to file. These are invoked by pressing one of theì
following keys, whose meaning is indicated in parentheses: C (Copy), Mì
(Move), D (Delete), R (Rename), V (View), P (Print), F (File size), T (Tag),ìèand U (Untag). Some of these are self-explanatory, and I will not discussì
them.
The "C" command copies a file to another directory under the same name;ì
it does not allow one to give a new name for the destination file (however,ì
you can do that with a macro command). The "M" command does not really moveì
a file; it copies the file and then, if the copy was successful, deletes theì
original file. It is really a combination of "C" and "D". Moving a fileì
this way is inefficient if the destination directory is on the same drive asì
the source file. A macro command that invokes an ARUNZ alias can get aroundì
this limitation (and almost all other ZFILER limitations).
The tag and untag commands are used to select a group of files on whichì
operations can be performed. Tagged files are indicated in two ways. Aì
special character ("#") is placed after the file name in the display, and,ì
if the terminal supports video highlighting, the file is highlighted.
Two related commands are W (Wild tag) and Y (Yank back?). "W" allowsì
you to tag or untag groups of files designated by an ambiguous file spec. ì
After tagged files are operated on by the built-in group commands describedì
below, the tag marker "#" is changed to "'" (a soft tag). The "Y" commandì
changes the soft tags back into hard tags so that further group operationsì
can be performed on those files.
Built-In Group Commands
Group commands are initiated by pressing the "G" (Group) key. Theì
command prompt at the bottom of the screen changes to
The options controlled by the option menu can also be permanently changedì
in the ZFILER program file using a patching utility like ZPATCH. In theì
first page of the file, you will see the ascii string "OPT:". The elevenì
bytes following this string contain the startup values for the elevenì
options. Patch a byte to 00 for NO or FF for YES.
ZFILER Macros
Although ZFILER can accomplish many tasks using its built-in functions,ì
its real power comes from the macro facility, which allows it to be extendedì
to include any functions that can be performed using combinations of otherì
programs. This is where ZFILER really makes use of its power as a shell. ì
First I will describe how the macro facility is used, and then I willì
describe how the user defines the macro functions. As with the built-inì
functions, macro functions can operate either on single files or on groupsì
of files. The single-file macro facility is well developed and was alreadyì
present in nearly the same form in VFILER; the group macro facility is newì
with ZFILER and has not been fully developed yet.
Invoking Macros
One way to initiate a macro operation on the pointed-to file is to pressì
the macro invocation key, which is normally the escape key. A prompt ofìè"Macro:" will appear after the normal ZFILER command prompt. At this pointì
you have several choices. If you know the key corresponding to the macroì
you want to run, then you can simply press that key. ZFILER will thenì
construct a command line and pass it on to the command processor forì
execution. If ZFILER is configured for instant macro operation (itì
generally is), then macros associated with the number keys "0" through "9"ì
can be initiated without the macro invocation key; the number key enteredì
alone at the main ZFILER command prompt will generate the macro function.
If you press the macro invocation key a second time, a user-created helpì
screen will be displayed. This screen generally lists the available macroì
functions. You can now press the key for the desired function, or you canì
press carriage return to cancel the macro operation and return to the mainì
ZFILER menu. The help menu screen will also be displayed if you press theì
"#" key. This is a holdover from VFILER and arises in part because of theì
structure of the file in which the macros are defined (more on thisì
shortly).
Group macros are invoked in a similar way from the group function commandì
line. After you have tagged a group of files, press the "G" key to enterì
group mode. The prompt will list only the built-in group functions, but ifì
you press the macro invocation key, you can proceed as described above forì
single-file macro operations, except that the macro function will beì
performed on each of the tagged files.
The group macro facility works a little differently than the single-fileì
macro facility. Since the command line would generally not be long enoughì
to contain the commands for all the tagged files, the group macro facilityì
works by writing out a batch file for processing by ZEX or SUBMIT. In thisì
way there is virtually no limit to the number of files on which group macrosì
can operate.
There are many configurable options (described below) that are associatedì
with the group macro operation. These include the name of the ZEX or SUBì
batch file, the directory to which it is written, and the command line thatì
ZFILER generates to initiate the batch operation. The NZ-COM version ofì
ZFILER uses a file called ZFILER.ZEX and the command line "ZEX ZFILER". Theì
Z3PLUS version, under which ZEX will not run, uses a file called ZFILER.SUBì
and a command line of "SUBMIT ZFILER".
Since macros (and the main menu "Z" function) work by passing commands toì
the command processor, file tags will be lost in the process, and whenì
ZFILER resumes operation, it starts afresh. In a future version of ZFILER,ì
I hope to preserve the tag information by having it optionally written to aì
temporary file (the shell stack entry is far too small) and read back inì
when ZFILER resumes.
Defining Macros -- The CMD File
Now let's learn how to define the macro functions we want. As Iì
indicated earlier, the macros are defined in a file called ZFILER.CMD (theì
ZFILER ComManD file). In the version of ZFILER distributed with NZ-COM andì
Z3PLUS, the CMD file is searched for in the root directory of the ZCPR3ì
command search path. As described earlier, the option menu allows theìèentire path to be used. There are also some additional configurable optionsì
that will be discussed another time. You must be sure to put yourì
ZFILER.CMD file in the appropriate directory. If the file cannot beì
located, you will still get the macro prompt, but, after you have specifiedì
a macro key, the error message "ZFILER.CMD NOT Found" will be displayed.
The ZFILER.CMD file is an ordinary text file that you can create with anyì
editor or wordprocessor that can make plain ascii files (WordStar inì
nondocument mode, for example). The CMD file has two parts. The first partì
contains the macro command definitions; the second contains the help screenì
(described earlier).
In the first part of the CMD file, each line defines a macro. Theì
character in the first column is the key associated with that definitionì
(case does not matter). Macros can be associated with the 10 number keys,ì
26 letter keys, and all printable special characters except for "#"ì
(explained below). The space character and all control characters are notì
allowed. Owing to an oversight, the rubout character can be associated withì
a macro!
After the character that names the macro there can be any number ofì
blanks (including zero). If the first non-blank character is "!", then theì
"strike any key" (shell-wait) prompt will appear before ZFILER puts up theì
file display after a macro command is run. This should be used whenever theì
macro will leave information on the screen that you will want to read. ì
After the "!" there can again be any number of spaces. Any remaining textì
on the line is taken as the script for the macro command.
The second part of the CMD file starts when a "#" character is found inì
the first column (hence the exclusion of that character as a macro name). ì
Once that character appears, all remaining text, including text on the line,ì
will be used as the help screen. Since ZFILER will add some information toì
the display (the name of the pointed-to file and a prompt), you willì
generally want to keep the help screen to no more than 20 lines, includingì
an extra blank line at the end for spacing. With some experimentation youì
will get the hang of designing this screen.
Macro Scripts
ZFILER macro scripts are similar to those in ARUNZ and in the other menuì
shells (MENU, VMENU, FMANAGER) in that parameter expressions can appear. ì
The critical parameters -- the ones that implement functions that cannot beì
achieved any other way -- are those that convey information about theì
directory currently displayed by ZFILER and about the pointed-to file. ì
Parameters consist of a "$" character followed by one of the charactersì
listed below.
User prompt parameters
' User input prompt
" User input prompt
Parameters for directories
- currently displayed directoryè C DIR form
D Drive letter
U User number
- home directory (from which ZFILER was invoked)
H DU form
R Home DIR
Parameters for pointed-to file
P Full information (DU:FN.FT)
F File name (FN.FT)
N File name only
T File type only
Special parameters
! GO substitution indicator
$ The dollar character
The parameters are listed in a special order above, and we will explainì
that later. First we will just present the meaning for each parameter.
The parameter expressions $" and $' are used to display a prompt messageì
to the user and to read in a response string. Single and double quotes areì
equivalent. Once the prompt parameter has been detected, all subsequentì
characters up to one of the quote characters are displayed as the userì
prompt. Thus, if I am not mistaken, there is presently no way to put eitherì
quote character into the prompt. The end of the line or the end of the fileì
will also terminate the prompt.
No special character interpretation is performed while expanding theì
prompt. If you want to make fancy screens, you can include escape sequencesì
and some control characters (obviously carriage return won't work). In theì
future, ZFILER should be enhanced to provide a means to generate all controlì
characters, to allow special characters to invoke screen functions based onì
the current terminal definition, and to expand directory and file parametersì
in the prompt.
Now for the directory parameters. Parameters C, D, and U returnì
information about the currently displayed directory, while H and R returnì
information about the home directory, the one from which ZFILER wasì
originally invoked. PLEASE NOTE: macros always operate from the homeì
directory. The reason for this is that ZFILER can display directories withì
user numbers higher than 15 even when it is not possible to log into theseì
areas. If you want to operate in the displayed directory, then your scriptì
must include an explicit directory-change command of the form "$D$U:" at theì
beginning (or "$C:" if your system requires the use of named directories)ì
and a command of the form "$H:" (or "$R:") at the end.
One special note about the parameters that return directory names. Ifì
the directory has no name, then the string "NONAME" is returned. This willì
presumably not match any actual name and will lead, one hopes, to a benignì
error condition. These parameters are included only for systems that do notì
allow directories to be indicated using the DU form (I hope that few if anyìèsystems are set up this way).
Now we come to the four file name parameters. They allow us to generateì
easily the complete file specification or any part of it. Note that "$F" isì
not quite the same as "$N.$T". The latter always contains a dot; the formerì
does not if the file has no file type.
Finally, we have two special parameters. "$$" is included to allow aì
dollar sign character to be entered into the script. "$!" is a controlì
parameter that is used only when a group macro is executed. If it is placedì
immediately before a token (string of contiguous characters), then thatì
token will be replaced by the string "GO" on all but the first expansion ofì
the script. This allows group macro scripts to operate faster by avoidingì
repetitive loading of a COM file. It must be used with great care andì
consideration, however, for reasons that I will not go into here.
Rules for Script Expansion
ZFILER follows a specific sequence of steps when expanding a script, oneì
that gives it a special feature that, I would guess, few users are aware of. ì
The first step in the expansion is to process only the user-input promptì
parameters, substituting for the prompt whatever the user entered inì
response. This results in a modified script that is then processed by theì
second step in the expansion. Because the expansion is handled this way,ì
the user input can include ZFILER script parameters! Thus the script canì
be used to write a script. You will see an example of this later.
The second step in the expansion is to substitute values for theì
directory parameters, which are a kind of constant. They do not change as aì
function of the pointed-to file. Finally, in a third step, the remainingì
parameters are expanded. For group macros, this final step in the expansionì
is repeated for each of the tagged files. The file parameters are expandedì
differently for each file, and, starting with the second tagged file, theì
"$!" parameter causes "GO" substitution.
Macro Examples
Listing 3 shows an example of a ZFILER.CMD file, one designed toì
illustrate some techniques of macro writing. While writing this article, Iì
discovered that one can include blank lines as shown to make the CMD fileì
easier to read. The help screen part of the listing is taken from myì
personal script file (which, I have to confess, I have not really workedì
very hard at). The macro definition part of the listing includes only a fewì
of the definitions.
The macro "Q" is included to illustrate a very simple, but useful, typeì
of macro. It invokes the very powerful file typing program QL (quick look)ì
on the pointed-to file. This is handy when you want more powerful viewingì
capability than that offered by the built-in "V" command. QL can handleì
crunched files and libraries, and it can display text or hex forward orì
backward.
Macro "U" uncompresses a file. It illustrates a more complex script thatìèinvolves flow control and parameters that extract individual components ofì
the pointed-to file name. It tests the file type to see if the middleì
letter is "Q" or "Z". In the former case, it unsqueezes the file; in theì
latter, it uncrunches it. The uncompressed file it put into the sourceì
file's directory.
Macros S, K, and B illustrate the use of input prompting. The first oneì
allows the user to specify the file attributes to be set. Note that theì
prompt includes a helpful reminder of the syntax required by SFA.
Macro K crunches files to a user-specified destination. It alsoì
illustrates how one logs into the currently displayed directory. I do thisì
here so that a null answer to the prompt (i.e., just a carriage return) willì
result in the crunched files being placed in the currently displayedì
directory rather than in the home directory, as would otherwise be the caseì
(since that is where the macro runs from, remember). As a result, however,ì
this macro will not operate properly in user areas above 15 under BGii orì
versions of the command processor that do not allow logging into high userì
areas.
Macro B performs a slightly more complex function. It not onlyì
compresses the pointed-to file to a specified destination directory, but itì
then marks the source file as having been backed up. A combination of theì
group archive built-in command (to tag files that need backing up) and aì
group macro B (to perform the backup) gives the ZFILER user a way to back upì
files in crunched form on the backup disk.
Macro M is included to show that a ZFILER macro, when it needs to doì
something more complex than it is capable of doing all by itself, can passì
the task to an ARUNZ alias. The MOVE alias first determines whether theì
source and destination are on the same drive. In that case, MOVE.COM isì
used to perform the move. Otherwise, the source file is copied to theì
destination and then deleted. What we have, therefore, is a MOVE commandì
that frees the user of the responsibility of worrying about which drives areì
involved -- another example of how Z-System can free you from considerationsì
that need not concern you, that do not require human intelligence to decide.
The final three macro examples are execution macros. Macro X causes theì
pointed-to file to be executed. A more sophisticated version might check toì
make sure that the file type is COM. I opted for the flexibility ofì
pointing, for example, to PROGRAM.Z80 and having PROGRAM.COM run. If thereì
is no COM file with a matching name, the error handler will take care ofì
things. You will note the leading colon before the "$n" parameter. Itì
makes sure that the current directory is searched even if it is not on theì
path. Prompted input is used to allow a command tail to be included.
The Z macro performs a user-specified function on the pointed-to file. ì
Two separate user prompts allow both the command and a command tail to beì
given. For example, if you wanted to squeeze the file to A0:, you wouldì
enter "SQ" in response to the first prompt and "A0:" in response to theì
second.
The 0 macro illustrates how the response to a prompt can be used as aì
ZFILER script. This macro takes care of all those functions we forgot toì
include in ZFILER.CMD. The whole macro is just prompted input, and whateverìèwe answer will be run as a script. I use this function so often that I putì
it on a number key so that it can be invoked with a single key rather thanì
the usual pair. Also, as you may have noticed, I include in the macro helpì
screen a list of the parameters that can be used.
The only real limitation of this macro-to-write-a-macro approach is thatì
prompted input cannot be included in the response. As I write this,ì
however, it occurs to me that this limitation could be overcome byì
recursively parsing the prompt parameters until none remain, and only thenì
going on to the subsequent macro expansion steps.
Well, I was going to discuss patching and configuring ZFILER, but thisì
article is already too long, so that will just have to wait for anotherì
time. I hope that this article will help you get more out of ZFILER. Seeì
you in the next issue!
LISTIN╟ 3
---------
Q ql $p
U ! if $t=?q?;$!sys:uf $p $d$u:;else;$!sys:uncr $p $d$u:;fi
S ! $!sfa $p $" SFA Options (/o,o.. o=ARC,-ARC,R/O,R/W,SYS,DIR): "
K ! $d$u:;$!crunch $f $"Destination directory (DU:) -- ";$h:
B $d$u:;crunch $f $"Destination directory (DU:) -- ";sfa $f /arc;$h:
M ! /move $p $"Destination directory for move: "
X ! $d$u:;:$n $" Command Tail: ";$h:
Z ! $d$u:;$" Command to perform on file: " $f $" Tail: ";$h: