;
                                      W.COM                                   

             Size (recs) CRC   Version    Author/Latest Issue      Disk
W.COM          4k (32)   A6F2  2.4        Bruce Morgen 7/91        Z3COM11
W.3OM          4k (32)   8D3A  2.4        Bruce Morgen 7/91        Z3COM11
W.4OM          5k (38)   BCAE  2.4        Bruce Morgen 7/91        Z3COM11

  1- Syntax  2- Aborting W  3- Configuration  4- Notes  5- Examples of Use    


   W,  the Wildcard Shell Processor,  is  a  ZCPR3 shell that enables wildcard 
processing for programs that do not usually accept wildcard parameters.   This
capability adds an entirely new dimension of utility to the alias concept.  

   Vs 1.0 (1/86), 1.1, 2.0 (2/86) by Steve Cohen.
:1
    Syntax:   W {ZEX} <command> <afn.aft> {<parm> {<parm> {....}}}

   ...where <command> is any ZCPR3 executable command, such as a .COM file,  a
resident command, or an alias,  or a .ZEX command script file.   The ambiguous
filename may be  any legitimate  CP/M  wildcard  specification,  such as *.ASM,
*.?Q?, or *.*, but please note these rules:

   a. No more than 6 parameters can follow after W including COMMAND and AFN.

   b. The total length  of the command line invoking W, including the 'W', but
      not including the ambiguous  filename and its trailing space, must be 32
      characters or less.

   c. Normally, W.COM must be located somewhere along the ZCPR3 path or on the
      logged drive (B:W COMP A:*.* C: will not work).  Under ZCPR33, however,
      with the Z33 flag set to TRUE in W's config/patch area, W will determine 
      from the external FCB what DU: it is located in and reinvoke itself from
      that DU:.
 Syntax - 2/2 

   d. Stay away  from shell commands  as parameters to W.  Don't expect to get
      away with stuff like 'W VFILER *.*' or 'W SH *.*' or stuff like that.
       
   e. The ambiguous filename parameter must  be located directly following the
      command  parameter; i.e., the  wildcard  parameter  must be  the  second
      parameter of W when W calls a regular command and the third parameter of
      W when W calls a ZEX command.  
:2
 Aborting W 

   It may  be necessary sometimes to  abort W when  its  actions are not quite
what you had in mind.   Since every program differs in its reactions to random
console input,  a short delay was included at the beginning of each invocation
of the W shell (that is,  as W is creating each  of its command lines).   This 
delay is  user settable,  either be  changing  the  MSEC equate in W22.Z80 and 
reassembling (MSEC represents the delay in milliseconds),  or  by  patching at
location  MSEC  with  the number  of  milliseconds  (see Configuration).   The 
default for MSEC is 0.

   In order to get W to abort,  it is necessary to hit the <ESC> key.   Try to 
hit it several times at about the time that whatever program you are executing
under W  is ending.   This should produce a 'W aborted' message and return you 
to the regular ZCPR3 prompt.
:3
 Configuration - 1/4 

   In the first sector of W.COM  are several configuration bytes  that  may be 
set with you favorite patcher.   Each of them  is identified  by an ASCII flag 
string, followed by an equal sign ("="), and then the corresponding configura-
tion byte.   The configuration bytes are as follows:

     Z33=      Set  to FFh if running under ZCPR  3.3;  otherwise
               set  to 00h.  If this flag is set, W will use  the
               external FCB find the du from which it was invoked
               and  that  du will be added  to  the  reinvokation
               command  line.  W will not have to be  located  on
               the path.

     SYS=      If set to FFh, then W will find system files.   If
               set to 00h, W will ignore system files.

     NONSYS=   If set to FFh, then W will find non-system  files.
               If set to 00h, W will ignore non-system files.
 Configuration - 2/4 

     SECHO=    If set to FFh, then W will echo each command  line
               before  it  is executed.  If set to  00h,  command
               lines are not echoed.

     WMSG=     If set to FFh, then W will print a message on each
               invocation that asks you to wait while it's  scan-
               ning the disk for the next matching filename.   If
               set to 00h, this wait message is suppressed.

     IQUIET=   If  set to FFh, then W will display only  install,
               finish,  and  abort messages,  regardless  of  the
               setting  of the SECHO flag above.  If set to  00h,
               the  W will check the external quiet flag  in  the
               environment  descriptor and echo messages  or  not
               depending on how the external flag is set.
 Configuration - 3/4 

     INSERT=   If set to FFh, then W will be reinvoked by insert-
               ing its reinvocation command into the command line
               buffer.  That is, W will insert it's  reinvocation
               command, which is stored in the first shell  stack
               entry, into the multiple command line buffer after
               the  command  line it builds using  the  ambiguous
               filename.   Any commands pending in  the  multiple
               command  line buffer are then appended  after  the
               reinvokation  command.  This causes W to be  rein-
               voked  from the command line and not as  a  shell.
               The  two shell stack entries are still used,  how-
               ever.  If set to 00h, then W functions as a  shell
               and will be reinvoked after all commands have been
               processed  from the multiple command line  buffer.
               (W  is always reinvoked as a shell, if  running  a
               ZEX script.)
 Configuration - 4/4 

   Note that if the internal IQUIET flag  or the  Z-system QUIET flag are set,
