I could not work if it is a bug or function
For i = 0 To 4 Dim strTest As String If i = 0 Then strTest = "test value" End If Console.WriteLine(strTest) Next
I thought that declaring a line inside a loop would not save its value, but after running this code, the console has 5 lines of "test value". If instead I declare strTest as:
Dim strTest As String= ""
Then the line does not save its value - so I would expect the function to work in the first place.
Is this intentional behavior a compiler?
5uperdan
source share