Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27510

For.. Next Output Question Need Help

$
0
0
Hello. I've been trying to understand why the output of the following program is:
Quote:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

Quote:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As _
System.EventArgs) Handles Button1.Click
Dim i, j, number As Integer
number = 0
For i = 1 To 5
For j = 1 To i
number += 1
TextBox1.Text = TextBox1.Text & number & Chr(13) & Chr(10)
Next
Next
End Sub
End Class

The part I did not understand is why the output continues after 5.. It supposed to end the For..Next when i=5 .. Also I have made the parts I didn't understand Bold. It's probably really simple question sorry for being so noob :)

Viewing all articles
Browse latest Browse all 27510

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>