home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / OL.LZH / PROCS.LZH / TAB2REC.ICN < prev    next >
Text File  |  1991-09-05  |  769b  |  35 lines

  1. ############################################################################
  2. #
  3. #    Name:    tab2rec.icn
  4. #
  5. #    Title:    Insert tab-separated strings in record fields
  6. #
  7. #    Author:    Ralph E. Griswold
  8. #
  9. #    Date:    September 2, 1991
  10. #
  11. ############################################################################
  12. #
  13. #     This procedure to takes tab-separated strings and inserts them
  14. #  into fields of a record.
  15. #
  16. #  Vertical tabs in strings are converted to carriage returns.
  17. #
  18. #  (Works for lists too.)
  19. #
  20. ############################################################################
  21.  
  22. procedure tab2rec(s,x)
  23.    local i
  24.  
  25.    i := 0
  26.  
  27.    s ? {
  28.       while x[i +:= 1] := map(tab(upto('\t') | 0), "\v", "\n") do
  29.          move(1) | break
  30.       }
  31.  
  32.    return
  33.  
  34. end
  35.