RedZed
As the saying goes "To a man with a hammer, every problem looks like a nail"
To put it another way, just because you know how to use a For loop doesn't make it right for every task.
Study the code I provided and step through it to understand what it is doing. Then use that structure to see if you can apply it to your problem without a need for a loop.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
|