Sign in to follow this  
Followers 0
brad25

while loop

5 posts in this topic

Hi everyone how do i get a while loop to run say 10 times then exit?

Share this post


Link to post
Share on other sites



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

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

got it thanks

Edited by brad25

Share this post


Link to post
Share on other sites

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.”

 

Share this post


Link to post
Share on other sites

ewwww.... direct approach

Well 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.

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