home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / qtawkos2.zip / QTAWK.HIS < prev    next >
Text File  |  1994-11-21  |  45KB  |  866 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.                               QTAwk Update History                       
  8.         
  9.          ==> QTAwk Version 6.00 for DOS and version 1.00 for OS/2,  dated
  10.         05/01/94.   This  version  contains several changes and additions
  11.         from the previous versions:
  12.         
  13.         1.  Arrays have been fully integrated into the  match  operators,
  14.             '~~' and '!~', both their direct use and their implied use in
  15.             patterns and as arguments of the  functions  'match',  'sub',
  16.             'gsub'  and 'split'.  The use of an array as the operand of a
  17.             match operator will match against all elements of  the  array
  18.             as  separate regular expressions.  This is similar to the use
  19.             of the GROUP keyword in patterns. 
  20.             
  21.              If a match is found, the new variable MATCH_INDEX is set  to
  22.             the  string  value  of the index in the array of the matching
  23.             regular expression.  If a multidimensional array is used, the
  24.             array  indices  are  separated  by  the value of the built-in
  25.             variable SUBSEP (which has been re-introduced from Awk with a
  26.             slightly different use). 
  27.             
  28.              In addition, the use of arrays for the built-in variables RS
  29.             and  FS  enables  the  user  to  specify   multiple   regular
  30.             expressions   for  use  as  record  separators  and/or  field
  31.             separators.  The use of arrays for  RS  and/or  FS  does  not
  32.             affect the value of MATCH_INDEX. 
  33.             
  34.              Arrays  used  for  regular  expression matching retain their
  35.             internal regular expression form until the whole array or  an
  36.             array  element  is  changed.   Thus  arrays can be be used as
  37.             dynamic regular expressions for which the user controls  when
  38.             the internal form is changed. 
  39.             
  40.         2.  New  algorithms  have  been  developed  and  used for regular
  41.             expression matching.  A total of  four  different  algorithms
  42.             are  used  for pattern matching.  QTAwk automatically selects
  43.             the appropriate algorithm to optimize the search depending on
  44.             the  regular expression(s) to be matched.  The algorithm used
  45.             is selected based on the number of regular  expression(s)  to
  46.             match  and  the  complexity  of  the  regular expression(s). 
  47.             
  48.         3.  The new variable MATCH_INDEX is defined.   This  variable  is
  49.             set  to the string value of the index of the matching element
  50.             when an array is used for matching. 
  51.             
  52.         4.  The variable SUBSEP from Awk is re-introduced with a  default
  53.             value of a comma character, ','.  The value of SUBSEP is used
  54.             to  separate  the  index  values  in   MATCH_INDEX   when   a
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.             multidimensional array is used for matching. 
  62.             
  63.         5.  A  new method of file processing has been introduced.  In the
  64.             current and  previous  versions,  the  following  process  is
  65.             carried out:
  66.             
  67.             a)  Determine  next  record  according  to  RS or RECLEN, see
  68.                 below for an explanation of RECLEN,
  69.             b)  Read next record,
  70.             c)  Parse record into fields according to FS or  FIELDWIDTHS,
  71.                 see below for an explanation of FIELDWIDTHS,
  72.             d)  Execute each pattern expression
  73.                 1:  If  pattern  expression  is  TRUE, execute associated
  74.                     action
  75.             
  76.              For QTAwk utilities in which all patterns contain a  regular
  77.             expression  match  or  for  those files for which actions are
  78.             executed only for those records matching a set of one or more
  79.             regular expressions, the above process for each record can be
  80.             time consuming.  It would be much faster to  scan  the  input
  81.             file  for  matches  to  the desired regular expression(s) and
  82.             then execute each pattern expression once such a  record  has
  83.             been  found.   This  by-passes  the time consuming process of
  84.             reading individual records and  parsing  each  into  fields. 
  85.             Only  the desired records need to be read and parsed with the
  86.             new method, thus saving much time in  the  execution  of  the
  87.             QTAwk utility. 
  88.             
  89.              QTAwk  Version  6.00 for PC/MS-DOS and Version 1.00 for OS/2
  90.             implements the new search method.  Two new variables:
  91.             
  92.             a)  FILE_SEARCH
  93.             b)  FILE_SEARCH_PAT
  94.             
  95.              have been introduced for this purpose.  When FILE_SEARCH  is
  96.             TRUE,  the  next  record  read  will be the record matching a
  97.             regular expression from FILE_SEARCH_PAT.  If  FILE_SEARCH  is
  98.             FALSE,  the  normal  file  input  process  described above is
  99.             followed.  The new file search process may be turned  on  and
  100.             off  as  necessary  for  a single input file in this manner. 
  101.             
  102.              FILE_SEARCH_PAT is set by the user utility to  one  or  more
  103.             regular  expressions  against  which records from the current
  104.             input file are matched.  FILE_SEARCH_PAT  may  be  set  to  a
  105.             single regular expression as a simple variable, e.g.,
  106.             
  107.             ■  FILE_SEARCH_PAT = /test string/;
  108.             
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.              or a singly dimensioned array, e.g.,
  116.             
  117.             ■  FILE_SEARCH_PAT[1] = /test string 1/;
  118.             ■  FILE_SEARCH_PAT[2] = /test string 2/;
  119.             ■  FILE_SEARCH_PAT[3] = /test string 3/;
  120.             ■  FILE_SEARCH_PAT[4] = /test string 4/;
  121.             
  122.              or a multidimensioned array, e.g.,
  123.             
  124.             ■  FILE_SEARCH_PAT[1][1] = /test string 1,1/;
  125.             ■  FILE_SEARCH_PAT[1][2] = /test string 1,2/;
  126.             ■  FILE_SEARCH_PAT[1][3] = /test string 1,3/;
  127.             ■  FILE_SEARCH_PAT[2][1] = /test string 2,1/;
  128.             ■  FILE_SEARCH_PAT[2][2] = /test string 2,2/;
  129.             ■  FILE_SEARCH_PAT[2][3] = /test string 2,3/;
  130.             ■  FILE_SEARCH_PAT[3][1] = /test string 3,1/;
  131.             ■  FILE_SEARCH_PAT[3][2] = /test string 3,2/;
  132.             ■  FILE_SEARCH_PAT[3][3] = /test string 3,3/;
  133.             
  134.              When  FILE_SEARCH is TRUE, the current input file is scanned
  135.             for a match to  FILE_SEARCH_PAT.   When  a  record  is  found
  136.             matching  a regular expression in FILE_SEARCH_PAT, the record
  137.             is read, parsed into fields according to  FS  or  FIELDWIDTHS
  138.             and each pattern expression executed.  The associated actions
  139.             for TRUE pattern expressions are  executed.   Note  that  the
  140.             variables  RS  or  RECLEN  still determine the parsing of the
  141.             input file into records. 
  142.             
  143.              Under some circumstances, the above process  can  return  in
  144.             '$0'  multiple  records  from  the  current  input  file.  In
  145.             searching the input file for a match  to  FILE_SEARCH_PAT,  a
  146.             match  may  span  more  than  one record if the new variable,
  147.             SPAN_RECORDS, is TRUE.  In this case, '$0' is set to the full
  148.             set  of  records  spanning  the match to FILE_SEARCH_PAT.  If
  149.             SPAN_RECORDS is FALSE, any matches to FILE_SEARCH_PAT are not
  150.             allowed  to  span  input records and '$0' will contain only a
  151.             single record. 
  152.             
  153.         6.  The new variable FILE_SEARCH is defined as described  above. 
  154.             
  155.         7.  The  new  variable  FILE_SEARCH_PAT  is  defined as described
  156.             above. 
  157.             
  158.         8.  The  new  variable  SPAN_RECORDS  is  defined  as   described
  159.             above. 
  160.             
  161.         9.  The  action  of  QTAwk  when  NF  is changed now reflects the
  162.             intuitive effect of changing NF.  If the new value is greater
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.             than  the current value, the current input line is lengthened
  170.             with new empty fields separated by the output field separator
  171.             string,  OFS.   If  the  new  value  is less than the current
  172.             value, the current input line is shortened by  truncating  at
  173.             the  end  of  the  field  corresponding to the new NF value. 
  174.             
  175.         10.  Two new input functions have been introduced:
  176.             a)     srchrecord(sp)
  177.                 or srchrecord(sp,rs)
  178.                 or srchrecord(sp,rs,var)
  179.                 is similar to the function 'getline'.  'srchrecord'  will
  180.                 search  the  current  input  file  for the next record or
  181.                 records matching the search pattern, 'sp'.  If the record
  182.                 separator  parameter, 'rs', is not specified, records are
  183.                 determined by the variable RS  or  RECLEN.   If  'rs'  is
  184.                 specified,   record  boundaries  are  determined  by  the
  185.                 strings matching 'rs'.  'rs' may be a simple constant  or
  186.                 variable or an array.  The record or records matching the
  187.                 search pattern are returned  in  '$0'  if  'var'  is  not
  188.                 specified.  If 'var' is specified, the matching record or
  189.                 records are returned in 'var'.  The  built-in  variables,
  190.                 FNR  and  NR  are updated to reflect the current position
  191.                 and  record  number  after  the  search.   The   built-in
  192.                 variables, NF and '$i', i ≤ 0 ≤ NF, are set when 'var' is
  193.                 not specified. 
  194.                 
  195.             b)     fsrchrecord(file)
  196.                 or fsrchrecord(file,sp)
  197.                 or fsrchrecord(file,sp,rs)
  198.                 or fsrchrecord(file,sp,rs,var)
  199.                 is similar to  the  function  'fgetline'.   'fsrchrecord'
  200.                 will  search  the  file  specified for the next record or
  201.                 records matching the search pattern, 'sp'.  If the record
  202.                 separator  parameter, 'rs', is not specified, records are
  203.                 determined by the variable RS  or  RECLEN.   If  'rs'  is
  204.                 specified,   record  boundaries  are  determined  by  the
  205.                 strings matching 'rs'.  'rs' may be a simple constant  or
  206.                 variable or an array.  The record or records matching the
  207.                 search pattern are returned  in  '$0'  if  'var'  is  not
  208.                 specified.  If 'var' is specified, the matching record or
  209.                 records are returned in 'var'.  The  built-in  variables,
  210.                 NF  and  '$i',  i  ≤  0  ≤  NF, are set when 'var' is not
  211.                 specified. 
  212.             
  213.              Both functions have identical returns to the  'getline'  and
  214.             'fgetline' functions, i.e.,
  215.             a)  the  number  of  characters in the record(s) matched plus
  216.                 the End-Of_Record length plus 1
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.             b)  zero, 0, if End-Of-File  was  reached  before  finding  a
  224.                 match
  225.             c)  -1 on a file read error. 
  226.             
  227.             
  228.                       getline()     getline(v)     fgetline(F)     fgetline(F,v)
  229.                       srchrecord()  srchrecord(v)  fsrchrecord(F)  fsrchrecord(F,v)
  230.                                                                          
  231.             $0        updated       not updated        updated     not updated
  232.             $i, i>0   updated       not updated        updated     not updated
  233.             NF        updated       not updated        updated     not updated
  234.             NR        updated           updated    not updated     not updated
  235.             FNR       updated           updated    not updated     not updated
  236.             
  237.              Note:  the  function  parameters  sp  and  rs  have not been
  238.             shown in 'srchrecord'  and  'fsrchrecord'  to  highlight  the
  239.             similarity  with  the  functions 'getline' and 'fgetline' and
  240.             their effect on the variables indicated. 
  241.             
  242.         11.  The  new  function  'get_FNR'  has  been  introduced.   This
  243.             function  returns  the  current  record  number  for the file
  244.             specified.  The two forms are:
  245.             
  246.             a)  get_FNR()
  247.                 This form  returns  the  current  record  number  of  the
  248.                 current  input  file.  The value returned is equal to the
  249.                 built-in variable FNR. 
  250.             b)  get_FNR(filename)
  251.                 This form returns the current record number of the  input
  252.                 file  specified.   If  filename == FILENAME, this form is
  253.                 equivalent to the first form.  If the filename  specified
  254.                 is not open or is not open for input, a value of zero, 0,
  255.                 is returned. 
  256.             
  257.              This function has been added because of the input  functions
  258.             'fgetline'  and  'fsrchrecord'.   For the current input file,
  259.             the built-in variable FNR is always updated automatically  to
  260.             contain  the  record  number  of  the  last record input (the
  261.             current record).  However, when reading  from  a  file  other
  262.             than the current input file, previously there was no means of
  263.             obtaining the current record number of the input file.   With
  264.             'fgetline',  the  user  utility could maintain an independent
  265.             count  of  records  read.   However,  if  the   'fsrchrecord'
  266.             function  is  used,  there is no other means of obtaining the
  267.             record number of the last record read. 
  268.             
  269.         12.  The function 'resetre' has  been  introduced.   In  previous
  270.             versions,  once  a regular expression has been used to search
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.             for a match, the internal form of the regular  expression  is
  278.             set  and  could  not  be  changed.  If the regular expression
  279.             contained embedded named expressions and the value(s) of  the
  280.             corresponding  variables  changed,  the  new  values  of  the
  281.             variables  could  not  be  incorporated  into   the   regular
  282.             expression.   This  improved  the speed of scanning since the
  283.             regular expressions did not have to be converted to  internal
  284.             form  for  each  use.   To  obtain the variability needed for
  285.             changing variable values, strings were  used  for  matching. 
  286.             For  match  expressions which change frequently, strings used
  287.             for match operators are still the better choice,  since  they
  288.             are  converted  to  internal form for each use.  However, for
  289.             those  occasions   where   the   match   expression   changes
  290.             infrequently  due  to  the  change in value of embedded named
  291.             expressions,  the  use  of  a  string   leads   to   impaired
  292.             performance.  This function has been introduced for just such
  293.             use.  This function releases the internal form of all regular
  294.             expressions  so  that  the next time it is used as the search
  295.             pattern for a match operation, the internal form  is  rebuilt
  296.             using  the then current values of any variables used in named
  297.             expressions. 
  298.             
  299.              Note that the use of arrays for match patterns falls between
  300.             the use of strings, for which the internal regular expression
  301.             form is rebuilt for each use,  and  regular  expressions  for
  302.             which  the  internal form is built for the first use and then
  303.             remains static.  When  arrays  are  used  for  matching,  the
  304.             internal regular expression form is built when first used and
  305.             retained until the array is changed.  For arrays the internal
  306.             regular expression form is assigned when the array as a whole
  307.             is assigned to another variable.  Thus the  internal  regular
  308.             expression form can be retained and reused. 
  309.             
  310.         13.  The   new  variable  FILEATTR  is  defined.   This  variable
  311.             contains the attributes  of  the  current  input  file  in  a
  312.             string.  The string defines the attributes in the same manner
  313.             as the variable  for  the  'findfile'  function  defines  the
  314.             attributes for the files found by that function. 
  315.             
  316.         14.  The   new  variable  FILEDATE  is  defined.   This  variable
  317.             contains the date of the current input file in the  operating
  318.             system  format.   The  'sdate/stime' functions may be used to
  319.             format the date. 
  320.             
  321.         15.  The  new  variable  FILEPATH  is  defined.   This   variable
  322.             contains  the  drive and path of the current input file.  The
  323.             path string ends with the subdirectory separator  character. 
  324.             
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.         16.  The   new  variable  FILESIZE  is  defined.   This  variable
  332.             contains the size in bytes of the current input file. 
  333.             
  334.         17.  The  new  variable  FILETIME  is  defined.   This   variable
  335.             contains  the time of the current input file in the operating
  336.             system format.  The 'sdate/stime' functions may  be  used  to
  337.             format the time. 
  338.             
  339.         18.  The following built-in variables have been added:
  340.             
  341.             a)  FILEDATE_CREATE  -  date  of file creation as returned by
  342.                 the Operating System. 
  343.             b)  FILETIME_CREATE - time of file creation  as  returned  by
  344.                 the Operating System. 
  345.             c)  FILEDATE_LACCESS  -  date of last file access as returned
  346.                 by the Operating System. 
  347.             d)  FILETIME_LACCESS - time of last file access  as  returned
  348.                 by the Operating System. 
  349.             
  350.              The  same  variables are available in the PC/MS-DOS version,
  351.             butr their values are set equal to the values of FILEDATE and
  352.             FILETIME. 
  353.             
  354.         19.  The  functions  'sdate'  and  'stime' have been changed from
  355.             previous versions.  The fixed formats supported  by  previous
  356.             versions  have  been replaced by the use of a 'format string'
  357.             identical to that supported by ANSI C.  The forms are:
  358.             a)  sdate(frmt_strg) return  string  formatted  according  to
  359.                 'frmt_strg' using current system date and time. 
  360.             b)  sdate(frmt_strg,fdate)  return string formatted according
  361.                 to 'frmt_strg' using date specified in fdate and  current
  362.                 system  time.   fdate  is  a  file  date in the operating
  363.                 system format. 
  364.             c)  sdate(frmt_strg,year,month,day) return  string  formatted
  365.                 according  to 'frmt_strg' using date specified in 'year',
  366.                 'month' and 'day' and current system time. 
  367.             d)  stime(frmt_strg) return  string  formatted  according  to
  368.                 'frmt_strg' using current system date and time. 
  369.             e)  stime(frmt_strg,ftime)  return string formatted according
  370.                 to 'frmt_strg' using time specified in ftime and  current
  371.                 system  date.   ftime  is  a  file  time in the operating
  372.                 system format. 
  373.             f)  stime(frmt_strg,hour,minute,second)     return     string
  374.                 formatted  according  to 'frmt_strg' using time specified
  375.                 in 'hour',  'minute'  and  'second'  and  current  system
  376.                 date. 
  377.             
  378.              The  format  string  is similar to those used in the 'print'
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.             functions except that the following substitutions  are  made:
  386.             
  387.             %      Substitution Made                                     
  388.             %a --> Locale's Abbreviated Weekday Name                     
  389.             %A --> Locale's Weekday Name                                 
  390.             %b --> Locale's Abbreviated Month Name                       
  391.             %B --> Locale's Month Name                                   
  392.             %c --> Locale's Appropriate Date And Time Representation     
  393.             %d --> Day Of The Month As A Decimal Number (01-31)          
  394.             %H --> The Hour (24-hour Clock) As A Decimal Number (00-23)  
  395.             %I --> The Hour (12-hour Clock) As A Decimal Number (01-12)  
  396.             %j --> The Day Of The Year As A Decimal Number (001-366)     
  397.             %m --> The Month As A Decimal Number (01-12)                 
  398.             %M --> The Minute As A Decimal Number (00-59)                
  399.             %p --> The Locale's Equivalent Of The AM/PM Designations     
  400.                    Associated With A 12-hour Clock                       
  401.             %S --> The Second As Decimal Number (00-61)                  
  402.             %U --> The Week Number Of The Year (the First Sunday As The  
  403.                    First Day Of Week 1) As A Decimal Number (00-53)      
  404.             %w --> The Weekday As A Decimal Number (0-6), Where Sunday Is 0
  405.             %W --> The Week Number Of The Year (the First Monday As The  
  406.                    First Day Of Week 1) As A Decimal Number (00-53)      
  407.             %x --> The Locale's Appropriate Date Representation          
  408.             %X --> The Locale's Appropriate Time Representation          
  409.             %y --> The Year Without Century As A Decimal Number (00-99)  
  410.             %Y --> The Year With Century As A Decimal Number             
  411.             %Z --> The Time Zone Name Or Abbreviation, Or By No Character If
  412.                    No Time Zone Is Determinable                          
  413.             %% --> %                                                     
  414.             
  415.         20.  The  functions  'jdn'  and  'cal' have been modified.  'jdn'
  416.             computes the Julian Day Number for an associated date.  'cal'
  417.             computes  the date for a given Julian Day Number.  The Julian
  418.             Day Number is very useful in date  computations.   The  forms
  419.             are:
  420.             a)  jdn()
  421.                 Computes  the  Julian  Day  Number for the current System
  422.                 Date. 
  423.             b)  jdn(fdate)
  424.                 computes the Julian Day Number for the file date,  fdate,
  425.                 in the operating system format. 
  426.             c)  jdn(year,month,day)
  427.                 computes  the  Julian Day Number for the date specified. 
  428.             d)  cal(frmt_strg,jdn)
  429.                 return string formatted according  to  'frmt_stgr'  using
  430.                 date  specified  in  Julian  Day Number, jdn, and current
  431.                 system time.  The format string, frmt_strg, is  the  same
  432.                 as  used  by the 'sdate' and 'stime' functions above.  If
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.                 the jdn passed is an integer as calculated  and  returned
  440.                 by  the  'jdn'  function, then the current system time is
  441.                 used for any time substitutions.  If the jdn passed is  a
  442.                 floating  point  number,  the  fractional part is used to
  443.                 compute the time used. 
  444.             
  445.         21.  The new  command  line  option,  "-Ww  filename",  has  been
  446.             introduced.   This  option  allows  the  user  to  write  the
  447.             internal form of  a  utility  to  the  specified  file.   The
  448.             internal  form  may  then be specified with the "-f" option. 
  449.             Reading the internal form of a utility  in  this  manner  can
  450.             greatly speed the initial execution of the utility. 
  451.             
  452.         22.  The  command  line  switch  '-Wd' has been introduced.  This
  453.             switch causes QTAwk to delay parsing of the  input  until  an
  454.             input field, "$i", or the "NF" variable is accessed.  Without
  455.             this switch, QTAwk parses each input record as it  is  read. 
  456.             For  utilities  which  do  not  access input fields for every
  457.             record or very few records,  this  can  speed  up  processing
  458.             considerably. 
  459.             
  460.         23.  The following built-in variables have been added:
  461.             
  462.             a)  MATCH_INDEX  -  see the description of the expanded 'sub'
  463.                 and 'gsub' functions below. 
  464.                 
  465.             b)  CONVFMT - specifies the format used to  convert  floating
  466.                 point  values to a string value.  Previously the value of
  467.                 OFMT was used for this purpose.  OFMT is  now  used  only
  468.                 for formatting floating point values for output. 
  469.                 
  470.             c)  IGNORECASE  -  if  assigned  a  true value, QTAwk ignores
  471.                 alphabetic case in all match operations  against  strings
  472.                 and  regular  expressions.  This is true for all built-in
  473.                 functions using regular expressions and in  searches  for
  474.                 record  terminator  and field terminator strings using RS
  475.                 and FS respectively. 
  476.                 
  477.             d)  RT -  Contains  the  full  string  value  of  the  record
  478.                 terminator  of the current input record.  If the value of
  479.                 RS is not changed, this always contains a single new line
  480.                 character.   If the value of RS is changed to an array or
  481.                 a regular expression,  then  the  record  terminator  can
  482.                 change with each input record.  The value of RT gives the
  483.                 user access to the  current  value  of  the  terminator. 
  484.                 
  485.             e)  RECLEN  -  used  to  specify  the  length of fixed length
  486.                 records.  If RECLEN has an integral non-zero  value,  the
  487.  
  488.  
  489.  
  490.  
  491.  
  492.  
  493.                 value is used to read the next record and RS is ignored. 
  494.                 When RECLEN is used to determine  input  records,  RT  is
  495.                 always set to the null string. 
  496.                 
  497.             f)  FIELDWIDTHS  -  when  assigned  a string value containing
  498.                 space separated integral numbers of the form:
  499.                 
  500.                  n1 n2 n3 ...  nn
  501.                 
  502.                  the splitting of input records into fields  is  governed
  503.                 by  the  numbers  in  FIELDWIDTHS  rather  than FS.  Each
  504.                 number in FIELDWIDTHS specifies  the  width  of  a  field
  505.                 including  columns between fields.  If you want to ignore
  506.                 the columns between fields, you can specify the width  as
  507.                 a  separate field that is subsequently ignored.  When the
  508.                 value  FIELDWIDTHS  does  not  match  this  form,   field
  509.                 splitting is done using FS in the usual manner. 
  510.                 
  511.             g)  FIELDFILL  -  used  to  fill a field when the replacement
  512.                 value is less than the field width.  This variable  value
  513.                 is used only when field splitting is based on FIELDWIDTHS
  514.                 rather than FS.  The default  value  is  a  single  blank
  515.                 character. 
  516.                 
  517.             h)  DELAY_INPUT_PARSE  - used to delay parsing of the current
  518.                 input record until the value of NF or one  of  the  field
  519.                 variables,  $i, 1 ≤ i ≤ NF, is needed.  The default value
  520.                 is false.  If the value is true, then the input record is
  521.                 not  parsed  until necessary.  For utilities which do not
  522.                 reference NF  or  the  field  variables,  $i,  or  seldom
  523.                 reference  them, delaying the parsing of the input record
  524.                 can speed the execution of  the  utility  significantly. 
  525.             
  526.         24.  The  command line option "-vvar = value" has been introduced
  527.             to assign "value" to the variable "var' before  execution  of
  528.             the  utility  starts.  This makes the assigned value of "var"
  529.             available in any BEGIN actions.   This  option  may  be  used
  530.             multiple  time  on  the  caommand  line  to  assign  multiple
  531.             variables. 
  532.             
  533.         25.  The command line option "-Wd" has been introduced  to  delay
  534.             input  parsing  until  needed.   See  the  description of the
  535.             built-in variable "DELAY_INPUT_PARSE" above. 
  536.             
  537.         26.  The command line option "-wfilename"  has  been  changed  to
  538.             "-Wwfilename" to conform to the POSIX specifcation. 
  539.             
  540.         27.  The  predefined  pattern, GROUP, has been expanded to accept
  541.  
  542.  
  543.  
  544.  
  545.  
  546.  
  547.             any valid QTAwk  expression.   The  expressions  in  a  GROUP
  548.             pattern  are  evaluated  when  the  GROUP  patterns are first
  549.             matched against an input line.  The expression  is  evaluated
  550.             and  the  result  converted  to a regular expression.  If the
  551.             result of the expression is an array,  the  entire  array  is
  552.             matched  at the corresponding position in the GROUP pattern. 
  553.             
  554.         28.  The 'sub' and 'gsub'  functions  have  been  expanded.   The
  555.             second  argument,  the  replacement  string expression, is no
  556.             longer evaluated at the time the function is called, but when
  557.             the  replacement  string  is used for replacement.  Since the
  558.             first argument, the match pattern expression, may now  be  an
  559.             array,  the  value of the built-in variable, MATCH_INDEX, can
  560.             be affected as matches are made.  By delaying the  evaluation
  561.             of the replacement string expression until the replacement is
  562.             made, the change in MATCH_INDEX can be  used  to  affect  the
  563.             value  of the replacement string for each replacement.  QTAwk
  564.             guarantees that the replacement  string  expression  will  be
  565.             evaluated  as  replacements  are made in the text string from
  566.             left  to  right.   For  constant  expressions  used  for  the
  567.             replacement string, this change has no direct effect. 
  568.             
  569.         29.  The   Tagged  string  operator,  '$$',  has  been  fixed  to
  570.             properly yield the tagged strings. 
  571.             
  572.         30.  A new standard  file,  in  addition  to  "stdaux",  "stdin",
  573.             "stderr",   "stdprn"   and  "stdout",  has  been  introduced,
  574.             "keyboard" for unbuffered input directly from the  keyboard. 
  575.             The  built-in  variable "ECHO_INPUT" also controls echoing of
  576.             input characters from this  "file"  to  the  standard  output
  577.             file.   The  standard  files  are  defined  in more detail in
  578.             {BIF_E}. 
  579.             
  580.         31.  The returns from  the  "getline"  and  "fgetline"  functions
  581.             have been altered slightly.  The values returned are the same
  582.             as the new functions "srchrecord" and "fsrchrecord":
  583.             a)  the number of characters read  plus  the  length  of  the
  584.                 End-Of-Record string plus 1,
  585.             b)  0 if End-Of-File was encountered, or
  586.             c)  -1 if an error occurred. 
  587.         
  588.          ==>  QTAwk  Version 5.11, dated 03/30/92.  This version contains
  589.         two additions from the previous versions:
  590.         
  591.         1.  The predefined variable FILE_SORT has been added  to  control
  592.             the  sequence  of  files  returned by the "findfile" built-in
  593.             function. 
  594.             
  595.  
  596.  
  597.  
  598.  
  599.  
  600.  
  601.         2.  The  predefined  variable  "Gregorian"  has  been  added   to
  602.             control  the  use  of  the  Gregorian  or Julian Calendars in
  603.             converting to/from  dates  and  Julian  Day  Numbers  by  the
  604.             built-in "cal", "jdn" and "sdate" functions. 
  605.         
  606.          ==>  QTAwk  Version 5.10, dated 10/01/91.  This version contains
  607.         several changes and additions from the previous versions:
  608.         
  609.         1.  The command line variable setting mechanism:
  610.             
  611.                                   variable = value                       
  612.             
  613.              has been fixed. 
  614.             
  615.         2.  The function "jdn(fdate)" or "jdn(year,month,day)"  has  been
  616.             added  to  compute the Julian Day Number (jdn) of a specified
  617.             date.   The  Julian  Day  Number  is  very  useful  for  date
  618.             computations. 
  619.             
  620.         3.  The  function  "cal(jdn,form)"  has  been added to complement
  621.             the 'jdn' function above.  The  "cal"  function  returns  the
  622.             date corresponding to the specified jdn passed. 
  623.             
  624.         4.  The  function  "findfile"  has been added.  This function has
  625.             the following forms
  626.             
  627.             a)  findfile(var)
  628.             b)  findfile(var,pattern)
  629.             c)  findfile(var,pattern,attributes)
  630.             
  631.              where:
  632.             
  633.             a)  var == the variable in  which  to  return  the  array  of
  634.                 files found which match the pattern specified
  635.                 
  636.             b)  pattern  ==  a string specifying the pattern to match the
  637.                 filenames.  Follows the DOS wildcard convention.   If  no
  638.                 pattern is specified, "*.*" is used. 
  639.                 
  640.             c)  attributes  ==  a  string  specifying  the  desired  file
  641.                 attributes:   Archive,   Read-Only,    Hidden,    System,
  642.                 Sub-Directory, or Volume ID. 
  643.             
  644.              This  function returns the number of files found which match
  645.             the pattern specified.  The file names,  sizes,  last  modify
  646.             date  and times are returned via the variable specified.  The
  647.             file date and time are returned in "DOS format" which is good
  648.             for  sorting  purposes,  but  unreadable.   The  "stime"  and
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.             "sdate" functions have been expanded to include the file time
  656.             and date and format them as desired. 
  657.             
  658.         5.  The  "sdate"  function has been expanded to return the Julian
  659.             Day  Number  as  a  formatting  option  and  can  format  any
  660.             specified  date  as  well  as  the  file date returned by the
  661.             "findfile" function. 
  662.             
  663.         6.  The "stime" function has been expanded to be able  to  format
  664.             any  specified  time as well as the file time returned by the
  665.             "findfile" function. 
  666.             
  667.         7.  For format  arguments  greater  than  the  number  of  format
  668.             options the 'sdate' and 'stime' functions no longer terminate
  669.             execution with an error message.  The remainder  operator  is
  670.             silently used to obtain a correct formatting option. 
  671.         
  672.          ==>  QTAwk  Version 5.00, dated 02/01/91.  This version contains
  673.         several additions from the previous versions:
  674.         
  675.         1.  The character  output  functions  'putc(c)'  and  fputc(c,F)'
  676.             have  been added.  These functions are identical in operation
  677.             to the C functions of the same names.  With  the  'getc'  and
  678.             'fgetc(F)'  functions  of the previous versions, the user now
  679.             has a complete set of character I/O. 
  680.             
  681.         2.  The  built-in  variable   'ECHO_INPUT'   has   been   added. 
  682.             ECHO_INPUT  has  a  default  value  of  FALSE.  If TRUE, when
  683.             reading from the standard input file,  normally  the  console
  684.             keyboard,  the  input  is echoed to the standard output file,
  685.             normally the console display.  When the standard  input  file
  686.             is   re-directed  from  a  file,  it  is  convenient  to  set
  687.             ECHO_INPUT to FALSE to prevent echoing each  input  character
  688.             to the display. 
  689.             
  690.         3.  The  variable "QTAwk_Path" has been added.  If an environment
  691.             setting for "QTAWK" exists, QTAwk_Path is set to the value of
  692.             the  setting  upon  program initiation.  This string value is
  693.             then used in searching for input files.  The search  sequence
  694.             for files follows the the order:
  695.             
  696.             a)  If  a directory and/or path name name is specified with a
  697.                 file, then that path only is searched. 
  698.                 
  699.             b)  If no directory or  path  name  is  specified,  then  the
  700.                 current directory is searched.  If the file is not found,
  701.                 then all paths specified in QTAwk_Path are  searched  for
  702.                 the  file  in the order specified.  Multiple paths may be
  703.  
  704.  
  705.  
  706.  
  707.  
  708.  
  709.                 specified, separated by a semi-colon.  This  follows  the
  710.                 same  convention  for  specifying  multiple  paths in the
  711.                 system environment path setting "PATH". 
  712.             
  713.              The value of QTAwk_Path may be reset  at  any  time  by  the
  714.             user's utility to change the paths to be searched for desired
  715.             files to be opened for reading. 
  716.             
  717.         4.  The built-in function  'append(filename)'  has  been  added. 
  718.             Executing  this function before any output to "filename" will
  719.             cause all output to be  appended  to  the  end  of  the  file
  720.             "filename"   if  it  currently  exists.   Closing  the  file,
  721.             "filename", with the 'close' function will cancel the  effect
  722.             of 'append' for any subsequent output to that file. 
  723.             
  724.         5.  The  tagged  string  operator,  '$$',  has  been  expanded to
  725.             accept numerical expressions in the forms:
  726.             a)  $$0 --> refers to the entire string matched by  the  last
  727.                 regular expression in the pattern. 
  728.             b)  $$0.0 --> refers to the entire string matched by the last
  729.                 regular expression. 
  730.             c)  $$j  -->  refers  to  the  string  matching  the  regular
  731.                 expression  contained  in  the parenthesis set at nesting
  732.                 level 1 and count j  in  the  last  regular  expression. 
  733.                 Valid values of j are in the range 1 ≤ j ≤ 31.  Identical
  734.                 to $$1.j of the next form. 
  735.             d)  $$i.j --> refers  to  the  string  matching  the  regular
  736.                 expression  contained  in  the parenthesis set at the ith
  737.                 nesting level, jth count in the last regular expression. 
  738.                 Valid values of i and j are in the range 1 ≤ i ≤ 7, 1 ≤ j
  739.                 ≤ 31. 
  740.             e)  $$variable_name --> this form may expand into any one  of
  741.                 the  previous forms.  If the variable operated on by '$$'
  742.                 is a string or regular expression, it is first  converted
  743.                 to numeric form. 
  744.             
  745.              Thus  $$5.02,  is the string matching the regular expression
  746.             contained within the parenthesis at the fifth level  and  2nd
  747.             count. 
  748.         
  749.          ==>  QTAwk  Version 4.20, dated 10/11/90.  This version contains
  750.         three additions from the previous versions:
  751.         
  752.         1.  The  behavior  of  the  RS  predefined  variable   has   been
  753.             changed.   It  is  now  similar  to  the  behavior  of the FS
  754.             variable.  If RS is assigned a value, which when converted to
  755.             a  string  value,  is a single character in length, then that
  756.             character becomes the record separator.   If  the  string  is
  757.  
  758.  
  759.  
  760.  
  761.  
  762.  
  763.             longer  in length than a single character, then it is treated
  764.             as a regular expression.  The  string  matching  the  regular
  765.             expression  is treated as a record separator.  As for FS, the
  766.             string value is converted to the internal regular  expression
  767.             form when the assignment is made. 
  768.             
  769.         2.  Two new functions have been added:
  770.             getc()  -->  reads  a single character from the current input
  771.                 file.  The character is returned by the function. 
  772.             fgetc(file) -->  reads  a  single  character  from  the  file
  773.                 'file'.   The  character  is  returned  by the function. 
  774.             
  775.              These functions allow the user to  naturally  obtain  single
  776.             characters  from  any  file including the standard input file
  777.             (which would be the keyboard if not  redirected  or  piped). 
  778.             
  779.         3.  Error  messages  now  have  a  numerical  value  displayed in
  780.             addition to the short error message.  The error messages  are
  781.             listed  in  numerical order in the QTAwk documentation with a
  782.             short explanation of the error.  In some  cases,  an  attempt
  783.             has  been made to provide guidance as to what may have caused
  784.             the error and possible remedies.  Since  the  error  messages
  785.             are  generated at fixed points within QTAwk and may be caused
  786.             by  different   reasons   in   different   utilities   during
  787.             interpretation  or  during execution on data files, it is not
  788.             possible to list every possible reason for the display of the
  789.             error  messages.  The line number within the QTAwk utility on
  790.             which the error was discovered and the input data file record
  791.             number are provided in the error message to provide some help
  792.             to the user in attempting to ascertain the  real  reason  for
  793.             the error. 
  794.         
  795.          ==> QTAwk Version 4.10.  This version contains one addition from
  796.         the previous versions:
  797.         
  798.         1.  In previous versions, the GROUP pattern keyword could  accept
  799.             patterns  consisting  only of a regular expression constant. 
  800.             For version 4.10, The GROUP pattern keyword has been expanded
  801.             to  accept regular expression constants, string constants and
  802.             variables.  The variables are evaluated at the time the GROUP
  803.             patterns  are  first  utilized  to scan an input record.  The
  804.             value is converted  to  string  form  and  interpreted  as  a
  805.             regular expression. 
  806.             
  807.             GROUP /regular expression constant/ { actions }
  808.             GROUP "string constant" { actions }
  809.             GROUP Variable_name { actions }
  810.             
  811.  
  812.  
  813.  
  814.  
  815.  
  816.  
  817.              GROUP patterns are still converted into an internal form for
  818.             regular expressions only once, when the pattern is first used
  819.             to scan an input line.  Any variables in a GROUP pattern will
  820.             be evaluated, converted to  string  form  and  interpreted  a
  821.             regular expression. 
  822.         
  823.          ==>  QTAwk  Version  4.02.   This version contains two additions
  824.         from the previous versions:
  825.         
  826.         1.  The  command  line  argument,  double  hyphen,  "--",   stops
  827.             further scanning of the command line for options.  The double
  828.             hyphen argument is not passed to the  QTAwk  utility  in  the
  829.             ARGV array or counted in the ARGC variable.  Since QTAwk only
  830.             recognizes two command options, this has been included to  be
  831.             compatible with the latest Unix(tm) conventions. 
  832.             
  833.         2.  The  built-in  array  ENVIRON  has  been  added.   This array
  834.             contains the environment strings passed to QTAwk.  Changing a
  835.             string  in  ENVIRON  will  have  no effect on the environment
  836.             strings passed in  the  QTAwk  "system"  built-in  function. 
  837.             Environment   strings   are  set  with  the  PC/MS-DOS  "SET"
  838.             command.  The strings are of the form:
  839.             
  840.                                     name = string                        
  841.             
  842.              where the blanks on either side of the equal sign, '=',  are
  843.             optional  and depend on the particular form used in the "SET"
  844.             command.  The QTAwk utility may scan the elements of  ENVIRON
  845.             for a particular name or string as desired. 
  846.  
  847.  
  848.  
  849.  
  850.  
  851.  
  852.  
  853.  
  854.  
  855.  
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862.  
  863.  
  864.  
  865.  
  866.