UNTIL
[1/2] from: ptretter:charter at: 9-Feb-2004 19:46
Ok. I know alot of guys are new to this list so I thought I would post something that
was confusing to me when I started with REBOL. Ever look at the help for 'until:
>> help until
USAGE:
UNTIL block
DESCRIPTION:
Evaluates a block until it is TRUE.
UNTIL is a native value.
ARGUMENTS:
block -- (Type: block)
So what does this actually mean. Does this mean we return a value and what if we have
100 lines of code in 'until evaluation block. This was confusing for me having never
really did programming before REBOL. So the easy answer is the last value that is TRUE
will end the loop. Try yourself by just playing with values in the until eval block.
until [true true false]
until [false true true]
until [true false]
until [true true]
As you can see whatever the last item in the block evaluates to determines the outcome
of the loop.
Hope this helps as I was a bit confused at how to use this great function early on.
Paul Tretter
[2/2] from: mail::defiantpc::com at: 9-Feb-2004 23:04
Thanks for the tip, I hope you don't mind that I copied it to the forum
under Code Tips and Advice at reboltalk.com.
----- Original Message -----
From: "Paul Tretter" <[ptretter--charter--net]>
To: <[rebol-list--rebol--com]>
Sent: Monday, February 09, 2004 7:46 PM
Subject: [REBOL] UNTIL
> Ok. I know alot of guys are new to this list so I thought I would post
something that was confusing to me when I started with REBOL. Ever look at
the help for 'until:
> >> help until
> USAGE:
<<quoted lines omitted: 5>>
> block -- (Type: block)
> So what does this actually mean. Does this mean we return a value and
what if we have 100 lines of code in 'until evaluation block. This was
confusing for me having never really did programming before REBOL. So the
easy answer is the last value that is TRUE will end the loop. Try yourself
by just playing with values in the until eval block.
Notes
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted