brodie28 Posted August 24, 2006 Posted August 24, 2006 Msgbox(0, "title", $nag) Msgbox(0, "title", $up) If $nag > $up then Do Msgbox(0, "title", "Flag 5") $o_Form = _IEFormGetCollection($o_IE, 1) $uupgrade = _IEFormElementGetObjByName ( $o_Form, "unitupgrade") $uupgrade.click _IELoadWait ($o_IE) until $up > $nag endIf The first mesage box comes up with 2237414 and the second with 615000. This shows that $nag is clearly higher than $up, however the message box with flag 5 never comes up, and none of the other code gets executed. I have no idea why this if statement seems to not be working. I also tried this with a while/wend loop and it never got executed either.
MHz Posted August 24, 2006 Posted August 24, 2006 Perhaps you are evaluating a string? ; True or False $string = True If $string Then $nag = '2237414' $up = '615000' MsgBox(0, '', $nag & @CRLF & $up) Else $nag = 2237414 $up = 615000 MsgBox(0, '', $nag & @CRLF & $up) EndIf If $nag > $up then MsgBox(0, '', '$nag is larger') Else MsgBox(0, '', '$nag is Smaller') EndIf
Moderators SmOke_N Posted August 24, 2006 Moderators Posted August 24, 2006 Is $nag and $up actually a string? Try this: If Number($nag) > Number($up) Then Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now