Jump to content

Recommended Posts

Posted

How can i repeat just 10 times same loop? While-Wend" it will loop always

I am sorry for my engilsh, im not natural lang. 

While 1
   If WinWaitNotActive("My Program", "", 1) Then
Sleep(100)
Send("!+{TAB}")
Sleep(4000)
ElseIf WinActivate("My Program") Then
   ExitLoop
Else
EndIf
Wend

 

Thanks

 

  • Moderators
Posted

mixim,

Your guess was correct, you need a For...Next loop with the active code inside it.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

  Reveal hidden contents

 

Posted
  On 8/17/2017 at 12:34 PM, VIP said:

Like this:
 

Local $loopTime = 10

While $loopTime
    $loopTime -= 1
    If WinWaitNotActive("My Program", "", 1) Then
        Sleep(100)
        Send("!+{TAB}")
        Sleep(4000)
    ElseIf WinActivate("My Program") Then
        ExitLoop
    Else
        ;......
    EndIf
WEnd
Expand  

Worked nice
Thank you thousands times very much 
It took almost my a day, I failed

 

  On 8/17/2017 at 12:31 PM, Melba23 said:

mixim,

Your guess was correct, you need a For...Next loop with the active code inside it.

M23

Expand  

Thanks everone

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