Jump to content

While-WEnd


BALA
 Share

Recommended Posts

Is it possible to have two While-WEnd loops and if so how?

HotKeySet("{F3}", "NextWhile")
Global $trigger = 0

While 1
    While 1
        MsgBox(0, "Press F3", "Inside while loop.")
        If $trigger = 1 Then
            $trigger = 0
            ExitLoop
        EndIf
    WEnd
    MsgBox(0, "", "Outside while loop.")
WEnd

Func NextWhile()
    $trigger = 1
EndFunc   ;==>NextWhile
Edited by herewasplato

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

Link to comment
Share on other sites

well I meant something along the lines of two separate loops.

Edited by BALA
[font="Comic Sans MS"]BA-LA[/font]http://ba-la.110mb.comJoin my community, CLICK HEREAlternative links to my site:http://www.ba-la.tkhttp://www.ba-la.co.nrContact me if you would like to help with some of my projects: joeythepirate@gmail.com
Link to comment
Share on other sites

well I meant something along the lines of two separate loops.

HotKeySet("{F3}", "NextWhile")
Global $trigger = 0

While 1
    MsgBox(0, "Press F3", "First loop.")
    If $trigger = 1 Then
        $trigger = 0
        ExitLoop
    EndIf
WEnd

While 1
    MsgBox(0, "", "Final loop.")
WEnd

Func NextWhile()
    $trigger = 1
EndFunc   ;==>NextWhile
...now if you say - I meant at the same time - I'll...........

Edit:........gently suggest reading about AdlibEnable

Edited by herewasplato

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

Link to comment
Share on other sites

You need to end the while after either a specific number of times looped or until the action wanted is done, you can always go back to it later by using another loop

While $i <= 10
    MsgBox(0, "This will end after the count goes to 10", $i)
    $i = $i + 1
WEnd

While 1
    MsgBox(0, "This box will loop!", "This will Loop!")
WEnd

You can also set it up after a specific action is done, but check your help files for that.

-----------Current Programming Language Status:Beginner: J#, Ruby Intermediate: Autoit, Java, C#, C++Advanced: Basic, Visual Basic, Fortran

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