Rudy,
You may want to consider using Option Strict On, you would have received a
compile error to the effect "Option Strict On disallows implicit conversions
from 'boolean' to 'integer' on the expression "i = 5" on the For statement.
I find compile errors easier to fix, then obscure runtime behavior.
Unfortunately Option Strict On requires you to be more specific in your code
(requiring use of CType & DirectCast more) as it disallows late binding &
some implicit conversions. However this generally means you code may execute
faster...
I would also recommend you consider using a StringBuilder instead of string
concatenation.
dim i as Integer
Dim sb As New System.Text.Str ingBuilder For i = 0 To 5
'objdsBook is a dataset
sb.Append(objds Book.BookCondit ion(i).Item(0))
Next i
output = sb.ToString()
For 6 rows using StringBuilder may not make much of a difference, however
for 600 rows I'm sure it will.
Hope this helps
Jay
"Rudy" <an*******@disc ussions.microso ft.com> wrote in message
news:DE******** *************** ***********@mic rosoft.com... I am writing a program in VB.NET and as I was debugging a problem I
noticed my For loop doesn't want to loop! I originally had a upper bound which was an expression and it wasn't
working. WHen I noticed this I changed the upper bound for a simple digit.
As I step through my code, I see that it simply goes through the loop once
and continues on it's merry way. Now I have programmed in Java, C++, and
even Modula 3 before and I have never seen this EVER! Do I have something wrong with my settings or what? I'm really stumped!
H E L P!!
here's the code:
dim i as Integer
For i = 0 To i = 5
'objdsBook is a dataset
output = output & objdsBook.BookC ondition(i).Ite m(0).ToString
Next i