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

  1. PROLOGUE
  2.   ;
  3.   ;   Read the file 20 bytes at a time
  4.   ;
  5.   CHOP    1 20
  6.   ;
  7.   ;   Set up the maps
  8.   ;
  9.   MAPFILE "BIN2CODE.MPF" "CODE"
  10.   MAPFILE "BIN2CHAR.MPF" "CHAR"
  11.   ;
  12.   ;   Programming Tip:  The CHOP and MAPFILE commands do not have to go in
  13.   ;   a PROLOGUE section.  Parse-O-Matic is designed to ignore commands that
  14.   ;   have lost their relevance.  For example, the MAPFILE data is not read
  15.   ;   in repeatedly if you place it in the regular POM code; Parse-O-Matic
  16.   ;   checks first to see if it already has the map.  However, if you only
  17.   ;   plan to do something once at the very beginning of a parsing job, it
  18.   ;   is good "programming style" to place it in a PROLOGUE, even if it
  19.   ;   only saves you a few hundredths of a second in processing time.
  20.   ;
  21. END
  22. ;
  23. ;   Pad out the data if we have less than 20 bytes
  24. ;
  25. SETLEN  data_len $FLINE
  26. BEGIN   data_len <> "20"
  27.   PAD     $FLINE "R" #0 "20"
  28. END
  29. ;
  30. ;   Make a copy of the data
  31. ;
  32. SET     x = $FLINE
  33. ;
  34. ;   Remap the strings
  35. ;
  36. REMAP   $FLINE "CODE"
  37. REMAP   x      "CHAR"
  38. ;
  39. ;   Output
  40. ;
  41. OUTEND  |{$FLINE}{x}
  42.