diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2013-01-27 23:51:56 +0000 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2013-01-27 23:51:56 +0000 |
commit | 6ab0c0f5bf14ed9c15370407b9ee7e0b4b089ae1 (patch) | |
tree | 926065cf45450116098db664e3c61dced9e1f21a /ipl/procs/tab2rec.icn | |
download | icon-6ab0c0f5bf14ed9c15370407b9ee7e0b4b089ae1.tar.gz |
Initial upstream version 9.4.3upstream/9.4.3
Diffstat (limited to 'ipl/procs/tab2rec.icn')
-rw-r--r-- | ipl/procs/tab2rec.icn | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/ipl/procs/tab2rec.icn b/ipl/procs/tab2rec.icn new file mode 100644 index 0000000..9a59e93 --- /dev/null +++ b/ipl/procs/tab2rec.icn @@ -0,0 +1,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 |