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!
Bug with IF and complex expressions
Moderators: Dorian (MJT support), JRL
-
- Automation Wizard
- Posts: 1101
- Joined: Fri Jan 07, 2005 5:55 pm
- Location: Somewhere else on the planet
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!
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.
Sorry to interrupt.
//complex expression:
IF>{(%a% = 5) AND (%VarA% = "allen")}
//do something
ELSE
//do something else
ENDIF
Hope this is useful,
Dick
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.MS doesn't need the quotes around the strings
//complex expression:
IF>{(%a% = 5) AND (%VarA% = "allen")}
//do something
ELSE
//do something else
ENDIF
Hope this is useful,
Dick