Jump to content

Recommended Posts

Posted

This code looks for a popup window that may

or may not display, for valid reasons.

It clicks thru the window if it does come up,

or keeps going down the code, if it does not display.

How can I trap for an unexpected error as well

as the value returned by the function ?

The "signonwrong" is a test because if the window

displays, it should NOT find the "SignOn" button that is in fact there,

and should NOT send an ENTER.

$error = WinwaitActive("Display Form","SignOnwrong",5)

If $error = 0 Then

Send("{ENTER}")

Else

ContinueCase

EndIf

Posted

Look at AdlibEnable()

I'll take a look at AdlibEnable.

I'm still interested in knowing how to trap the

error code from any function call, while getting

the returned value/data from the function.

Any ideas ?

Posted

This code looks for a popup window that may

or may not display, for valid reasons.

It clicks thru the window if it does come up,

or keeps going down the code, if it does not display.

How can I trap for an unexpected error as well

as the value returned by the function ?

The "signonwrong" is a test because if the window

displays, it should NOT find the "SignOn" button that is in fact there,

and should NOT send an ENTER.

$error = WinwaitActive("Display Form","SignOnwrong",5)

If $error = 0 Then

Send("{ENTER}")

Else

ContinueCase

EndIf

How about:

If WinwaitActive("Display Form","SignOnwrong",5) Then
    Send("{ENTER}")
 Else
    ContinueCase
EndIf

Note that WinWaitActive() waits for the window to have focus, not just exist. That may or may not be what you intended. WinWait() might be better.

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

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
  • Recently Browsing   0 members

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