Jump to content

Recommended Posts

Posted

If Else statement?

If 1 = 1 Then
   ;First outcome
Else
   ;Second outcome
EndIf

?

"I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.
Posted

It's going to be and If...then...else statement; but how? What's the trigger? You can't use WinWaitActive as, like I stated above, what if I get the alternate outcome: AutoIT locks waiting for the other dialog.

I'm pretty sure this is a pretty standard sort of situation but my searches thru the forum haven't harvested anything that touches on this directly.

Sean Shrum :: http://www.shrum.net

All my published AU3-based apps and utilities

'Make it idiot-proof, and someone will make a better idiot'

 

Posted

Are there static colors?

While PixelGetColor(x, y) = Color

Sleep(100)

WEnd

"I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.
Posted

How about WinActive as the trigger? I've got a Case statement that makes a choice on what function to call depending on any of 16 different windows that are active at the time that I call the choice function with a hotkey. That way I can use just one hotkey and it does different things depending on what window has the focus.

I'm sure you could use something similar.

Posted (edited)

I've got a Case statement that makes a choice on what function to call depending on any of 16 different windows

I've updated the code a bit to use this idea. Can you look at the snippet below and see if it looks right in regards to the Select statement using WinActive.

While Not $done
    Select
        case WinActive("", "")
        ; <YOUR CODE HERE>
        case WinActive("", "")
        ; <YOUR CODE HERE>
        case WinActive("", "")
        ; <YOUR CODE HERE>
        case WinActive("", "")
        ; <YOUR CODE HERE>
        case WinActive("", ""); this should be the final install dialog
        ; <YOUR CODE HERE>
            $done = 1
        case Else    
        ; <YOUR CODE HERE>            
    EndSelect    
WEnd

TIA

Edited by sshrum

Sean Shrum :: http://www.shrum.net

All my published AU3-based apps and utilities

'Make it idiot-proof, and someone will make a better idiot'

 

Posted (edited)

I've updated the code a bit to use this idea.  Can you look at my installer script and see if it looks right in regards to the Select statement using WinActive.

Code here

TIA

<{POST_SNAPBACK}>

While 1
   Sleep(10)
   Select
      Case WinActive("Window One")
       ; window 1 possibility
         ExitLoop
      Case WinActive("Window Two")
       ; window 2 possibility
         ExitLoop
   EndSelect
WEnd

LOL. Everyone's rushing to help the sshrum. :lmao:

Edited by Blue_Drache

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Posted

ExitLoop?!?!

I was wondering about this but didn't see anything in the docs about it.

In a Select statement, do you hae to 'Break' at the end of a case? (In this case 'ExitLoop'). In most other langs, you have to break otherwise all the remaining cases are evaluated down to the bottom.

From what I've seen in the docs, I was under the impression that you didn't.

Sean Shrum :: http://www.shrum.net

All my published AU3-based apps and utilities

'Make it idiot-proof, and someone will make a better idiot'

 

Posted

ExitLoop?!?!

I was wondering about this but didn't see anything in the docs about it.

In a Select statement, do you hae to 'Break' at the end of a case?  (In this case 'ExitLoop').  In most other langs, you have to break otherwise all the remaining cases are evaluated down to the bottom.

From what I've seen in the docs, I was under the impression that you didn't.

<{POST_SNAPBACK}>

The ExitLoop is to break out of the While/WEnd

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

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
×
×
  • Create New...