Originally Posted by darking123
You would place it where you want it... I don't know how else to say it...
First you have a problem to be solved by a computer program.
Second you decide how a program can solve the problem.
Third you write code to perform the actions described in the solution.
Where the solution says: "Do this thing while this condition" ... that is where it goes. All of the code to "do this" goes inside the loop.
Tell ya what, why don't you just give it a try. Throw it in there where it looks good and see what it does. If it does not work we will help you figure out why.
Sorry but no one is just going to give you the solution in code. (..and if they do it will be deleted)
You just have to work through the problem solving process, trial and error, which will pay off the great rewards of experience and learning as you go.