home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / jsage / znode3 / z3doc / hd-arc13.lbr / ALIASOLD.CMD < prev    next >
Encoding:
Text File  |  1993-06-07  |  6.3 KB  |  130 lines

  1. ;        * ALL SORTS OF WAYS TO DO THE SAME THING:
  2. ;       How I Spent From Dusk to Dawn Inside a Single ALIAS.CMD
  3. ;          and Lived to Tell About It 
  4. ;    
  5. ;          ** A Passion Play in Three Parts **  -- by Rick Charnes
  6. ;
  7. ;   The first group of aliases is what I mentioned in the documentation, 
  8. ;   using the aliases inside COMMAND.LBR.  There's two more groups for 
  9. ;   your listening pleasure, should you care to experiment.  Figure
  10. ;   out which is quickest and most enjoyable for you.  Learn the various
  11. ;   techniques from the three groups.  Probably the quickest is method #4 - 
  12. ;   having the aliases are separate disk files.  Try them all.  Whichever 
  13. ;   you like best should be moved here to the top and that is the only group
  14. ;   that will run.  Or, alternately, simply comment out (put semicolons 
  15. ;   in front of) earlier command lines which are not your preference.
  16. ;   ARUNZ will just ignore any later occurences of an alias name/command
  17. ;   line entry.  
  18. ;
  19. ;   Let's hear it for semicolons, the computerist's silent best friend...
  20. ;
  21. ;   Most of these aliases are for 5-floppy backups, the default.  
  22. ;
  23. ;
  24. ;            * SCENE 1: "WHAT A MESS!!"
  25. ;
  26. ;   Here I just lay out the whole aliases.  I'll have none of that 
  27. ;   wild and wooly parameter passing and your accursed 'tight code' 
  28. ;   of Scene 2.  Just lay out the whole darn alias.
  29. ;
  30. ;   Here I type my "* ARCHIVING FILES $1 THROUGH $2 . . ." message 
  31. ;   from M.LBR files (E-J, K-P, etc.) rather than through MSG or AM 
  32. ;   (alias below) which I describe in the documentation and in Scene 2.  
  33. ;   This SEEMS to be the faster method.  But variety is the spice of 
  34. ;   life, and we've got plenty of it in Z-System.
  35. ;   
  36. HD-ARC=HDISKARC=ARC ZEX ARC
  37. ;  I couldn't decide which I wanted to call this, so thanks to 
  38. ;  Jay Sage's multiple alias name feature you can type EITHER 'HD-ARC' or
  39. ;  'HDISKARC', or 'ARC', whichever you want.  No need to type 'ZEX <whatever> 
  40. ;  either.  But always remember: it's faster if you do type 'ZEX' and 
  41. ;  bypass ARUNZ...
  42. ;
  43. AM ECHO *=$$0G4]]G0]0G4  * ARCHIVING FILES "$1" THROUGH "$2" . . .   G0]0G4]]G0
  44. ;
  45. ;  Replaces the AM.COM alias in this package
  46. ;
  47. 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
  48. 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
  49. 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
  50. 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
  51. 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
  52. ;  and for three-floppy backups:
  53. 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
  54. 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
  55. 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
  56. ;
  57. ;
  58. ;
  59. ;-----------------------------------------------------------------------
  60. ;
  61. ;    * SCENE TWO: "SKIP THE GRAVY, PASS THAT PARAMETER"
  62. ;
  63. ;               - or -
  64. ;
  65. ;              "I'm so dizzy, I must be in Recursion Heaven"    
  66. ;
  67. ;   Due to all the nesting and chaining this was both the most enjoyable
  68. ;   to think through and probably the slowest to execute.  But oh
  69. ;   what fun.  In a space of less than 500 bytes we've created the
  70. ;   equivalent of what would take up 20k spread out on disk files.
  71. ;   If you don't think there's a certain pleasure in that you don't 
  72. ;   know a damn thing about Z-System...
  73. ;
  74. ;  Let's see, now...We're passing a command line to the CCP, which
  75. ;  can't find a disk file, so it passes it to the ECP, which happens to
  76. ;  be ARUNZ.  ARUNZ looks inside ALIAS.CMD.  It finds the right name,
  77. ;  ARCn, which throws some parameters on top of it, calls it MSG and 
  78. ;  passes it back to the CCP, which again looks for a disk file.  Not 
  79. ;  finding one, back we go to ECP, ARUNZ and ALIAS.CMD.  We find MSG, pass
  80. ;  the parameters but flush the command line, and over we go to BODY.
  81. ;  By now we're used to the CCP, ECP, ARUNZ, and ALIAS.CMD, and we find
  82. ;  BODY.  Boy, what a BODY it is...There - did I get that right?
  83. ;
  84. 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
  85. ARC2 MSG E J F G H I J
  86. ARC3 MSG K P L M N O P
  87. ARC4 MSG Q U R S T U
  88. ARC5 MSG V Z W X Y Z
  89. MSG $ZECHO *=$$0G4]]G0]0G4  * ARCHIVING FILES "$1" THROUGH "$2" . . .   G0]0G4]]G0;BODY $1 $2 $3 $4 $5 $6 $7
  90. ;
  91. ;  WHAT?  You don't know what that "$Z" in front of ECHO does?  Shame on you!
  92. ;
  93. ;  It was necessary to split off "MSG" above, which is recursive and 
  94. ;  its command line flushed after running, from the "BODY" below.  
  95. ;  Otherwise the cl becomes too long.  MSG has its moment of glory, passes 
  96. ;  its parameters to BODY, and then dies, giving itself to the cause.
  97. ;
  98. 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
  99. ;
  100. ;  If each of the alphabetical groups encompassed the same number of letters
  101. ;  (try it on the 3-floppy set: 9,9,8) this would be much easier and
  102. ;  neater.   I like to make trouble, though - it's how I learn.
  103. ;
  104. ;-------------------------------------------------------------------
  105. ;
  106. ;        * SCENE THREE: GOING TO THE LIBRARY...
  107. ;
  108. ;
  109. ARC? LX $0
  110. ;   If Jay isn't a genius I'm a monkey's uncle.  You think that's
  111. ;   ONE alias?  Look again.  With that single line, we take care of a
  112. ;   command line entry of "ARC1", "ARC2", "ARC3", "ARC4", or "ARC5" and 
  113. ;   send them all packing to the library. You don't believe me?  Check 
  114. ;   out ARUNZ.HLP and find out about VARIABLE ALIAS NAMES.  Tight code 
  115. ;   makes one swell with pride...
  116. ;
  117. ;
  118. ;                               ...END...
  119. ;
  120. ;*** APPLAUSE ***
  121. ;
  122. ;                        << CURTAIN >>
  123. ;h pride...
  124. ;
  125. ;
  126. ;                               ...END...
  127. ;
  128. ;*** APPLAUSE ***
  129. ;
  130. ;