home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / simtel / cpmug / cpmug004.ark / FDL < prev    next >
Encoding:
Text File  |  1984-04-29  |  5.4 KB  |  164 lines

  1. @{ps||Format Destruction List  3/8/77|}
  2.  
  3. @{ns|/|@@{pk|0d0a}}`                set the string "/" to RETURN LINE-FEED`
  4.  
  5. @{ns|NFL|{`                               Next File List`
  6.     @{ns|files|@@{rs|@@{/}FILES: }}
  7.     @{ss|files| |  }@{ns|files|@@{files|,|,},}`             file list can be blank or comma delimited`
  8.     @{NF}
  9. }}
  10.  
  11. @{ns|NF|{`                      Next File`
  12.     @{in|files|,|
  13.         {
  14.             @{ns|source|@@{@in}}
  15.             @{ps|||Source: @@{source}   }
  16.             @{of|@@{source}||`                    open the current input file`
  17.                 {
  18.                     @{ns|b|}`                        b holds one record of the input file`
  19.                     @{rf|b|1}
  20.                     @{ns|sourcern|@@{rn}}
  21.                     @{ns|sink|@@{source}f}`             NOTE: file sequence number must be less than 10`
  22.                     @{of|@@{sink}||{@{df}}}`             destroy a pre-existing output file`
  23.                     @{mf|@@{sink}||{@{ps|FULL DISKETTE.|}@{ex}}}
  24.                     @{ns|sinkrn|0}`                   preset the next output record number`
  25.                     @{ps|Sink: @@{sink}||}
  26.                     @{ns|f|}`       f is formatted output`
  27.                     @{GD}
  28.                 }|
  29.                 {@{ps|No such file.|}@{NF}}
  30.             }
  31.         }|
  32.         {@{NFL}}
  33.     }
  34. }}
  35.  
  36. @{ns|GD|{`                                      Get Date of destruction from first line of file`
  37.     @{in|b|@@{/}|
  38.         {
  39.             @{ns|d-date|@@{@in}}
  40.             @{NL}
  41.         }|
  42.         {@{ps|The input file is empty.|}@{NF}}
  43.     }
  44. }}
  45.  
  46. @{ns|NL|{`                                  Next Line.  format:`
  47.     @{in|b|@@{/}|`                     <prefix>_<number><revision>;<copy><series>`
  48.         {`                                    where <prefix> may be "." or "._"`
  49.             @{ns|l|@@{@in}}`                       and <revision> may be null or "_rv_<integer>`
  50.             @{ns|d|@@{in|l|;}}`                           ("_" is a space)`
  51.             @{eq|@@{d}|/|`               test for new page  -  "/" in a line`
  52.                 {
  53.                     @{ps||||@@{pk|0c}|||@@{sink}||}
  54.                 }|
  55.                 {
  56.                     @{ND}
  57.                     @{NCL}
  58.                 }
  59.             }
  60.         }|
  61.         {@{READ}}`                      no more full lines in b`
  62.     }
  63.     @{NL}
  64. }}
  65.  
  66. @{ns|READ|{`                               Read the next record. (More output than input.)`
  67.     @{ns|b|@@{@in}}`                              save the number of the next record to be written`
  68.     @{cf}`                          and close the output file`
  69.     @{of|@@{source}|@@{sourcern}}`                       open the source and set the next input record number`
  70.     @{rf|b|1||{@{ps|READ ERROR.|}@{ex}}}`                  read the next record`
  71.     @{ns|sourcern|@@{rn}}`                  save the number of the next input record`
  72.     @{cf}`                           and close the input file`
  73.     @{of|@@{sink}|@@{sinkrn}}`                 reopen the output file where it was`
  74. }}
  75.  
  76. @{ns|ND|{`                          Next Document (or end)`
  77.     @{eq|@@{gc|d|5}|\end\|
  78.         {@{end}}|
  79.         {
  80.             @{cr|d}
  81.             @{eq|@@{gc|d|1}|.|
  82.                 {@{ns|d|@@{p} @@{in|d}}}|
  83.                 {@{cr|d}}
  84.             }
  85.             @{ns|p|@@{in|d| }}@{ss|p|-|/}
  86.             @{ns|n|@@{in|d| }}@{ss|n|-|/|^|=|.}
  87.             @{ns|x|@@{in|d}}@{eq|@@{x}|||{@{RF}}}`            construct the reference field`
  88.             @{eq|@@{gc|p|3}|aaa|{@{AAA}}}
  89.             @{ns|p..|@@{p}              }`               document prefix will be left justified in columns 1-14`
  90.             @{ns|n..|@@{n}              }`                document number will be left justified in 15-28`
  91.             @{ns|d|@@{gc|p..|14}@@{gc|n..|14}}`               assemble prefix, number`
  92.         }
  93.     }
  94. }}
  95.  
  96. @{ns|RF|{`                               reference field`
  97.     @{ss|x|draft|rev|vol|i|ii|iii|iv}
  98.     @{ns|x| @@{x|dr|rv|vl|1|2|3|4}}
  99. }}
  100.  
  101. @{ns|AAA|{`                         special checks for prints`
  102.     @{ns|n|@@{in|p}@@{n}}@{ns|p|@@{@gc}}`           handle, for example. aaa75 123456`
  103.     @{ns|n1|@@{gc|n|8}}
  104.     @{ns|q1|@@{gc|n|1}|q2|@@{gc|n|1}}
  105.     @{eq|@@{in|n}|||{@{ps|The following print number has been truncated.|}}}
  106.     @{eq|@@{q1}|o|
  107.         {
  108.             @{ns|q1|0}
  109.             @{eq|@@{q2}|o|{@{ns|q2|0}}}`             change revision "oo" to "00" and "oa" to "0a"`
  110.  
  111.         }|
  112.         {
  113.             @{eq|@@{q2}|0|{@{ns|q2|0}}}`               also change "a0" to "ao"`
  114.  
  115.         }
  116.     }
  117.     @{ns|n|@@{n1}@@{q1}@@{q2}}`            reassemble the print number`
  118. }}
  119.  
  120. @{ns|p1|       |p2|      |p3|     |p4|    |p5|   |p6|  |p7| |p8|}`    pad for eight column field`
  121.  
  122. @{ns|NCL|{`                          Next Lopy Loop`
  123.     @{ns|c|@@{in|l|;}}
  124.     @{eq|@@{c}|||{
  125.         @{NC}@{NCL}
  126.     }}
  127. }}
  128.  
  129. @{ns|NC|{`                            Next Copy`
  130.     @{ge|@@{gc|c}|5|`                       assume no series or foreign number if > 5 chars.`
  131.         {@{ns|c|@@{c}@@{p@@{gc|c}}}}|`       left justify in one eight column field`
  132.         {
  133.             @{ns|c-n|@@{c}}@{ss|c-n|/|a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z}`  copy number: remove letters`
  134.             @{ns|c-s|@@{c}}@{ss|c-s|/|0|1|2|3|4|5|6|7|8|9}`    copy series: remove digits`
  135.             @{ns|c|@@{c-n}@@{c@@{gc|c-n}}@@{c-s}@@{c@@{gc|c-s}}}`    left justify in two four column fields`
  136.         }
  137.     }
  138.     @{ns|r|@@{d} s@@{c}copd  @@{d-date}@@{x}}`                assemble the document`
  139.     @{ps|@@{r}||}
  140.     @{ns|f|@@{in|f}@@{r}@@{/}}`                append to the unwritten part of the string f`
  141.     @{wf|f|||{@{ps|WRITE ERROR.|}@{end}}}`                write it to the output file buffer`
  142.     @{ns|sinkrn|@@{rn}}`                       and save the next output record number`
  143.     @{ns|#d|@@{ad|@@{#d}|1}}
  144. }}
  145.  
  146. @{ns|c0|    |c1|   |c2|  |c3| |c4|}`                   pad for four column fields`
  147.  
  148. @{ns|end|{
  149.     @{ns|f|@@{in|f}end of file.  @@{#d} documents in @@{sink}@@{/}}
  150.     @{wf|f|@@{pk|1a}||{@{ps|WRITE ERROR!|}}}
  151.     @{cf||{@{ps|CLOSE ERROR!|}}}
  152.     @{ns|#df|@@{in|d|,}}
  153.     @{ps||End of file. @@{#df} documents in @@{in|d}|}
  154.     @{eq|@@{#d}|@@{#df}||{@{ps|ERROR: found @@{#d} documents.|}}}
  155.     @{NF}
  156. }}
  157.  
  158. @{dd|#d}
  159.  
  160. @{eq|@@{fn}||`                                   see if this program was loaded by "cdl"`
  161.     {@{NFL}}|
  162.     {@{ns|files|@@{fn},}@{NF}}
  163. }
  164.