Eric,
Take a look at chapter 15 of the Users Guide
(http://rebol.com/docs/core23/rebolcore.html).
Use 'some' to continually read the input.
Rebol parse is more verbose than regexps (and by the looks of it, Rexx parse)
but it's not too bad. Here's an example:
----------------------------
input-line: "ghi 22 abc hello"
v1: v2: v2: none
blk: parse input-line none ; convert to block form first
parse blk [some[
"abc" set v1 string!
| "def" set v2 string!
| "ghi" set v3 string!
]]
print [v1 v2 v3] ; hello none 22
----------------------------
If your input format is fixed then you won't need 'some' and this might work
for you:
----------------------------
input-line: "abc hello def true ghi 22"
blk: parse input-line none
parse blk [ "abc" set v1 string! "def" set v2 string! "ghi" set v3 string! ]
print [v1 v2 v3]
----------------------------
-Karl
On Saturday 08 January 2005 13:04, Eric Haddix wrote:
> I'm an old school Amiga programmer(which probably means I'm among many
> old friends) and was especially fond of Arexx. Well that thought brought
> me to this post...
>
> The parse command seems to need improvement unless I'm not understanding
> it and I think that a great place to start might be by looking at what
> Arexx does. For example. I have several projects that require a single
> input line to be parsed into several variables. If I'm understanding
> Rebol's parse command, it can only do one variable at a time, Arexx did
> them until you were satisfied...so instead of multiple or recursive
> parse commands you could do "parse input "abc" variable1 "def" variable2
> "ghi" variable3 "jkl" " It's as simple as that for the most part. You
> can vary how the delimiters work with wildcard functions like "abc#?def"
> which means that there are some characters between 'c' and 'd' that are
> unknown in length. It's been a while since I used Arexx so forgive me if
> my syntax is off a bit.
>
> Anyway, if this is possible with a single line, please show me an
> example since the one on the language dictionary seems very limited. And
> if it isn't possible currently, what would be necessary to make it
> possible?
>
> Eric
--
To unsubscribe from the list, just send an email to rebol-request
at rebol.com with unsubscribe as the subject.