If statements with complex expressions

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
[email protected]
Newbie
Posts: 4
Joined: Tue Dec 09, 2008 2:27 am

If statements with complex expressions

Post by [email protected] » Tue Dec 09, 2008 2:38 am

I can not seem to get If statements with an OR to work correctly. Here is a sample:
Let>a=one
Let>b=two
If>((%a%="one") OR (%b%="one"))
MessageModal>"A or B is one.
else
MessageModal>"Neither A or B is one."
EndIf
End

The message is always "Neither A or B is one." always appears. Should be "A or B is one.".
Thanks,
Gerry

User avatar
JRL
Automation Wizard
Posts: 3518
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Tue Dec 09, 2008 4:07 am

Your outermost parenthesis needs to be braces.

Code: Select all

Let>a=one
Let>b=two
If>{(%a%="one") OR (%b%="one")}
MessageModal>"A or B is one.
else
MessageModal>"Neither A or B is one."
EndIf 

[email protected]
Newbie
Posts: 4
Joined: Tue Dec 09, 2008 2:27 am

Post by [email protected] » Tue Dec 09, 2008 10:08 pm

Thank you - I must need glasses.

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Tue Dec 09, 2008 11:04 pm

Don't need full glasses, just new frames.

Old frames: (( )---( ))

New Frames: {( )---( )}
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Post by jpuziano » Wed Dec 10, 2008 1:15 am

Good one Bob... :lol:

Take care
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts