View previous topic :: View next topic
|
Author |
Message |
Amolondhe007 Warnings : 1 New User
Joined: 16 Apr 2007 Posts: 49 Location: Pune
|
|
|
|
Hi,
Please let me know that Can we add AND Operator in Evaluate Function.
E.G.
Evaluate Color
When Red AND White * Here added AND Operator.
Display ' Good Combination '
When Other
Display ' No Combonation '
End-Evaluate. |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
If you had looked at the EVALUATE statement, you would have seen that AND is not valid, ALSO is the way to join..... |
|
Back to top |
|
|
Amolondhe007 Warnings : 1 New User
Joined: 16 Apr 2007 Posts: 49 Location: Pune
|
|
|
|
Ok, William.
But if we are using any numeric value like
Code: |
EVALUATE ANS
WHEN 0.00 AND +64.00
ADD +10.00 to +20.00 giving ANS.
Display 'ANS: ' ANS.
WHEN OTHER
Display 'INCORRECT VALUE'
END-EVALUATE. |
Then can it work? |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
Hi Amol,
What you're looking for is "OR" capability. The "AND" as you explain it in your ex. is impossible.
You should use:
Code: |
WHEN 0.00
WHEN +64.00
ADD +10.00 to +20.00 giving ANS |
|
|
Back to top |
|
|
Mickeydusaor
Active User
Joined: 24 May 2006 Posts: 258 Location: Salem, Oregon
|
|
|
|
EVALUATE TRUE
WHEN ANS = 0.00 OR +64.00
ADD +10.00 to +20.00 giving ANS.
Display 'ANS: ' ANS.
WHEN OTHER
Display 'INCORRECT VALUE'
END-EVALUATE. |
|
Back to top |
|
|
Ajay Baghel
Active User
Joined: 25 Apr 2007 Posts: 206 Location: Bangalore
|
|
|
|
Hi,
EVALUATE subject
WHEN object1
WHEN object2
END-EVALUATE
Datatypes of both subject and object should match. If subject is TRUE or FALSE, then object1 and object2 must be condition expressions which should evaluate to True or False. Note: These conditons can contain AND.
Thanks,
Ajay |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
Hi Ajay,
Quote: |
Note: These conditons can contain AND. |
I know you made the above correct stmt as a general comment, but it may mislead in the context of Amol's ques:
Code: |
WHEN 0.00 AND +64.00
ADD +10.00 to +20.00 giving ANS. |
"AND" cannot be both values simultaneously. |
|
Back to top |
|
|
|