Jump to content
Sign in to follow this  
Wabbit

While Looping question:

Recommended Posts

Wabbit

Ok, I hope I'm not being a pain here. I have an idea of the basics and I am trying different things that I see on the website. Right now I am testing how to do multiple things within a loop:

$i = 0
While $i <= 10

    MsgBox(0, "My second script!", "Hello #1")
    TestFunc()

    Func TestFunc()
        MsgBox(1, "My Second Script!", "Hello #2")
    EndFunc
    TestFunc2()

    Func TestFunc2()
        MsgBox(2, "My Second Script!", "Hello #3")
    EndFunc
    TestFunc3()

    Func TestFunc3()
        MsgBox(3, "My Second Script!", "Hello #4")
    EndFunc

$i = $i + 1

WEnd

It looks like it will only do one funciton in a while loop. Is this correct? What am I doing wrong?

Many thanks again!

Share this post


Link to post
Share on other sites
BigDod

$i = 0
While $i <= 10
    MsgBox(0, "My second script!", "Hello #1")
    TestFunc ()
    TestFunc2()
    TestFunc3 ()
    $i = $i + 1
WEnd
Func TestFunc ()
    MsgBox(0, "My Second Script!", "Hello #2")
EndFunc   ;==>TestFunc
Func TestFunc2()
    MsgBox(0, "My Second Script!", "Hello #3")
EndFunc   ;==>TestFunc2
Func TestFunc3 ()
    MsgBox(0, "My Second Script!", "Hello #4")
EndFunc   ;==>TestFunc3



Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites
Wabbit

Ah, the functions themselves can go at the end... I think I recall something like that from "C" long, long ago... Thanks!

Edited by Wabbit

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.