it has priority over both the  SECHO and  the WMSG flags  and  W will suppress
both command line echo and the wait message.
:4
 W Notes - 1/4 

   a. Vs 2.4 updates (7/3/91, Bruce Morgen):
      - General code tightening and other changes to bring Type 3 to within 4K
        (32 records).  
      - Implemented Type 4 version with rather kludgy buffer  allocation stuff
        largely based on what I've observed about DIRQ and SORT, seems to work
        OK.

  b. Vs 2.3 updates (6/11/89, Gene Pizzetta):
      - The meaning of the IQUIET flag in the configuration  area was slightly
        modified.   If it is  set (0FFh) then only install,  abort, and finish
        messages will be displayed.   If the flag is reset,  however,  W  will
        obey the  external QUIET flag in the environment  descriptor.   If the
        QUIET flag is set, then  W will act just like it  would  if the IQUIET
        flag is set; if the QUIET flag is reset, W will print all messages.
      - A Type-3 header  was added,  allowing  versions that load  and  run at
        addresses other than 100h, under ZCPR 3.3 and 3.4.
      - The "scanning ... please wait"  message can  now be turned off,  while  
        leaving other messages on, by setting the WMSG configuration byte.
 W Notes - 2/4 

   c. Version 2.2 updates (11/9/87, Rob Wood):
      - W is not reinvoked as  a shell except when repeating  a ZEX command or 
        the INSERT flag is FALSE in the config/patch  area.  W now inserts its 
        reinvokation command into  the  multiple  command  line  buffer.  This
        allows commands that are  pending  in  the  command  buffer  (multiple
        commands that  follow  the  W  command) to  be  executed  after  W has
        completed or is aborted and not after the first pass through W.
      - When using ZEX, version 2.2 works like previous versions,  because ZEX
        processes  all commands in  the  multiple command line  buffer  before 
        exiting and allowing W to be reinvoked.
      - A problem was corrected of file attributes effecting the next filename
        selection by  ignoring  the  MSB  of the filenames  returned  from the 
        directory.
      - An internal quiet flag,  IQUIET,  was added to the configuration/patch  
        area.   It is used to turn on  and off  display of all messages except 
        the install, finish, and abort messages.
      - W now determines from the external FCB the  name  under which  it  was 
        invoked and will use it to build the shell reinvokation command.  This 
        means that W22 no longer has to be renamed to W.COM to work properly.
 W Notes - 3/4 

      - Normally W has to  be located somewhere along the current path.  If it
        is running under ZCPR 3.3 and the Z33 flag is set to  TRUE in the con-
        figuration/patch area,  W will now determine from the external FCB the
        DU in which it is located and  reinvoke  itself  from  that DU.   This
        allows W to be located somewhere off of the current path.  Warning: Do
        not set Z33 to TRUE if running  ZCPR 3.0 or older.   ZCPR 3.0 does not
        provide the user in the external FCB and W may lock up the system.

   d. Version 2.1 updates (12/27/86, Jay Sage):
      - Several bugs were  fixed  in  the  delay timing  routine  and  in  the
        initialization of the  previously  matched  filename.  Timing delay is
        now in milliseconds instead of quarter-seconds.
      - A "Scanning for next matching file"  message  was  added  to  keep  up
        user's patience when scanning large directories.
      - A configuration/patch  area  was  added  to the start  of the program.
        The SYS,  NONSYS,  and  MSEC  (formerly QSEC) parameters were put into
        this configuration/patch area (see Configuration).
 W Notes - 4/4 

   e. W works by storing on the shell stack (just beneath the W shell) the FCB 
      of the last  file operated on.  This is  a non-standard use of the shell 
      stack but  will have to  do until ZEX is rewritten to include buffers to 
      hold a couple of FCBs specifying  the operative  ambiguous filename  and 
      the last unambiguous filename found matching it.  
:5
 Examples of Use 

   a. w comp a:*.* B:            <-- compare each file on A: to a file 
                                     with the same name on B:

   b. w mac *.asm $szpz          <-- assemble many files

   c. w wsdocon *.txt            <-- post-process text files

   d. z3ins sys.env $:1.COM      <-- ARUNZ alias INS
      w ins *.com                <-- install a number of ZCPR3 utilities  

   e. cp $2=$1                   <-- ARUNZ alias CPAL
      w cpal *.* B:              <-- copy all files on A: to B:

   f. w echo $.bas;echo done     <-- echo all .BAS filenames, then 'DONE' 
