Sign in to follow this  
Followers 0
Dhorn

Loop multiple functions based on an input

2 posts in this topic

I have 3 separate functions that perform their own thing. My third function contains a loop. I however want to be able to create an input box where the number entered will combine functions 1,2,3 and then loop all three functions combined the number of times entered. I guess I am having problems with creating the input box correctly to start the loop. Any help would be greatly appreciated. Here is my idea of what I am trying to accomplish below.

Input box

Loop = Input Answer.

function 1() Does function 1 code

function 2() Does function 2 code

function 3() Does function 3 code with some loops

End Loop

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

$number = Inputbox("title","prompt:","","",120,120)
If $number = "" Then
    Exit
EndIf

For $i=1 To $number Step 1
    function1()
    function2() 
    function3()
Next

Func function1()
    ConsoleWrite("function1"&@CRLF)
EndFunc

Func function2()
    ConsoleWrite("function2"&@CRLF)
EndFunc

Func function3()
    ConsoleWrite("function3"&@CRLF)
EndFunc

Edited by bluelamp

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