Sign in to follow this  
Followers 0
epicfail

lplease delete

7 posts in this topic

#1 ·  Posted (edited)

thanks guys

Edited by epicfail

Share this post


Link to post
Share on other sites



Either put the call to the function in a For...Next loop or loop within the function with a For...Next loop. Look in the help under Loop Statements in the Language Reference section.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

$i = 0

$x = 100; or any number you want

While $i <= $x

; do what you want here

$i = $i + 1

WEnd

Edited by Phaser

Share this post


Link to post
Share on other sites

yeah but i want to makeit i to a func like Loop(10) so i can put it next to what i want to loop

Share this post


Link to post
Share on other sites

Like this...

Outside the function:

For $Number = 1 to 5
    Call("Function")
Next

In the function itself:

Func Example()
    For $Number = 1 to 5
        Beep(200,200)
        Sleep(1000)
    Next
EndFunc

...perhaps?

Share this post


Link to post
Share on other sites

yeah but i want to makeit i to a func like Loop(10) so i can put it next to what i want to loop

In that case you could also create some kind of UDF of your liking, such as:

Repeat("Example", 5)

;==This is your UDF==
Func Repeat($FunctionName, $LoopAmount)
    For $LoopNumber = 1 to $LoopAmount
    Call($FunctionName)
    Next
EndFunc
;==End of UDF==

Func Example()
            MsgBox(0,"Example","This is an example function.")
EndFunc

(Edit is won't load? :-S)

Share this post


Link to post
Share on other sites

i would make it like

while $check<10

funcname()

$check=$check+1

Wend

but i am not so professional with it but all the loop i did this way worked...

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  
Followers 0