home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / JSAGE / ZSUS / Z3HELP / A.LBR / ARUNZ.HZP / ARUNZ.HLP
Text File  |  2000-06-30  |  13KB  |  372 lines

  1. ;
  2.                         -- ARUNZ --
  3.  
  4.                 O --  Overview of ARUNZ 
  5.  
  6.                 C --  Configuring ARUNZ 
  7.  
  8.                 -- Programming ALIAS.CMD --
  9.  
  10. N --   Alias Names             P --  Script Parameters 
  11. E --   Example ALIAS.CMD       S --  Programming Summary 
  12.        file 
  13. :O.
  14.  Program:   ARUNZ 0.8.
  15.  
  16.  Syntax:   ARUNZ aliasname commandtail
  17.  
  18.  Function: 
  19.  
  20.   ARUNZ  searches  through  the file ALIAS.CMD for an alias name 
  21.   matching the indicated alias name.  If a  match  is  found ARUNZ  
  22.   expands  the  script associated with the alias name and  creates  a 
  23.   new  command  line  from  this   expanded script.
  24.  
  25.  Options:   None.
  26.  
  27.  Comments: 
  28.  
  29.   ALIAS.CMD is a standard text file.  Each line of the file contains 
  30.   an alias name followed by a space and the script associated with 
  31.   the alias name. Information on how to program ALIAS.CMD files is 
  32.   located elsewhere in this help file. 
  33.   
  34.  Selected Error Messages:   Self-explanatory.
  35.  
  36.  Examples of Use: 
  37.  
  38.   A typical use of ARUNZ would be as an extended command processor 
  39.   (ECP). The user might rename it to CMDRUN so that ALIAS.CMD is 
  40.   automatically searched when the command processor fails to find a 
  41.   program the user attempted to invoke. 
  42. :C 
  43.  Configuring  ARUNZ.COM 
  44.  
  45. As with all ZCPR3 tools ARUNZ is installed with Z3INS.COM and 
  46. SYS.ENV.  It also has other options that can be set by using a 
  47. debugger such as DDT to change flag bytes at the beginning of the 
  48. program.  Two flags are used to determine what messages the program 
  49. displays to the user as it runs.  The others determine the path ARUNZ 
  50. uses when searching for the file ALIAS.CMD.
  51.  
  52. The flag bytes are easily located using a debugger.  The program 
  53. begins at 100h.  The very first instruction of the program is a jump 
  54. to the actual start of the program.  The six bytes preceding the 
  55. address in the jump instruction are the flag bytes.  
  56.  
  57. If, for example, the first instruction is "C3 11 01" then the start 
  58. of the program is at address 0111 and the bytes 010B - 0110 are the 
  59. flag bytes.  The following code segment of ARUNZ shows the relative 
  60. position of the flag bytes. 
  61.  
  62.  Configuring ARUNZ.COM 
  63.  
  64.  ARUNZ SOURCE CODE SEGMENT 
  65.  
  66. quietecp:
  67.          db  00000100b  ;quiet flag for ECP invocation
  68. quietf:  db  00001110b  ;flag to control display of messages
  69.           ;  ||||||||  ;set bit to display designated msg
  70.           ;  |||||||*---- signon message
  71.           ;  ||||||*----- running alias "x" message
  72.           ;  |||||*------ alias.cmd file not found
  73.           ;  ||||*------- alias "x" not found
  74.           ;  |||*-------- extended command processor error
  75.           ;  ||*--------- shell invocation error
  76.           ;  **---------- bits not yet assigned
  77.  
  78. pathf:   db  0         ;path search flag (0 = do not use path)
  79. rootf:   db  0         ;0 = use entire path / FF = root only
  80. cmddrv:  db  0         ;drive to use if not path (A=0)
  81. cmdusr:  db  0         ;user to use if not path
  82. start:
  83.  
  84.  Configuring ARUNZ 
  85.  
  86.  Message Display Control 
  87.  
  88. The bits making up the message display flag bye control the display 
  89. of the various messages produced by ARUNZ.  If a bit is set, the 
  90. message is displayed; if it is zero, then the message is not 
  91. displayed.
  92.  
  93. There is a special feature for those who are running the new version 
  94. (3.1) of the ZCPR3 command processor (CP).  With that CP a program 
  95. can tell if it was called as an extended command processor (ECP) or 
  96. by the user (just as error handlers and shells can tell how they were 
  97. called).  One may then wish to have messages displayed or suppressed 
  98. in different ways depending on how ARUNZ was invoked.  If you are 
  99. running the new CP, then you can set the alternate quiet flag. 
  100. QUIETECP will be substituted for QUIETF when ARUNZ is invoked as an 
  101. ECP.  Users with the standard CP should be concerned only with QUIETF 
  102. since all calls to ARUNZ will appear to be manual calls. 
  103.  
  104.  Configuring ARUNZ.COM 
  105.  
  106.  Search Path 
  107.  
  108. By setting the appropriate flags, ARUNZ can be configured to search 
  109. for ALIAS.CMD along the current ZCPR3 path, in the root directory or 
  110. in some specified directory.
  111. :N
  112.  Alias Names 
  113.  
  114. There are a number of forms that an alias name may take.  It may be an
  115. unambiguous name, an ambiguous name, have multiple names, be a
  116. default name or some mix of these forms.
  117.  
  118.  Unambiguous Names. 
  119.  
  120. The simplest form an alias name can take is an unambiguous name.
  121.  
  122.  Example: 
  123.  
  124.   RDIR DIR $*
  125.  
  126. This alias script "DIR $*" will be expanded only if the alias name
  127. passed to ARUNZ matches "RDIR".
  128.  
  129.  Alias Names 
  130.  
  131.  Ambiguous Names 
  132.  
  133. Alias names may also contain wildcards.  The wildcard character is
  134. "?".  The wildcard character will match any character.
  135.  
  136.  Example: 
  137.  
  138.   ?DIR DIR $*
  139.  
  140. The alias script "DIR $*" would be expanded if the alias name passed
  141. to ARUNZ were, for example, "RDIR" or "XDIR".
  142.  
  143.  Alias Names 
  144.  
  145.  Multiple Names 
  146.  
  147. ARUNZ will also accept multiple alias names.  The names must be
  148. separated by the character "=".
  149.  
  150.  Example: 
  151.  
  152.   XDIR=RDIR=SD=D=XD DIR $*
  153.  
  154. The script "DIR $*" would be expanded and a command line built if any
  155. of the names were passed to ARUNZ.
  156.  
  157.  Alias Names 
  158.  
  159.  Default Name 
  160.  
  161. ARUNZ also accepts a default alias name.  This default is any
  162. alias name preceded by the character ":".
  163.  
  164.  Example: 
  165.  
  166.   :Default SAK /bp3 The program "$1" was not found.
  167.  
  168. Any alias name passed to ARUNZ will match this default alias name.  If
  169. used, it should be the last alias name in the ALIAS.CMD file since
  170. ARUNZ will not search for matches beyond the default alias name.  It
  171. could be used, as above, to create an error handler.
  172.  
  173.  Alias Names 
  174.  
  175.  Mixed names 
  176.  
  177. The different forms of alias names can be mixed on one line.
  178.  
  179.  Example: 
  180.  
  181.   ?DIR=SD=XD=D DIR $*
  182.  
  183. This alias name will match "XDIR" and "RDIR" as well as "SD".
  184. :P
  185.  Script Parameters 
  186.  
  187. Any command that is acceptable at the command console prompt may be
  188. in an alias script in ALIAS.CMD.  In addition there are many
  189. parameter expressions that may be placed in ALIAS.CMD that ARUNZ will
  190. expand before building a new command line. The following is a list of
  191. the parameters with a description of how they will be expanded:
  192.  
  193. Parameter     Operation
  194.  
  195. ^             precedes character to be expanded as control
  196.               character
  197. $^,$$"        "$^" quotes "^" and "$$$ quotes "$".  
  198.  
  199. $*            returns entire command line tail.
  200. $-n           returns the command tail less the first n
  201.               tokens, n = 0..9 ($-0 is equivalent to $*).
  202. $0            returns the alias name passed to ARUNZ.
  203. $n            returns the command line parameter token n,
  204.               where n = 1..9.
  205.  
  206.  Script Parameters 
  207.  
  208. $:n           returns the file name only in command line
  209.               token n, n = 1..9
  210. $.n           returns the file type only in token n, n =
  211.               1..9
  212.  
  213. $Dn           returns the currently logged drive, A..P, if
  214.               n=0 or the drive specified in token n if n =
  215.               1..9
  216. $Un           returns the currently logged user, 0..31, if
  217.               n=0 or the user specified in token n if n =
  218.               1..9.
  219.  
  220. (The ALIAS.CMD programmer should note that the above drive
  221. and user parameters are implemented in ARUNZ differently
  222. than they are in ALIAS.COM.)
  223.  
  224.  Script Parameters 
  225.  
  226. $Fn           returns the full name and type of system file
  227.               n, n = 1..4.
  228. $Nn           returns the name only of system file n, n =
  229.               1..4.
  230. $Tn           returns the type only of system file n, n =
  231.               1..4.
  232.  
  233.  
  234.  Script Parameters 
  235.  
  236. $"            All the text between this parameter and a matching 
  237.               quote (") in the script (or the end of the line if that 
  238.               comes first) will be echoed on a new console line as a 
  239.               prompt. The user's response to the prompt will then be 
  240.               included in the new command line.  Any input after a 
  241.               semicolon is ignored. This ensures that the user cannot 
  242.               slip in an extra command when you want only the 
  243.               parameters to a command.  Note that single quote may be 
  244.               included in the prompt string.
  245.  
  246. $'            This parameter functions much like the above $" except 
  247.               that it does not ignore input after the semicolon.  
  248.               Since the parameter takes the entire input line from 
  249.               the user, it can be used to prompt the user for a 
  250.               series of commands with semicolon separators.  One may 
  251.               also embed double quotes within the prompt. 
  252.               
  253.  
  254.  Script Parameters 
  255.  
  256. $Mnnnn        This parameter returns the hexadecimal value of 
  257.               hexadecimal address "nnnn". The address must be exactly 
  258.               four characters representing a hexadecimal address.  
  259.               The contents of that address is memory will be 
  260.               converted to two characters representing the hex value 
  261.               and placed into the command line.
  262.  
  263. $Rn           This parameter returns the value of system register n, 
  264.               n= 1..9.  The value of the system register n is given 
  265.               as two characters.
  266.  
  267. $Z            causes the alias to be executed as a recursive alias 
  268.               (clears any commands on command line after alias 
  269.               invocation)
  270.  
  271. (NOTE: If you have an alias call itself without using the parameter 
  272. for recursion you will eventually get a command line overflow as 
  273. result of the stacking of the command tails.  If you use the 
  274. recursion parameter, however, you will be able to go on indefinitely.) 
  275. :E 
  276.  Example ALIAS.CMD File 
  277.  
  278. ARUNZ.CMD is a text file and can be created with any editor or word 
  279. processor that produces standard ASCII files.  Each line of this file 
  280. consists of the name of the alias script and a space, followed by the 
  281. prototype command line, including the parameter expressions allowed 
  282. in aliases. There is no limit to the number of such lines that the 
  283. file may contain.  Here is an example ALIAS.CMD file that defines 
  284. aliases using many of the extended parameters now allowed (lines are 
  285. wrapped here but must not be wrapped in the actual ALIAS.CMD file):
  286.  
  287.      param echo parameters are "$1 $2 $3";echo
  288.      tail echo tail is "$*";echo
  289.      tail2 echo this is the tail less two parameters;echo --> "$-2";echo
  290.      name echo alias name is "$0";echo
  291.      diskuser echo logged disk is $d0 / logged user is $u0;echo
  292.      disk echo logged disk is $d0;echo
  293.      user echo logged user is $u0;echo
  294.  
  295.  Example ALIAS.CMD File 
  296.  
  297.  
  298.      sysfile1 echo system file 1: "$f1";echo name is "$n1";echo type is
  299.                 "$t1";echo
  300.      recurse $zxif;echo loop again?;if in;arunz $0;else;echo the loop 
  301.                 is now complete;fi
  302.  
  303. (Recurse would not cause a command line overflow.)
  304.  
  305.  
  306.      norecurs xif;echo loop again?;if in;arunz $0;else;echo the loop 
  307.                 is now complete;fi
  308.  
  309. (Norecurs would eventually cause such an overflow.)
  310.  
  311.  Example ALIAS.CMD File 
  312.  
  313.  
  314.      parse parsing parameter 1;echo directory: $D1;echo user: $U1;
  315.                 echo file name: $:1; echo file type: $.1
  316.  
  317.      D DIR $"enter file spec: "
  318.  
  319. (D would run the Dir command with a file spec given by the user in
  320. response to the prompt.)
  321. :S
  322.  Programming Summary 
  323.  
  324.  ^             precedes character to be expanded as control character
  325.  $^, $$        "$^" quotes "^" and "$$" quotes "$".
  326.  
  327.  :             precedes the default alias
  328.  =             separates names in multiple name alias
  329.  ?             matches any character in alias name
  330.  
  331.  $*            entire command line tail
  332.  $-n           command line tail less first n tokens, n = 0..9
  333.  $0            the alias name passed to ARUNZ
  334.  $n            command line parameter token n, n = 1..9
  335.  $:n           file name in token n, n = 1..9
  336.  $.n           file type in token n, n = 1..9
  337.  
  338.  Programming Summary 
  339.  
  340.  $Dn           currently logged drive, if n=0 or drive
  341.                specified in token n if n = 1..9
  342.  $Un           currently logged user, if n=0 or user specified in token
  343.                n if n = 1..9
  344.  
  345.  $Fn           full name and type of system file n, n = 1..4
  346.  $Nn           name only of system file n, n = 1..4
  347.  $Tn           type only of system file n, n = 1..4
  348.  
  349.  $"            echos text between " and following " (or EOL)
  350.                as a prompt and includes the user's response
  351.                in the command line.  All input after a
  352.                semicolon is ignored.
  353.  
  354.  $'            similar to $"text except that it does not
  355.                ignore input after the semicolon.
  356.  
  357.  
  358.  Programming Summary 
  359.  
  360.  $Mnnnn        hexadecimal value of hexadecimal address
  361.                "nnnn".
  362.  
  363.  $Rn           value of system register n, n= 1..9
  364.  
  365.  $Z            execute as a recursive alias (clears any
  366.                commands on command line after alias
  367.                invocation)
  368.  
  369.  
  370.                
  371.   0131Háááá '╖'          F╖áattributσáoptioεácharacte≥ááááá          ì
  372. áá0132Háááá OFF (00H)    F╖áattr