If statement help

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
diamondrail
Junior Coder
Posts: 20
Joined: Wed Jul 31, 2019 9:38 am

If statement help

Post by diamondrail » Tue Feb 04, 2020 12:19 am

I am having an issue with this if statement.

Can anyone tell me where I am going wrong with the syntax and give me a clear path forward?

the script:

Let>a=5
let>b=5


IF>{(%a% = 5) AND (%b% = "2")}
MessageModal>a is 5 and b is 2, no winner
Else
IF >{(%a% = 5) AND (%b% = "3")}
MessageModal> winner
ELSE
MessageModal> no winner
ENDIF
ENDIF


---


Problem: When I run it right now, the messagemodal shows "winner" when it should be showing "no winner" since
a = 5 and b = 5. The two first if statements are NOT satisfied.

Where am I going wrong?

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

Re: If statement help

Post by JRL » Tue Feb 04, 2020 4:30 am

You have a space between the second "If" and its affiliated ">". Basically, making the line a remark that is ignored.

diamondrail
Junior Coder
Posts: 20
Joined: Wed Jul 31, 2019 9:38 am

Re: If statement help

Post by diamondrail » Tue Feb 04, 2020 4:19 pm

JRL wrote:
Tue Feb 04, 2020 4:30 am
You have a space between the second "If" and its affiliated ">". Basically, making the line a remark that is ignored.
GOOD CATCH. Thanks!

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