home *** CD-ROM | disk | FTP | other *** search
- ; * ALL SORTS OF WAYS TO DO THE SAME THING:
- ; How I Spent From Dusk to Dawn Inside a Single ALIAS.CMD
- ; and Lived to Tell About It
- ;
- ; ** A Passion Play in Three Parts ** -- by Rick Charnes
- ;
- ; The first group of aliases is what I mentioned in the documentation,
- ; using the aliases inside COMMAND.LBR. There's two more groups for
- ; your listening pleasure, should you care to experiment. Figure
- ; out which is quickest and most enjoyable for you. Learn the various
- ; techniques from the three groups. Probably the quickest is method #4 -
- ; having the aliases are separate disk files. Try them all. Whichever
- ; you like best should be moved here to the top and that is the only group
- ; that will run. Or, alternately, simply comment out (put semicolons
- ; in front of) earlier command lines which are not your preference.
- ; ARUNZ will just ignore any later occurences of an alias name/command
- ; line entry.
- ;
- ; Let's hear it for semicolons, the computerist's silent best friend...
- ;
- ; Most of these aliases are for 5-floppy backups, the default.
- ;
- ;
- ; * SCENE 1: "WHAT A MESS!!"
- ;
- ; Here I just lay out the whole aliases. I'll have none of that
- ; wild and wooly parameter passing and your accursed 'tight code'
- ; of Scene 2. Just lay out the whole darn alias.
- ;
- ; Here I type my "* ARCHIVING FILES $1 THROUGH $2 . . ." message
- ; from M.LBR files (E-J, K-P, etc.) rather than through MSG or AM
- ; (alias below) which I describe in the documentation and in Scene 2.
- ; This SEEMS to be the faster method. But variety is the spice of
- ; life, and we've got plenty of it in Z-System.
- ;
- HD-ARC=HDISKARC=ARC ZEX ARC
- ; I couldn't decide which I wanted to call this, so thanks to
- ; Jay Sage's multiple alias name feature you can type EITHER 'HD-ARC' or
- ; 'HDISKARC', or 'ARC', whichever you want. No need to type 'ZEX <whatever>
- ; either. But always remember: it's faster if you do type 'ZEX' and
- ; bypass ARUNZ...
- ;
- AM ECHO *=$$0G4]]G0]0G4 * ARCHIVING FILES "$1" THROUGH "$2" . . . G0]0G4]]G0
- ;
- ; Replaces the AM.COM alias in this package
- ;
- ARC1 T A0:M X;XDIR /FL;AC FNAMES.DIR BAK: /A;CLEANDIR;T A0:M S;SFA *.BAK /ARC;T A0:M A-D;AC A*.* BAK: /A;AC B*.* BAK: /A;AC C*.* BAK: /A;AC D*.* BAK: /A
- ARC2 T A0:M E-J;AC E*.* BAK: /A;AC F*.* BAK: /A;AC G*.* BAK: /A;AC H*.* BAK: /A;AC I*.* BAK: /A;AC J*.* BAK: /A
- ARC3 T A0:M K-P;AC K*.* BAK: /A;AC L*.* BAK: /A;AC M*.* BAK: /A;AC N*.* BAK: /A;AC O*.* BAK: /A;AC P*.* BAK: /A
- ARC4 T A0:M Q-U;AC Q*.* BAK: /A;AC R*.* BAK: /A;AC S*.* BAK: /A;AC T*.* BAK: /A;AC U*.* BAK: /A
- ARC5 T A0:M V-Z;AC V*.* BAK: /A;AC W*.* BAK: /A;AC X*.* BAK: /A;AC Y*.* BAK: /A;AC Z*.* BAK: /A
- ; and for three-floppy backups:
- ARC3-1 T A0:M A-I;CLEANDIR;SFA *.BAK /ARC;AC A*.* BAK: /A;AC B*.* BAK: /A;AC C*.* BAK: /A;AC D*.* BAK: /A;AC E*.* BAK: /A;AC F*.* BAK: /A;AC G*.* BAK: /A;AC H*.* BAK: /A;AC I*.* BAK: /A
- ARC3-2 T A0:M J-R;AC J*.* BAK: /A;AC K*.* BAK: /A;AC L*.* BAK: /A;AC M*.* BAK: /A;AC N*.* BAK: /A;AC O*.* BAK: /A;AC P*.* BAK: /A;AC Q*.* BAK: /A;AC R*.* BAK: /A
- ARC3-3 T A0:M S-Z;AC S*.* BAK: /A;AC T*.* BAK: /A;AC U*.* BAK: /A;AC V*.* BAK: /A;AC W*.* BAK: /A;AC X*.* BAK: /A;AC Y*.* BAK: /A;AC Z*.* BAK: /AECHO =]9G4* ARCHIVING COMPLETE * G0
- ;
- ;
- ;
- ;-----------------------------------------------------------------------
- ;
- ; * SCENE TWO: "SKIP THE GRAVY, PASS THAT PARAMETER"
- ;
- ; - or -
- ;
- ; "I'm so dizzy, I must be in Recursion Heaven"
- ;
- ; Due to all the nesting and chaining this was both the most enjoyable
- ; to think through and probably the slowest to execute. But oh
- ; what fun. In a space of less than 500 bytes we've created the
- ; equivalent of what would take up 20k spread out on disk files.
- ; If you don't think there's a certain pleasure in that you don't
- ; know a damn thing about Z-System...
- ;
- ; Let's see, now...We're passing a command line to the CCP, which
- ; can't find a disk file, so it passes it to the ECP, which happens to
- ; be ARUNZ. ARUNZ looks inside ALIAS.CMD. It finds the right name,
- ; ARCn, which throws some parameters on top of it, calls it MSG and
- ; passes it back to the CCP, which again looks for a disk file. Not
- ; finding one, back we go to ECP, ARUNZ and ALIAS.CMD. We find MSG, pass
- ; the parameters but flush the command line, and over we go to BODY.
- ; By now we're used to the CCP, ECP, ARUNZ, and ALIAS.CMD, and we find
- ; BODY. Boy, what a BODY it is...There - did I get that right?
- ;
- ARC1 T A0:M X;XDIR /FL;AC FNAMES.DIR BAK: /A;CLEANDIR;T A0:M S;SFA *.BAK /ARC;MSG A D B C D
- ARC2 MSG E J F G H I J
- ARC3 MSG K P L M N O P
- ARC4 MSG Q U R S T U
- ARC5 MSG V Z W X Y Z
- MSG $ZECHO *=$$0G4]]G0]0G4 * ARCHIVING FILES "$1" THROUGH "$2" . . . G0]0G4]]G0;BODY $1 $2 $3 $4 $5 $6 $7
- ;
- ; WHAT? You don't know what that "$Z" in front of ECHO does? Shame on you!
- ;
- ; It was necessary to split off "MSG" above, which is recursive and
- ; its command line flushed after running, from the "BODY" below.
- ; Otherwise the cl becomes too long. MSG has its moment of glory, passes
- ; its parameters to BODY, and then dies, giving itself to the cause.
- ;
- BODY AC $1*.* BAK: /A;AC $3*.* BAK: /A;AC $4*.* BAK: /A;AC $5*.* BAK: /A;IF ~NU $6;AC $6*.* BAK: /A;IF ~NU $7;AC $7 BAK: /A;FI;FI
- ;
- ; If each of the alphabetical groups encompassed the same number of letters
- ; (try it on the 3-floppy set: 9,9,8) this would be much easier and
- ; neater. I like to make trouble, though - it's how I learn.
- ;
- ;-------------------------------------------------------------------
- ;
- ; * SCENE THREE: GOING TO THE LIBRARY...
- ;
- ;
- ARC? LX $0
- ; If Jay isn't a genius I'm a monkey's uncle. You think that's
- ; ONE alias? Look again. With that single line, we take care of a
- ; command line entry of "ARC1", "ARC2", "ARC3", "ARC4", or "ARC5" and
- ; send them all packing to the library. You don't believe me? Check
- ; out ARUNZ.HLP and find out about VARIABLE ALIAS NAMES. Tight code
- ; makes one swell with pride...
- ;
- ;
- ; ...END...
- ;
- ;*** APPLAUSE ***
- ;
- ; << CURTAIN >>
- ;h pride...
- ;
- ;
- ; ...END...
- ;
- ;*** APPLAUSE ***
- ;
- ;