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

  1. ;
  2. ;   CHOP up fixed-length record (i.e. no carriage returns or linefeeds)
  3. ;
  4. CHOP     1-123
  5. ;
  6. ;   Extract the fields
  7. ;
  8. SET      First     = $FLINE[  1  12]
  9. SET      LastName  = $FLINE[ 13  25]
  10. SET      Street    = $FLINE[ 26  46]
  11. SET      Phone     = $FLINE[ 47  59]
  12. SET      Job       = $FLINE[ 60  84]
  13. SET      Comments  = $FLINE[ 85 119]
  14. SET      Rating    = $FLINE[120 121]
  15. ;
  16. ;   Remove surrounding spaces
  17. ;
  18. TRIM     First      "B"   " "
  19. TRIM     LastName   "B"   " "
  20. TRIM     Street     "B"   " "
  21. TRIM     Phone      "B"   " "
  22. TRIM     Job        "B"   " "
  23. TRIM     Comments   "B"   " "
  24. TRIM     Rating     "B"   " "
  25. ;
  26. ;   Ignore any garbage bytes at end of file
  27. ;
  28. IF       Rating = "" THEN Okay = "N" ELSE "Y"
  29. ;
  30. ;   Build output line
  31. ;
  32. OUT      Okay = "Y" |"{First}","{LastName}","{Street}","{Phone}",
  33. OUTEND   Okay = "Y" |"{Job}","{Comments}",{Rating}
  34.