Dim c As Cursor
c = cp.Calendars
If c.RowCount > 0 Then
For i = 0 To c.RowCount-1
c.Position = i
Dim colcount As Int = c.ColumnCount
Log("columns="&colcount)
For o = 0 To colcount -1
Log(c.GetColumnName(o)&"="&c.GetString(c.GetColumnName(o)))
Next
Next
End If
B4X:
Dim c As Cursor
c = cp.Calendars
If c.RowCount > 0 Then
For i = 0 To c.RowCount-1
c.Position = i
Dim colcount As Int = c.ColumnCount
Log("columns="&colcount)
For o = 0 To colcount -1
Next
End If
I expected to get an NEXT autocompleted after i pressed enter after the -1 in the inner FOR loop but i dont got one.
The compiler connects the new For to the nearest Next and then thinks that the outer For is the one that is missing the closing token. From the parser perspective this is the correct structure.
This issue is fixed for the next update.
It is more complicated than it may seem as the parser needs to "understand" that the existing 'Next' keyword belongs to the outer block (naturally the parser always tries to close the most inner block).