home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / parsomat.zip / exampl14.pom < prev    next >
Text File  |  2001-07-15  |  1KB  |  50 lines

  1. ;
  2. ;   Ignore the header line
  3. ;
  4. IGNORE   $FLINE[3 8] = "ORDER#"
  5. ;
  6. ;   Everything else in the file is handled below
  7. ;
  8. BEGIN $FLINE[5 8] <> "    "
  9.   ;
  10.   ;   This is the start of a customer record
  11.   ;
  12.   SET      custcode = $FLINE[10 15]
  13.   TRIM     custcode "B" " "
  14.   SET      custname = $FLINE[17 47]
  15.   TRIM     custname "B" " "
  16.   ;
  17.   ;   Output two linefeeds (except at the start of the report)
  18.   ;
  19.   OUTEND   leadlf = "Y" |
  20.   OUTEND   leadlf = "Y" |
  21.   SET      leadlf = "Y"
  22.   ;
  23.   ;   Output customer name and customer code
  24.   ;
  25.   APPEND   title custname " (" custcode ")"
  26.   SETLEN   tlen  title
  27.   SET      uline = ""
  28.   PAD      uline "L" "-" tlen
  29.   OUTEND   |{custname} ({custcode})
  30.   OUTEND   |{uline}
  31.   ;
  32.   ;   Skip the header line
  33.   ;
  34.   READNEXT
  35. ELSE
  36.   ;
  37.   ;   This is the start of a product information line
  38.   ;   Extract the product code and (on the next line) the product name
  39.   ;
  40.   SET      prodcode = $FLINE[10 19]
  41.   READNEXT
  42.   SET      prodname = $FLINE[10 60]
  43.   TRIM     prodname "B" " "
  44.   ;
  45.   ;   Output this item if the code doesn't contain "-30-"
  46.   ;
  47.   OUTEND   prodcode ~ "-30-" |{prodcode} {prodname}
  48. END
  49.  
  50.