I just start learning programming and started with VB.net 5 days ago. I started with window forms on visual studio, I was given an assignment to insert a loop method on my mathematics calculations practice to make the program runs until I exit instead of running once. Thanks in advance and note I'm a beginner, don't use console practice or other, use windows form
Asked
Active
Viewed 1,042 times
-6
-
1there are plenty of tutorials on YouTube in regards to loops, you should start by going there, have a look, writing some code, and then if it fails, post your code within your question and we can help you, with that being said you want to look for the While Loop" as some people call it, it will look something like for example 'While True 'do something' End While' – user1234433222 Nov 16 '16 at 11:09
-
You are also a **newcomer to this site** so you **should read** [Ask] and also take the [Tour] **before** you post again. – Ňɏssa Pøngjǣrdenlarp Nov 16 '16 at 14:50
1 Answers
0
Here you finde how to use the while statement in vb.net :
https://msdn.microsoft.com/de-de/library/zh1f56zs.aspx
Dim index As Integer = 0
While index < 100000
index += 1
' If index is between 5 and 7, continue
' with the next iteration.
If index >= 5 And index <= 8 Then
Continue While
End If
' Display the index.
Debug.Write(index.ToString & " ")
' If index is 10, exit the loop.
If index = 10 Then
Exit While
End If
End While
Debug.WriteLine("")
' Output: 1 2 3 4 9 10

Twiebie
- 412
- 1
- 7
- 16
-
1Use [**`AndAlso`**](https://msdn.microsoft.com/en-us/library/cb8x3kfz.aspx) instead, it performs [**short-circuiting**](http://stackoverflow.com/questions/8409467/orelse-and-or-and-andalso-and-and-when-to-use). – Visual Vincent Nov 16 '16 at 13:40