Jump to content

Quick IfThen Question


Recommended Posts

The Problem: Sometimes the sript I wrote can run astray. I'm trying to solve this by making it check to see if it is at the correct place before it executes again. [it's in a while statement.]

Ok... I want an If Then statement that functions like this:

If [window is not active] Then
   Do this
Else
   Do this
EndIf

but I can't figure out how to make that first expression... an expression.

Edited by JuggaloZeke
Link to comment
Share on other sites

Even something like

If [WinWaitActive exp[b][/b]ression] Then
   Do This
Else
   Do This
EndIf

Would work but I don't know how to get the WinWaitActive to work with If.

<{POST_SNAPBACK}>

WinWaitActive returns 1 for success and 0 for failure

Therefore:

If WinWaitActive(....) = 1 Then
  ; do something with active window
Else
  ; window not found
EndIf

Check help file for more info on WinWaitActive.

Edited by pacman
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...