home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / jsage / zsus / z3help / x.lbr / XFOR.HZP / XFOR.HLP
Encoding:
Text File  |  1991-11-18  |  18.1 KB  |  351 lines

  1. ;
  2.                                    XFOR.COM                                   
  3.  
  4.              Size (recs) CRC   Version    Author/Latest Issue      Disk
  5.                6k (41)   4C28  1.40       Gene Pizzetta 11/91      Z3COM27
  6.  
  7.   1- Usage  2- Config  3- RAS Opn  4- File Format  5- Notes  6- Examples      
  8.  
  9.    XFOR is  a ZCPR3 Extended  FOR utility for searching and  displaying "----"
  10. delimited file catalogs, including crunched files.  The source DU and filename
  11. can be specified on the command line,  parsed  by  the  CPR  for remote system
  12. safety.   Alternately, an internally configured default directory and filename
  13. can be used.  Highlighting and direct cursor addressing is used, if available.
  14. The error flag is set on error,  or if a  matching string is not found.   XFOR
  15. responds to the  "//"  help option and can be  re-invoked with the GO command.
  16. Optionally,  XFOR can display  a header  for  Bill Tishey's  ZFILES.LST,  or a
  17. custom header can be displayed.  Output can be echoed to the printer.   Numer-
  18. ous configuration options can be set with with ZCNFG.
  19. :1
  20.  
  21.     Syntax   XFOR {{dir}:{fn.ft}} {/options} {string{|string{|...}}}
  22.  
  23.  
  24.    If no filespec is given,  the internally configured drive/user and filename
  25. will be used.   If a filespec is  given on the  command  line, a colon must be
  26. included.   If only a DU or DIR is given,  the internal filename will be used.
  27. If only a filename is given,  the internal  DU will be used.   As distributed,
  28. the internal DU is configured for the currently logged directory.
  29.  Options   A leading slash is required.  Options must follow the file
  30.            specification, if one is given, and preced the search string.
  31.  
  32.      H    Toggle header  display  on  or off,  depending on the configured
  33.           default.
  34.  
  35.      A    Use alternate header, the header not configured as the default.
  36.  
  37.      S    Toggle inserting a blank line between entries,  depending on the
  38.           configured default.
  39.  
  40.      P    Pause display when screen fills.  This option will also suppress
  41.           the  "Do you want screen paging?"  question,  if  XFOR  has been
  42.           configured to "ASK".
  43.  
  44.      N    Suppress screen page  pausing,  which  also  suppresses variable
  45.           screen page overlap.   If a header is  being displayed,  it will
  46.           appear only at the beginning of the listing.   This  option will
  47.           also  suppress  the  "Do you want screen paging?"  question,  if
  48.           XFOR has been configured to "ASK".
  49.  Options - 2/2 
  50.  
  51.      L    Output will be echoed to the printer.  If the wheel byte is off,
  52.           however,  printer echo is not  available  and the option will be
  53.           ignored.   Printer output echoes the  matching entries only;  no
  54.           headers or other messages are sent to the printer and no format-
  55.           ting is  done.   Automatic  screen  paging  is  disabled if this
  56.           option is given, although ^S will still work.
  57.  
  58.      V    Suppress video highlighting.  No highlighting will be used, even
  59.           if available in the TCAP.
  60.  String Search - 1/3 
  61.  
  62.    Leading spaces in the first  search  string  on  the  command  line are not
  63. significant.   To make leading spaces significant,  precede them with the  "|"
  64. multiple string delimiter.   This  method  allows  looking  for " REN" without
  65. finding "reference".
  66.  
  67.    Likewise,  because the slash is used as an option list delimiter,  a search
  68. string beginning with a slash could be misinterpreted by the parser.   Looking
  69. for file entries beginning with a slash  can be done reliably by preceding the
  70. slash with "|" or by a question mark.
  71.  
  72.    Search strings may include the following special characters:
  73.  
  74.      |    separates multiple search strings.  The "|" is equal to 
  75.           "OR"; that is, an entry will be found if it contains 
  76.           any of the given search strings.
  77.  
  78.      \    matches the beginning of a line.  In a typical FOR 
  79.           file the only word at the beginning of a line is a 
  80.           filename, so this option can be used to avoid matching 
  81.           words in the file description.
  82.  String Search 2/3 
  83.  
  84.      ?    matches any single character, allowing primitive 
  85.           wildcard searches.
  86.  
  87.    XFOR was intended to allow operation through an alias, so only one copy has
  88. to be on line,  even  if  you  want  to  be  able  to use it to search several
  89. catalogs.
  90.  
  91.    The program error flag is set if  XFOR  encounters any problems.   The flag
  92. values correspond to those in  Z34ERR.LIB  (all values are below 14h),  except
  93. that if no matching string is found, the flag is set to FFh.
  94.  
  95.    XFOR can be aborted at any time with ^C, ^K, ^X, C, K, or X.
  96.  String Search - 3/3 
  97.  
  98.    A header for Bill Tishey's  ZFILES.LST can be  displayed at the top of each
  99. screen page.  You can make this header display the default, or you can use the
  100. command line options H and A,  depending  on  your  configuration.   XFOR also
  101. provides  a  data  area  for  a  custom   alternate  header.   A  patch  file,
  102. XFHEADER.Z80 is provided to allow the creation of the alternate header,  which
  103. is then assembled to a  HEX file and loaded over the COM  file  using MLOAD or
  104. MYLOAD.   If the TCAP allows, the header will be printed and maintained at the
  105. top of the screen;  otherwise,  it will be  printed  at the beginning of every
  106. screenful and  scrolled  up  the  screen.   The header is only printed once if
  107. screen paging is disabled.
  108.  
  109.    As distributed, the alternate header is set up for "Nolan-type"  FOR files.
  110. The alternate header can be changed using ZCNFG.   Because it might  be diffi-
  111. cult to type in a long header in  answer to  ZCNFG's  prompt,  a  patch  file,
  112. XFHEADER.Z80, is provided to allow the creation of an alternate header to your
  113. specifications.   After editing the file,  assemble it to  a HEX file and load
  114. it over XFOR using MLOAD or MYLOAD.
  115. :2
  116.  Configuration 
  117.  
  118.    XFOR has a large number of configuration options that  can be changed using 
  119. ZCNFG and the included XFORnn.CFG file.   Do not  change  the  name of the CFG
  120. file, so  that  ZCNFG  will always be able to find it,  even if you change the
  121. name of XFOR.COM.
  122.  
  123.    The ZCNFG help  screens  are  an important  aid to configuring XFOR to your
  124. liking, so read them carefully.
  125.  Video Attributes 
  126.  
  127.    XFOR will run as  distributed  under  any type of TCAP.   Video  attributes
  128. highlight the header display,  if one is  used,  and  the  first  line of each
  129. displayed file entries.   Normally, the TCAP "standout" string will be used to
  130. set the attributes for the first line of each entry.   If an  extended TCAP is
  131. in memory,  XFOR will  attempt to  display  the  header in reverse  video.  If
  132. reverse is not available, or if there is no extended TCAP, the standout string
  133. will be used for the header,  also.   If no  attributes are  available in your
  134. TCAP, XFOR will still work fine; the header will be  marked by  right and left
  135. brackets at each end.
  136.  
  137.    The attributes used for display of  the  header  and  the  first  lines  of
  138. entries are configurable.
  139. :3
  140.  RAS Operation - 1/3 
  141.  
  142.    Sysops who cannot store TCAP information for individual users can eliminate
  143. the terminal dependencies of  highlighting,  reverse  video,  and clearing the
  144. screen by making sure those bytes  are null in  the generic TCAP,  or they can
  145. be eliminated through a configuration option.   The routines in  XFOR will not
  146. send the strings if they are not there,  so  the screen  will  merely  scroll.
  147. In fact,  by using a null TCAP and changing some options with ZCNFG,  XFOR can
  148. be made to operate in the same manner as earlier FOR utilities,  although that
  149. would eliminate some desirable enhancements.
  150.  
  151.    If XFOR is called with  a  filename  parameter from  an  alias  or from the
  152. command line, the filename is parsed by the CPR, which for safety reasons does
  153. not allow access to a directory above the maximum DU or to a drive excluded by
  154. the drive vector in the environment.   To  access  a  directory  outside these
  155. limits, configure it into the internal DU specification.   If the command line
  156. filename parameter begins with a colon,  the internal DU specification will be
  157. used.
  158.  RAS Operation - 2/3 
  159.  
  160.    If the wheel is off,  XFOR will exclude the filespec and options parameters
  161. from the usage screen display, under the assumption that either the internally
  162. configured filename or an alias will always  be  used  and  that  the  options
  163. should not be under the control of the remote user.  In addition,  a few usage
  164. examples will be  displayed.   The  theory for the latter is that  experienced
  165. users want only a reminder of the syntax, but RAS users may need more informa-
  166. tion.
  167.  
  168.    Printer output is disabled if the  wheel  byte is  reset (off).   The other
  169. options are still available,  even though they are not  displayed  on the help
  170. screen.  If options are included in aliases that call XFOR,  then options will
  171. not be available to remote users from the  command  line  (XFOR will only find
  172. the first set of options).   If no options are to  be  included  in  the alias
  173. script,  inserting  a single slash  with no options following it will have the
  174. same effect.
  175.  
  176.    Sysops will probably want to  set  the  paging  option to ASK, so users can
  177. request no  paging if they are  merely  reading  the  FOR file into their text
  178. buffer.  Paging for many users is almost mandatory, however.  
  179.  RAS Operation - 3/3 
  180.  
  181.    As distributed XFOR does not leave a blank line between entries.  Since the
  182. first line of each entry is highlighted, the display is readable and many more
  183. entries can be displayed.   Some people may prefer less clutter,  however,  so
  184. XFOR can be configured to insert  a blank line by default.  The blank line may
  185. be even more desirable if highlighting is not supported.
  186.  
  187.    XFOR requires a TPA of about 38 kilobytes in order to  uncrunch files.   It
  188. will operate in a much smaller space, however, if uncrunching is not required.
  189. :4
  190.  XFOR File Format  
  191.  
  192.    Most FOR files separate entries with a  series of  four  hyphens  ("----").
  193. Actually, any  hyphen in the  first  column is  considered an entry separator.
  194. Entries can be longer than a screen,  but a single  entry longer than about 8K
  195. will cause XFOR to abort with an "incorrect format" message.
  196. :5
  197.  XFOR Notes - 1/5 
  198.  
  199.    a. This utility is a result of the  collective  ideas and complaints of the 
  200.       group that hangs around Jay Sage's Newton Centre Z-Node.   The  idea for
  201.       an enhanced  FOR came from Chris  McEwen,  who runs the Socrates Z-Node.  
  202.       Bill Tishey reformatted his  ZFILES.LST so it  could  be read by FOR and
  203.       offered several good ideas.   Jay Sage gave  valuable  advice on command
  204.       line syntax.   Bob Dean was  a  well-spring  of suggestions.   They, and
  205.       Howard Schwartz,  offered criticism and support that resulted in  a much
  206.       better utility.  Thanks to you all.
  207.  
  208.    b. Vs 1.4 updates (11/10/91, Gene Pizzetta):
  209.       - Finally implemented a couple of suggestions made months ago.  Bob Dean
  210.         wanted a  "searching"  message so the user would  know  something  was
  211.         happening while  XFOR  was looking for a  match,  so it's here.   Bill
  212.         Tishey wanted to be able to  search  crunched  files,  so  that's here
  213.         also.   Unfortunately,  neither KMD nor ZMD can handle crunched files,
  214.         but this XFOR feature could be useful for extended  FOR  file listings
  215.         and for Bill Tishey's  ZFILES.LST.   About  38  kilobytes  of  TPA  is
  216.         required for  uncrunching.   "Nolan"  FOR file header now  built-in as
  217.         alternate header.
  218.  XFOR Notes - 2/5 
  219.  
  220.    b. Vs 1.3 updates (4/7/91, Gene Pizzetta):
  221.       - A problem with previous versions was the mixing  of  console input and
  222.         output via BDOS and BIOS.   That problem has been solved by  adding  a
  223.         TABIT routine to expand tabs in the FOR file and  eliminate the use of
  224.         the SYSLIB BOUT routine.  All console I/O is now via the BIOS.
  225.  
  226.    c. Vs 1.2 updates (12/23/90, Gene Pizzetta):
  227.       - Changed command line syntax at the request of Jay Sage:  Now an option
  228.         list, preceded by a slash, can be included in the  command  line, just
  229.         before the match string.  Options are:  H=display header; A=use alter-
  230.         nate header; S=double-space between entries;  L=echo to printer (LST);
  231.         V=turn off all  screen  attributes;  P=use  screen  paging;  and  N=no
  232.         screen paging.  The last two will suppress the paging "ASK" configura-
  233.         tion option.  The L option will suppress screen paging.
  234.  
  235.    d. Vs 1.1 updates (12/18/90, Gene Pizzetta):
  236.       - Added CR, LF after paging question.  
  237.       - Now uses BOUT instead of COUT in print loop, so tabs are expanded.  
  238.       - Added printer output and  "+" command line option (must be last token, 
  239.         preceded by a space). 
  240.  XFOR Notes - 3/5 
  241.  
  242.       - Made video attributes used for header and first  line of entry config-
  243.         urable options.
  244.  
  245.    e. Vs 1.0 updates (12/15/90, Gene Pizzetta):
  246.       - Variable screen overlap  and clearing  screen before each page are now
  247.         configurable options.  
  248.       - Changed method of making leading spaces significant;  now requires "|"
  249.         at beginning of match string if leading spaces are to be significant.  
  250.       - Uses direct cursor addressing and  clear-to-end-of-screen  string,  if
  251.         available and if header is being displayed.  
  252.       - Fixed bug that in some cases  caused  highlighting  not to be properly
  253.         terminated on  an  Apple II+  (STNDEND must be called before sending a
  254.         linefeed on that machine).  
  255.       - Fixed bug that sent the  program into  never-never-land if  the Kaypro
  256.         4/10 TCAP from Z3TCAP27 was used.   (This was actually  a  bug in  the
  257.         SETATR routine in VLIB versions 42 and 43,  but I have compensated for
  258.         it.)  
  259.       - Source filename parameter omitted  from syntax message for non-wheels,
  260.         unless configured to always be omitted.
  261.       - And, finally, documentation.
  262.  XFOR Notes - 4/5 
  263.  
  264.    f. Vs 0.2 updates (12/8/90, Gene Pizzetta):
  265.       - A second beta release.   Name  changed to  XFOR to avoid conflict with
  266.         ZMD utilities.  
  267.       - Can be configured to page or not page output, or to ask the user which
  268.         he wants.  
  269.       - No longer responds to quiet flag, but quiet configuration still works.
  270.       - Highlights first line of each entry if available from TCAP.
  271.       - Uses reverse video for header line, if available.  
  272.       - Sets correct  Z34 error codes in program error flag,  except no string
  273.         match is FFh.  
  274.       - Configurable to allow  blank  line  between entries or not if you want
  275.         more entries on screen.  
  276.       - additional roll-your-own header.
  277.       - Leading spaces now significant in search string.  
  278.       - Adopted Jay Sage's suggested command line syntax:   if there's a colon
  279.         in the first token, it's a filename; otherwise, use the internal file-
  280.         name.  In addition,  XFOR will use the internal filename if the  colon
  281.         is not followed by one,  and  will use the internal DU if the colon is
  282.         not preceded by one.  
  283.  XFOR Notes - 5/5 
  284.  
  285.       - Now properly handles entries more than a screen-length.  
  286.       - Entry buffer now handles single entries of up to 8K.
  287.  
  288.    g. Vs 0.1 updates (12/2/90, Gene Pizzetta):
  289.       - A beta release,  based on Carson Wilson's FORZ 1.0 (8/5/87), which was
  290.         a revised disassembly of Irv Hoff's FOR.COM.  
  291.       - Sets the ZCPR program error flag if a matching string is not found.  
  292.       - The "end of listing" and  "aborted"  messages suppressed if ZCPR quiet
  293.         flag is set or if configured to default to quiet mode.  
  294.       - Responds to "//" help option on command line.  
  295.       - Re-initializes data buffers so it can be re-invoked with GO command.  
  296.       - Added command line source file specification.  If no DU or DIR spec is 
  297.         given,  an internally configured default directory is used or,  if not
  298.         configured,  the  current  logged  directory.   If no  command tail is
  299.         given, defaults to configured internal filename.  
  300.       - If reading an  improperly  formatted  file,  FORZ  kept  adding to the
  301.         OutBuf until it  overwrote  the  system.   ZFOR instead aborts with an
  302.         error message.  
  303.       - Configurable with ZCNFG.
  304. :6
  305.  Examples of Use - 1/3 
  306.  
  307.    a. XFOR A1:ZFILES.LST /H
  308.           XFOR displays all entries in ZFILES.LST in A1, using 
  309.           the ZFILES header.
  310.  
  311.    b. XFOR
  312.           XFOR displays all entries in the internally configured 
  313.           file in the default directory or in the internally 
  314.           configured directory.
  315.  
  316.    c. XFOR A1:ZFILES.LST /SN \REN
  317.           XFOR will search ZFILES.LST in A1 for entries with 
  318.           filenames beginning with "REN", inserting a blank line 
  319.           between each entry and scrolling continuously.
  320.  
  321.    d. XFOR :ZFILES.LST REN
  322.           XFOR will search ZFILES.LST in the default directory or 
  323.           in the internally configured directory for entries with 
  324.           a string containing "REN".  The search is not case- 
  325.           sensitive.  The colon before the filename is required.
  326.  Examples of Use - 2/3 
  327.  
  328.    e. XFOR :ZFILES.LST /L REN
  329.           Same as above, except output will also be echoed to the 
  330.           printer (if the wheel byte is on).  If the wheel byte 
  331.           is off, the L option will be ignored.
  332.  
  333.    f. XFOR A1: | REN|\REN
  334.           XFOR will search the internally configured file in A1 
  335.           for an entry with a word beginning with "REN" or any 
  336.           filename beginning with "REN".
  337.  
  338.    g. XFOR A?M|M?C
  339.           XFOR will search the internally configured file in the 
  340.           default directory or in the internally configured 
  341.           directory for entries containing "ASM", "AQM", "AZM", 
  342.           "MAC", "MQC", "MZC", etc.
  343.  Examples of Use - 3/3 
  344.  
  345.    h. XFOR : C0:
  346.           XFOR will search the internally configured file in the 
  347.           default directory or in the internally configured 
  348.           directory for entries containing "C0:".  In this case 
  349.           the single colon is required so that XFOR will not 
  350.           think "C0:" is a DU specification.
  351.