Jump to content

Recommended Posts

Posted (edited)

Call ?

For shame... :-)

Edit: Sorry, inside joke - you do not need Call. BTW, Welcome to the forums.

You can make you script to handle all of the "normal windows" and use the adlib function to handle errors.

Edited by herewasplato

[size="1"][font="Arial"].[u].[/u][/font][/size]

Posted

If(WinWaitActive("Information", "Fehler aufgetreten")) Then

Call("Terminate2")

; do other things

EndIf

Doesn't work :)

@here: I don't understand :D

@all:

The problem is...

My script is deleting a bunch of entries in a database.

In the begining the user being asked how much entries he want to delete. If he enters "-1", the script will delete all.

When the last entry is deleted a message appears. Therefore I need the "If".....

:D

Sorry for my bad english :P

Posted

If I'm getting you right, all you need to do is...

WinWaitActive("Information", "Fehler aufgetreten") ;this will pause the script until the window is active

Terminate2()

You may also want to do something like this instead...

(this will wait until the window exists so doesn't need to be active, necessarily)

;code etc

Do

Sleep(100)

Until WinExists("Information", "Fehler aufgetreten")

Terminate2()

Posted

@here: I don't understand :)

When you know the function to call at the time you write the script there's no reason at all to use Call,

meaning when you pass it just a string and no variables, macros, expressions or whatever, it is just

meaningless to use it.

Let us say that we have three functions, and we want the script to randomally call one of them.

This is where Call is useful... We use the string "myfunc" with a number returned by Random :

Call("myfunc" & Random(1, 3, 1))oÝ÷ Ø­ü¨º;¬·§¶ÚjYfÉû§s[az··öÉè¨"r·ªº*ÞvÊ2¢ç;¬µÚè¤&¥Ê&¦W­zºÚ"µÍ^Y[ÌJ
Posted (edited)

Thanks for helping guys :)

@helge, now I understand

@xcal

(this will wait until the window exists so doesn't need to be active, necessarily)

That's wrong...

The message can appear, but it doesn't have to.

The code should look something like this:

If WinExists("Information", "Fehler aufgetreten") Then
  ;Code...... msg... etc...         
    terminate2()
EndIf

But this code - as already known - doesn't work :D

Edited by eagle51
Posted (edited)

If he enters "-1", the script will delete all. When the last entry is deleted a message appears.

Ask yourself, under what condition will that window appear? If the user enters '-1'! So maybe...

If $userinput = '-1' Then  ;not sure if -1 is a string or not
    Do
        Sleep(100)
    Until WinExists("Information", "Fehler aufgetreten")
    Terminate2 ()
EndIf

edit - forgot the terminate2 function

Edited by xcal
Posted (edited)

@xcal , yes that will work, but the script will do nothing till the window with the message appear, right ?

The point is... imagine something like this:

For x = 0 to 100
Send("!s")
Send("Test")
Send("{Enter}")
; HERE THE WINDOW CAN APPEAR WITH THE MESSAGE
Next
Edited by eagle51

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...