D
Dave Neve
Hi
The following code in a Visual Basic Net book
Dim I As Integer , X As Integer
For I = 1 to 3
For X = 1 to 3
Debug.Write("I = " & I & vbCrLf)
Debug.Write("X = " & X & vbCrLf)
produces
I = 1
X = 1
I = 1
X = 2
I = 1
X = 3
I = 2
X = 1
I = 2
X = 2
I = 2
X = 3
I = 3
X = 1
I = 3
X = 2
I = 3
X = 3
I get the gist of this but I am surprised by line 8( X + 1 [again])
There is no code that has actually stipulates that X should return to zero.
I would have been less surprised if X had proceeded to 4 and the code had
refused to execute after line 8
Can sm give us a quick explanation please?
Thanks in advance
The following code in a Visual Basic Net book
Dim I As Integer , X As Integer
For I = 1 to 3
For X = 1 to 3
Debug.Write("I = " & I & vbCrLf)
Debug.Write("X = " & X & vbCrLf)
produces
I = 1
X = 1
I = 1
X = 2
I = 1
X = 3
I = 2
X = 1
I = 2
X = 2
I = 2
X = 3
I = 3
X = 1
I = 3
X = 2
I = 3
X = 3
I get the gist of this but I am surprised by line 8( X + 1 [again])
There is no code that has actually stipulates that X should return to zero.
I would have been less surprised if X had proceeded to 4 and the code had
refused to execute after line 8
Can sm give us a quick explanation please?
Thanks in advance