Jump to content

help with loops


shay
 Share

Recommended Posts

HI all

i start using loop in my testing script,

unfortunately i`m new to the loop commands,

the above script sometime work and sometime not

i want to do loop till find different text on window or timer expire,

for timer i use TimerInit + TimerDiff

any suggestion what did i do wrong or any improvement?

$timeout = IniRead($path, "General", "loop_wait", "297000")
$begin = TimerInit()
 Do
 $prepar = WinExists("LU", "Preparing file transfer")
    if $prepar = 1 then ExitLoop
    if WinExists("LU", "File transfer complete") then $compleat = "1"
    if WinExists("LU", "Error: LU not responding") then $notR = "1"
    if WinExists("LU0", "File transfer stopped") then $stop = "1"

        $dif = TimerDiff($begin)
        sleep(300)
        WinActivate("LU-30",'')
        ToolTip("Automation: Loop in progress", 20, 250)

 until $dif > $timeout Or $compleat = "1" or $notR = "1" or $stop = "1"
Edited by shay

"If the facts don't fit the theory, change the facts." Albert Einstein

Link to comment
Share on other sites

What does $timeout equal? Or did miss that somewhere?

$timeout = IniRead($path, "General", "loop_wait", "297000")

the $path lead to the DLL file

"If the facts don't fit the theory, change the facts." Albert Einstein

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