M
Miro
Im using VB2003 and i just pulled an example out of the book that says this:
"Note: also that you can decalre the index variable in a For Loop using the
optional AS datatype clause, as long as the index variable isnt already
declared eslewhere. ( This is new to Visual Basic.net 2003 )
It then gives the example :
For intLoopIndex As Integer = 0 To 1
'This next line i have dummy'd down cause they use it to print an array
element so like Foo( intLoopIndex )
Console.WriteLine("Hello")
Next intLoopIndex
It does not mention having option strict on and option explicit on. I have
them both on.
My simple solution is to just dim it before, cause it complaines that
intLoopIndex is not declared.
Im assuming its either because of the Option Strict and Option Explicit
and not a typo ( somehow ) in the book.
Miro
"Note: also that you can decalre the index variable in a For Loop using the
optional AS datatype clause, as long as the index variable isnt already
declared eslewhere. ( This is new to Visual Basic.net 2003 )
It then gives the example :
For intLoopIndex As Integer = 0 To 1
'This next line i have dummy'd down cause they use it to print an array
element so like Foo( intLoopIndex )
Console.WriteLine("Hello")
Next intLoopIndex
It does not mention having option strict on and option explicit on. I have
them both on.
My simple solution is to just dim it before, cause it complaines that
intLoopIndex is not declared.
Im assuming its either because of the Option Strict and Option Explicit
and not a typo ( somehow ) in the book.
Miro