Quote: "maybe if the pre compiler add a endif to the end of row if "then" is used it will convert it to this"
No, usage of the THEN keyword makes the compiler treat the IF statement as a single statement, not a multiple line one. The conversion of the colon to a line break would be the correct and expected outcome.
In the example provided by SoftMotion3D, the uncommented example should work as expected, but the commented out code would not work as he expected as the statements all use the THEN keyword.
See the below:
Quote: "if tile_up<2
vertcnt = vertcnt + 4 : indcnt = indcnt + 6
endif"
vertcnt & indcnt only gets incremented if tile_up is greater than 2.
Quote: "If tile_down =< 1 then vertcnt = vertcnt + 4 : indcnt = indcnt + 6"
vertcnt gets incremented if tile_down is less than or equal to 1. indcnt always gets incremented as the IF statement is converted to the following:
If tile_down =< 1
vertcnt = vertcnt + 4
EndIf
indcnt = indcnt + 6
To execute both statements within the one IF statement, do the following:
If tile_down =< 1 : vertcnt = vertcnt + 4 : indcnt = indcnt + 6 : EndIf