Hey guys,
I've a quick question about the "if" again..
this is my code
if vRS is empty or begins with "revdber"
then
answer "please check your username and password." && vRS
exit to top
else
answer "connected."
end if
livecode says
Script compile error:
Error description: Expression: double binary operator
anybody knows what's wrong with my code ?
Another if question
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: Another if question
Hi Nibor,
you always need to evaluate the COMPLETE expression!
Parentheses not neccessary, but they won't hurt and will show you how Livecode will see the situation
## Your script:
...
if (vRS is empty) or (begins with "revdber")
## So Livecode is asking itself: WHAT the heck begins with "revdber", finds no answer and finally complains!
...
## Correct:
if (vRS is empty) or (vRS begins with "revdber")
...
Livecode will evaluate both expressions separately first: (vRS is empty) and (vRS begins with "revdber")
and then does the comparison of the two resulting Boolean values (true/false) with OR or AND.
Best
Klaus
you always need to evaluate the COMPLETE expression!
Parentheses not neccessary, but they won't hurt and will show you how Livecode will see the situation

## Your script:
...
if (vRS is empty) or (begins with "revdber")
## So Livecode is asking itself: WHAT the heck begins with "revdber", finds no answer and finally complains!

...
## Correct:
if (vRS is empty) or (vRS begins with "revdber")
...
Livecode will evaluate both expressions separately first: (vRS is empty) and (vRS begins with "revdber")
and then does the comparison of the two resulting Boolean values (true/false) with OR or AND.
Best
Klaus