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

  1. ;
  2. ;   NOTE:  A quick-reference summary of POM commands appears in QUICKREF.POM
  3. ;
  4. ;-------------------------------------------------------------------------------
  5. ;
  6. ;   Restrict the lines we'll accept
  7. ;
  8. ACCEPT   $FLINE[58 60] = "IBM"
  9. ACCEPT   $FLINE[58 60] = "MAC"
  10. ;
  11. ;   Pad out description, with spaces, to 40 characters
  12. ;   We'll also modify the string -PC to read -IBMPC
  13. ;   Note the trailing space after PC to ensure it's at the end of the string
  14. ;
  15. SET      descrip       = $FLINE[19 49]
  16. INSERT   descrip         "<PC "  "IBM"
  17. PAD      descrip         "R"   " "   "40"
  18. ;
  19. ;   Make quantity only 2 characters wide (maximum would therefore be 99)
  20. ;
  21. SET      qty           = $FLINE[63 66]
  22. TRIM     qty             "A"   " "
  23. PAD      qty             "L"   " "  "2"
  24. ;
  25. ;   Take only the last three digits of the invoice number
  26. ;
  27. SET      inv           = $FLINE[14 16]
  28. ;
  29. ;   Detect minus sign and set price accordingly
  30. ;
  31. SET      price         = $FLINE[70 76]
  32. TRIM     price           "A" " "
  33. IF       $FLINE[77]    = "-" THEN minus = "-" ELSE ""
  34. INSERT   price           "L" minus
  35. PAD      price           "L" " " "7"
  36. INSERT   price           "L" "$"
  37. ;
  38. ;   Set other fields; note use of uppercase version of $FLINE ($FLUPC) for type
  39. ;
  40. SET      itemnum       = $FLINE[01 07]
  41. SET      type          = $FLUPC[51 55]
  42. SET      cat           = $FLINE[58 60]
  43. ;
  44. ;   Set output as follows:
  45. ;   Invoice, Item, Type (in uppercase), Category
  46. ;   Description, Quantity, Unit price
  47. ;
  48. OUT      |{inv} {itemnum} {type} {cat}
  49. OUTEND   | {descrip} {qty}    {price}
  50.