Bug with IF and complex expressions

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
adroege
Automation Wizard
Posts: 438
Joined: Tue Dec 07, 2004 7:39 pm

Bug with IF and complex expressions

Post by adroege » Wed Aug 10, 2005 4:08 pm

I think this illustrates a bug with complex expressions. The second If statement SHOULD be true, but the code just skips over it. What is going on here!!!!!! This was run in version 7.3.11.4 registered version.


Let>Version=5.0
Let>pixcol=2204193

If>{(%Version%="4.6") AND (%pixcol%="0")}
LClick
MessageModal>4.6 Click!
Endif
If>{(%Version%="5.0") AND (%pixcol%="2204193")}
LClick
MessageModal>5.0 Click!
Endif
MessageModal>Nothing happened!


Thanks!

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Wed Aug 10, 2005 4:41 pm

Corrected

It's not a bug. MS doesn't need the quotes around numbers in complex expression, only strings (thank you JRL for the post below)

So I think you'll find this to be OK.

Let>Version=5.0
Let>pixcol=2204193

If>{(%Version%=4.6) AND (%pixcol%=0)}
LClick
MessageModal>4.6 Click!
Endif
If>{(%Version%=5.0) AND (%pixcol%=2204193)}
LClick
MessageModal>5.0 Click!
Endif
MessageModal>See, it works!
Last edited by Me_again on Wed Aug 10, 2005 5:43 pm, edited 1 time in total.

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

Post by JRL » Wed Aug 10, 2005 4:54 pm

Sorry to interrupt.
MS doesn't need the quotes around the strings
More specifically MS doesn't need quotes around numbers. It does need quotes around text strings used in complex expressions. Here is the sample from the help files as an illustration.

//complex expression:
IF>{(%a% = 5) AND (%VarA% = "allen")}
//do something
ELSE
//do something else
ENDIF


Hope this is useful,
Dick

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Wed Aug 10, 2005 5:41 pm

You're right, I'm wrong, a little knowledge is a dangerous thing :oops:

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