1

Hey everyone. My friend and I are re-learning Visual Basic, and we are stumped on this bit of code.

For intAsterisks As Integer = 0 To intLine - 1
  lblAsterisks.Text = lblAsterisks.Text + "*"
Next

We need to be able to make that from a For Next code into a Do Loop code. Could anyone assist us?

3 Answers 3

3

I would ask the question "Why do you need to convert it?"

Dim i as Integer = 0
Do While i < intLine
    lblAsterisks.Text = lblAsterisks.Text + "*"
    i = i + 1
Loop
Sign up to request clarification or add additional context in comments.

Comments

3
dim intAsterisks as integer = 0
Do While intAsterisks < intLine
    'Do stuff
    intAsterisks = intAsterisks + 1
Loop

Comments

0
dim i as integer
Private sub command1_click()
  For i = 0 to 30 Step 1
  Print (i)
  next 
end sub 

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.