Chalz,

Instead of using AND and OR, the better REBOL way is ALL and ANY.  Try this:

if all [2 = length? p: parse filename "." find pick p 2 "htm"][...]

I left off the "not none?" in front of the 'find because 'none 
automatically gets evaluated as 'false but a successful 'find (which 
returns an index into the series) is evaluated as 'true.

You can embed ANYs and ALLs inside of each other if you have a more complex 
statement.  I do it all the time.  There are other neat uses for ANY and 
ALL (in particular), but I hope you get the point for this example.

Later!

-Bo
Lechnowsky Technical Consulting
REBOL VAR

At 11:51 PM 7/1/02 -0400, you wrote:
>    Here's a little question.  Perhaps I've been spoiled in other 
> languages, but
>this is starting to frustrate me.  I have something like:
>    if THIS and THAT []
>Thing is, if THIS is false, it continues to evaluate THAT anyways.  What's the
>point?  The result is obviously false anyways.  I'm working on a case like 
>this
>(perhaps someone can provide a more elegant solution):
>    if (2 = length? p: parse filename ".") AND (not none? find pick p 2 "htm")
>[ ...
>Obviously, if the first condition is false, I want it to quit without
>evaluating the second condition.  Help?  Any way I can continue doing this in
>the same line, and without worrying about throwing and catching errors?  Or am
>I more or less doomed to yet another nested if?  Thanks folks.
>
>--Charles
>
>--
>To unsubscribe from this list, please send an email to
>[EMAIL PROTECTED] with "unsubscribe" in the
>subject, without the quotes.

-- 
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the 
subject, without the quotes.

Reply via email to