Jump to content

What's wrong with this "If" statement?


Recommended Posts

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.

Link to comment
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

Link to comment
Share on other sites

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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...