summaryrefslogtreecommitdiff
path: root/ipl/procs/tab2rec.icn
blob: 9a59e93b922b65175acd5f1e2b338a5750d84ebc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
############################################################################
#
#	File:     tab2rec.icn
#
#	Subject:  Procedure to put tab-separated strings in records
#
#	Author:   Ralph E. Griswold
#
#	Date:     July 6, 2002
#
############################################################################
#
#   This file is in the public domain.
#
############################################################################
#
#     This procedure to takes tab-separated strings and inserts them
#  into fields of a record.
#
#  Vertical tabs in strings are converted to carriage returns.
#
#  (Works for lists too.)
#
############################################################################

procedure tab2rec(s, rec)
   local i

   i := 0

   s ? {
      while rec[i +:= 1] := map(tab(upto('\t') | 0), "\v", "\n") do
         move(1) | break
      }

   return

end