Sign in to follow this  
Followers 0
muzle6074

What's wrong with this "If" statement?

4 posts in this topic

What's wrong with this "If" statement? I tried using <> and Not. I also tried using "Or" and "And" statements but none worked muttley

Can sum1 fix this?

$winStats = WinGetPos($win); 1032 * 795
If $winStats[2] <> 1032 Or $winStates[3] <> 795 Then
    MsgBox(16, "Counter", "Error validating " & $win & " window")
    Exit
EndIf

Regards.

Share this post


Link to post
Share on other sites



What's wrong with this "If" statement? I tried using <> and Not. I also tried using "Or" and "And" statements but none worked muttley

Can sum1 fix this?

$winStats = WinGetPos($win); 1032 * 795
If $winStats[2] <> 1032 Or $winStates[3] <> 795 Then
    MsgBox(16, "Counter", "Error validating " & $win & " window")
    Exit
EndIf

Regards.

First I see that the variables in the line below isn't the same:

If $winStats[2] <> 1032 Or $winStates[3] <> 795 Then

Try Change it to:

If $winStats[2] <> 1032 Or $winStats[3] <> 795 Then

See if it works then..

Regards

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

I guess this is what you want:

$winStats = WinGetPos($win); 1032 * 795
If Not ($winStats[2] = 1032 And $winStats[3] = 795) Then
    MsgBox(16, "Counter", "Error validating " & $win & " window")
    Exit
EndIf

I guess the problem in the "If" statement you provided is that the second half of the statement refers to "$winStates" instead of "$winStats"...

My answer came too late...

Edited by maroesjk

Share this post


Link to post
Share on other sites

Thanks guys, I feel like such an idiot muttley

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0