if/then with and/or

Yennie at aol.com Yennie at aol.com
Fri Mar 15 22:35:01 EST 2002


<< if var1 is "goody" and var2 is "nope" and var3 is "hello" then
    doSomething
end if >>

I think you'll find parentheses solve your problem- although "and"s maybe 
should work anyway, "or"s are downright ambiguous without them.
So... try this (or some variation):
This is the heavy version, but it's the most clear, IMHO.

if ( ((var1 is "goody") and (var2 is "nope")) and (var3 is "hello") ) then
    doSomething
end if

You could certainly get away with simpler versions such as:

if (var1 is "goody" and var2 is "nope") and (var3 is "hello") then
    doSomething
end if

HTH,
Brian




More information about the metacard mailing list