Jump to content
Sign in to follow this  
hakerche

HOW TO? LOOP inside LOOP?

Recommended Posts

hakerche

I need help! I am new in programing and scripting so I don't know what to use to make loop inside of loop?

something like

start of loop 1

start of loop 2 until something

then after finished with loop 2 reset loop 2 and

continue of loop 1 until something

??? HOW ???

Share this post


Link to post
Share on other sites
John117

Heres a simple one. I could help more if you would post what you are really looking for.

While 1 ;keeps running when not in error, While/WEnd
    $Count = 10  ;this is the starting value
    MsgBox(0, "Count", $Count)  ;standard message, title, value
    Do ;second loop, Do/Until
        $Count = $Count - 1 ;Reduce count by 1
        MsgBox(0, "Count", $Count) ;show new count
        Sleep(1000) ; brief pause
    Until $Count = 1 ;When to stop Do
Sleep(5000) ;did you want to restart 2?
WEnd  ;Start all over

its a repeat countdown btw

Edited by Hatcheda

Share this post


Link to post
Share on other sites
PsaltyDS

I need help! I am new in programing and scripting so I don't know what to use to make loop inside of loop?

something like

start of loop 1

start of loop 2 until something

then after finished with loop 2 reset loop 2 and

continue of loop 1 until something

??? HOW ???

Demo:

HotKeySet("{ESC}", "_Quit")

While 1
    For $x = 0 To 9
        For $y = 0 To 9
            For $z = 0 To 9
                Sleep(20)
                ToolTip("XYZ = " & $x & $y & $z)
            Next
        Next
    Next
WEnd

Func _Quit()
    Exit
EndFunc

:P


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

Share this post


Link to post
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
Sign in to follow this  

×