Page 1 of 1

Logical operator isn't operating!

Posted: Sun Jan 18, 2009 5:02 am
by Mistfall
Hello kind and helpful Rev users,

I'm trying to use the operator "greater than or equal to" in a script as follows:

put the first character of line x of field "theField" into whichChar
put charToNum(whichChar) into whatCase
if whatCase is >= 65 then
put whatCase into message

I get a compilation error at line (if whatCase...then) (Expression: double binary operator) near ">=", near character (the space before the 65).

What does "double binary operator" mean? (I tried compiling with only a ">" and still got the same error.) Where did I go wrong?

Thank you for any help!

Posted: Sun Jan 18, 2009 7:30 am
by Obleo
I had a similar issue with this once, and from my notes I fixed it by putting the value between double quotes.

like this; if whatCase is >= "65" then put whatCase into message

I did not try your script but you may want to try this and see if that fixes it.

good luck

Posted: Sun Jan 18, 2009 7:39 am
by Obleo
Actually I did just try your script . Remove the term "is" in front of the operator ">="

so that line would read this :

if whatCase >= 65 then put whatCase into message.

It work with and without the double qoutes by just remove the term "is"

hope that helps.

Aha!

Posted: Sun Jan 18, 2009 3:22 pm
by Mistfall
Thank you, Obleo!

I appreciate that!

Posted: Sun Jan 18, 2009 3:57 pm
by Lynn P.
Mistfall wrote: What does "double binary operator" mean?
The word "is" in Rev is a synonym for "=" allowing you to use English in an expression such as:
if x is 34 then
or
if x = 34 then
so you got a "double binary operator" error from Rev because you're expression:
if whatCase is >= 65 then put whatCase into message...
had essentially both "=" and ">=" (two binary operators)
Rev saw it as:
if whatCase = >= 65 then put whatCase into message...
When reading >=, the word "is" in implied but not included in the code, as it is in most other programming languages.
In Rev, you can use "=" or in your case ">=" OR "is" but not both.

:)