For intAsterisks As Integer = 0 To intLine - 1
lblAsterisks.Text = lblAsterisks.Text + "*"
Next
我们需要能够将For Next代码转换为Do循环代码。有人可以帮助我们吗?
答案 0 :(得分:3)
dim intAsterisks as integer = 0
Do While intAsterisks < intLine
'Do stuff
intAsterisks = intAsterisks + 1
Loop
答案 1 :(得分:3)
我会问一个问题“为什么你需要转换它?”
Dim i as Integer = 0
Do While i < intLine
lblAsterisks.Text = lblAsterisks.Text + "*"
i = i + 1
Loop
答案 2 :(得分:0)
dim i as integer
Private sub command1_click()
For i = 0 to 30 Step 1
Print (i)
next
end sub