%ADDQ ZEX]DOMULT ZEX gnMENU VMNQ COMQM80 ZEX"QRUN ZEX%QSPECIALCOM(QTYPE ZEX0 QUEUE DOC@. eQVIEW ZEX9O@ ;; ZEX command file for adding a filename to a queue of filenames ;; in the SH.VAR file. 'QH' is a variable that points to the ;; head item in the queue, 'QT' points to the last item. The last ;; item always points to the new item. REGister 1 is used as a ;; flag to indicate whether anything is already in the queue or not. ;; A value of 0 in REG 1 indicates that the queue is empty. ;; -RDN SH IF 1;SHVAR QH $1;GO QT $1;REG S1 1;ELSE;SHVAR %QT $1;GO QT $1;FI SHEXIT ;; end of ZEX command file;; ZEX command file to process files in a queue on disk. The 'process' ;; to perform is passed to this file as the first parameter. As only ;; the names and not the extents of files are stored in the queue, ;; the second parameter passed is presumed to be an extent. As many ;; as three more parameters may be passed also; they will be unchanged. ;; Note that the presumed extent is 'stuck' directly onto the filename ;; and therefore the second parameter MUST be an appropriate extent. ;; The name and extent cannot be concatenated directly in this ZEX ;; file; to do so would require passing SH a token like '%QP$2', which ;; it would fail to recognize as a legitimate variable name. Instead ;; the concatenation is done by the alias QSPECIAL. Another slightly ;; more elegant way to do it, not requiring an additional file, would ;; be to do SETFILE 1 %QP right after the label FIRST and then ;; concatenate the references to FILE 1 and parameter number two ;; right here in the ZEX file. The problem is that I haven't found any ;; way to refer to these system files from within ZEX files; The Manual ;; is still in limbo -- perhaps it will have an answer when it appears. ;; -RDN SH SHVAR QP %QH;GO CLTAIL $2 $3 $4 $5 GOTO FIRST ;=LOOP SHVAR SWITCH SHVAR QP %%%QP %SWITCH ;=FIRST QSPECIAL $1 %QP $2 $3 $4 $5;IF %QP=%QT;GOTO END;ELSE;XIF;GOTO LOOP;FI ;=END XIF SHEXIT ;; end of ZEX command file# --------------------------------------------------------------------------- Use arrow keys to move pointer FILE QUEUE MANAGER Q Add file to queue R Run all files in queue V View queue T Type " " " " E Empty queue A Assemble " " " " S Specially process queued files X Exit # QZEX ADDQ $PN VZEX QVIEW EERA 0:SH.VAR;REG S1 RZEX QRUN TZEX QTYPE AZEX QM80 SZEX DOMULT "Enter process: " "Enter filetype/command line tail: " XREG S1 ;ERA 0:SH.VAR;SHCTRL P ## Z3ENV* Z3 ALIASREG S1;ERA 0:SH.VAR;VMENUºF ALIAS -- Create Alias Commands Syntax: ALIAS <-- Define New Command or ALIAS dir:cmndname <-- Redefine Old Command͎ +~=G6 Nw !@F Alias File  F Not Found!@ \E ~I$3####~*DUFʑNʥ0( (.G#!͞~ʏʃ~# iʏu~!ڏ#ÃͲ>.Ͳ#~1#ɯGx ~ #͇xA#͇y 0 0Gy0x##!~&#>$##ʏ#~ ʏ#9Ï~|hG|hxm!:>{Ovfl"ʐG~ʒ#…*^#V~;ʮʮ>;ʺ~#®6Ð*s#r~#=RE*^#V*$~#fo|**R"w~#o Y s F KKO   y  yG>GO> se O*.  OG~#ʫ;ʟ+~#ʫ;¯ëO !#y  a{_*}$.. ;; ZEX command file to assemble (with M80) a list of files kept in ;; a queue in the SH.VAR file. -RDN ;; SH SHVAR QP %QH GOTO FIRST ;=LOOP SHVAR SWITCH SHVAR QP %%%QP %SWITCH ;=FIRST M80 =%QP;IF %QP=%QT;GOTO END;ELSE;XIF;GOTO LOOP;FI ;=END XIF SHEXIT ;; end of ZEX command file;; ZEX command file to run a list of files kept in a queue in the ;; SH.VAR file. -RDN ;; SH SHVAR QP %QH GOTO FIRST ;=LOOP SHVAR SWITCH SHVAR QP %%%QP %SWITCH ;=FIRST %QP;IF %QP=%QT;GOTO END;ELSE;XIF;GOTO LOOP;FI ;=END XIF SHEXIT ;; end of ZEX command file Z3ENV* Z3 ALIAS$1 $2$3 $4 $5 $6 k/ºF ALIAS -- Create Alias Commands Syntax: ALIAS <-- Define New Command or ALIAS dir:cmndname <-- Redefine Old Command͎ +~=G6 Nw !@F Alias File  F Not Found!@ \E ~I$3####~*DUFʑNʥ0( (.G#!͞~ʏʃ~# iʏu~!ڏ#ÃͲ>.Ͳ#~1#ɯGx ~ #͇xA#͇y 0 0Gy0x##!~&#>$##ʏ#~ ʏ#9Ï~|hG|hxm!:>{Ovfl"ʐG~ʒ#…*^#V~;ʮʮ>;ʺ~#®6Ð*s#r~#=RE*^#V*$~#fo|**R"w~#o Y s F KKO   y  yG>GO> se O*.  OG~#ʫ;ʟ+~#ʫ;¯ëO !#y  a{_*}$.. ;; ZEX command file to type textfiles in a queue on disk. Note that ;; since only the names and not the extents of the files are kept in ;; the queue, it is necessary to test for a file with every extent that ;; may reasonably be expected. All of these tests are packed into a ;; single command line for two reasons: a) so that SH need not be re- ;; loaded repeatedly, and b) so that ZEX's echoing of the command lines ;; will not drive much of the last page typed off the screen before the ;; SAK prompt appears. ;; If you have selected a filename with an extent not represented below, ;; the file will not be typed. Conversely, files other than the one ;; selected may be typed if they have the same name and any one of ;; the extents below. -RDN ;; SH SHVAR QP %QH GOTO FIRST ;=LOOP SHVAR SWITCH SHVAR QP %%%QP %SWITCH ;=FIRST IF EX %QP.DOC;TYPE %QP.DOC;ELSE;IF EX %QP.MAC;TYPE %QP.MAC;ELSE;IF EX %QP.ZEX;TYPE %QP.ZEX;FI;FI;FI;SAK ANY KEY CONTINUES ^" IF %QP=%QT;GOTO END;ELSE;XIF;GOTO LOOP;FI ;=END XIF SHEXIT ;; end of ZEX command file;; ZEX command file to display the filenames in the SH.VAR queue. ;; Two techniques are shown here. -RDN ;; SHDEFINE|L^?QY ;; ;; The following ZEX code should produce a display of the filenames ;; in the queue -- and nothing else -- on the screen. It does not, ;; however, because ZEX's 'Toggle Print Suppress' command ('^.') ;; does not work, at least with my version of ZEX (3.1). If the ;; '^.' commands are removed, it will work, but the filenames will ;; be all but lost in the 'noise' of command lines that ZEX displays. ;; ;;ECHO ^Z;^. SH ;; Control-Z clears the screen on my Kaypro ;;SHVAR QP %QH;GOTO FIRST ;;;=LOOP ;;SHVAR SWITCH SHVAR QP %%%QP ;;%SWITCH ;;;=FIRST ;;ECHO %QP ^. ; ^. IF %QP=%QT;GOTO END;ELSE;XIF;GOTO LOOP;FI ;;;=END ;;XIF ;;SHEXIT ;; end of ZEX command file  DOCUMENTATION FOR ZCPR3 FILE QUEUE MANAGEMENT Using a number of ZCPR3's utilities, it is possible to build a list, or queue, of filenames on disk and then access the names in this queue in order to process them. The process is very similar to 'tagging' files with VFILER or SWEEP, but a much greater range of actions can be performed on the files than either of these utilities allows. Several examples are provided with this distribution, but it is possible to add any other manipulations of the queued files that you may wish. Whether or not you find this scheme of file manipulation useful, it may at least serve as a demonstration of the power of ZCPR3. Many of the fancy features of ZCPR3 are used by the distributed system, although some are found only in the 'applications' which use the queue after it has been built. In order to use the system, your version of ZCPR3 must support, at the minimum: A shell stack allowing at least two entries VFILER.COM SH.COM SHVAR.COM ZEX.COM IF.COM GOTO.COM REG ; Either RCP-resident or transient ERA ; " " " " " In addition, the following are very desirable: ALIAS.COM SHCTRL.COM SHDEFINE.COM ECHO ; Either RCP-resident or transient The following files are provided in this distribution: Q.COM MENU.VMN ADDQ.ZEX QVIEW.ZEX QTYPE.ZEX QM80.ZEX QRUN.ZEX DOMULT.ZEX QSPECIAL.COM Both Q.COM and QSPECIAL.COM are aliases, and you may have to rewrite them (with ALIAS.COM) in order for them to run on your system. The system is controlled from VMENU, using MENU.VMN. The ordinary (and recommended) entry point is via Q.COM, which does some housekeeping in preparation for running the system and then invokes VMENU. You will be presented with the ordinary sort of VMENU display: disk directory across the top and a list of options below. A pointer can be moved from filename to filename with your arrow keys (if you have any and have a Z3TCAP installed) or the Wordstar cursor diamond. If there are more directory entries than will fit on the screen at one time, you can toggle the display with the '-' key. From the menu, single-keystroke selections can be made to add to the queue, erase the queue, view the queue, or perform certain 'application' operations on it. Typically, a menu selection will invoke ZEX, and within the command file being processed, SH will be loaded on top of VMENU. Most of the ZEX files contain some comments pertaining to their use, and both comments and commands should be read in order to understand how the queueing scheme works. All of the 'application' files (those that use the queue rather than modifying it) have a similar structure; you can use this structure as a template for constructing new menu selections. Limitations There are a couple of considerations affecting the use of this file-queueing scheme. Variable Length Because the variable files used by SH, SHVAR, and SHDEFINE can contain variable names of no more than 8 characters it is impossible to store an entire filename. Only the first eight characters are stored -- the extent is lost. As a consequence, you cannot put in the queue two different files with the same name but different extents. Nor, of course, can you put the same name in twice. If the process you want to perform requires that the names have extents, then the ZEX file for that particular application will have to supply the extents in some way. See the comments and code in the QTYPE.ZEX and DOMULT.ZEX files for examples of the ways in which this can be handled. Speed Because accessing the queue involves manipulating files on disk, adding a file to the queue is not comparable (in speed) to tagging a file with VFILER or SWEEP. The speed difference will probably not be too bad if your utilities are on a RAM-disk or hard disk, but on a floppy-based system you will have to wait several seconds for each operation to be completed. One quirk is worth mentioning here. SH, SHVAR, and SHDEFINE should, according to the help files I have, look for the SH.VAR file in the ROOT directory. My versions do not: they always look in user area 0 of the current drive. Hence both Q.COM and the 'X' option on the menu try to erase it from user area 0. If there are, in fact, versions of these utilities that go to ROOT: for SH.VAR, you will want to make the appropriate changes. Alternatives For some applications it may be more useful to have filenames assembled into a single text string with each name delimited by spaces or commas. Such a scheme can be implemented by instructing SHVAR appropriately. Yet another data structure that can be imposed on the SH.VAR file is that of a stack, with the last name in the first one out. Although less useful for operations on files than a queue, there may be some applications for which it would be appropriate. One option not implemented in the system as distributed is that of deleting a name in the middle of the queue. This has been left as an exercise for the reader. Dreas Nielsen 234 NW 30th St. Corvallis, OR 97330 (503) 754-6539