D-oh! Late Friday is probably not a good time for hasty conclusions. :/
(Not that any other time is much better....)
I wrote that parsing
> john,brown,ca,95014
with
> setvar first_name word( line,,1,x)
> setvar last_name word( line,,1,x,x )
> setvar state word( line,,1,x,x )
> setvar zip word( line,,1,x,x )
worked. It doesn't, as was pointed out to me in a private email.
What happened was that I parsed
setvar line "this is a test"
with the above word() expressions and THAT worked, but only because
leading spaces are skipped while other leading delimiters are not.
(The space between "this" and "is" becomes a "leading" space for
the second invocation of word() in the code above.)
So, in the example shown, 'x' never gets beyond the first comma,
and all fields after 'first_name' are set to the empty string "".
The following works fine:
> setvar first_name word( line,,1,x)
> setvar last_name word( line,,1,x,x+1 )
> setvar state word( line,,1,x,x+1 )
> setvar zip word( line,,1,x,x+1 )
Many thanks to Jeff "The Man" Vance for bringing this to my attention. :)
--Glenn "hip deep in CI functions and on-the-fly command files" Cole
Software al dente, Inc.
[log in to unmask]
.......................................................................
Item Subject: cc:Mail Text
|