brad25 Posted August 14, 2012 Share Posted August 14, 2012 Hi everyone how do i get a while loop to run say 10 times then exit? Link to comment Share on other sites More sharing options...
MrMitchell Posted August 14, 2012 Share Posted August 14, 2012 Did you see the example in the Help File? It's there Local $i = 0 While $i <= 10 MsgBox(0, "Value of $i is:", $i) $i = $i + 1 WEnd Link to comment Share on other sites More sharing options...
brad25 Posted August 14, 2012 Author Share Posted August 14, 2012 (edited) got it thanks Edited August 14, 2012 by brad25 Link to comment Share on other sites More sharing options...
Mechaflash Posted August 14, 2012 Share Posted August 14, 2012 Did you see the example in the Help File? It's there Local $i = 0 While $i <= 10 MsgBox(0, "Value of $i is:", $i) $i = $i + 1 WEnd ewwww.... direct approach For $i = 1 To 10 msgbox(0,"",$i) Next Spoiler “Hello, ladies, look at your man, now back to me, now back at your man, now back to me. Sadly, he isn’t me, but if he stopped using ladies scented body wash and switched to Old Spice, he could smell like he’s me. Look down, back up, where are you? You’re on a boat with the man your man could smell like. What’s in your hand, back at me. I have it, it’s an oyster with two tickets to that thing you love. Look again, the tickets are now diamonds. Anything is possible when your man smells like Old Spice and not a lady. I’m on a horse.” Link to comment Share on other sites More sharing options...
MrMitchell Posted August 15, 2012 Share Posted August 15, 2012 ewwww.... direct approachWell he said While loop...Anyway, brad25, there are difference choices for loops depending on what you are doing with it...but the For...Next loop is best for counting like you described. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now