10-10-2021, 02:22 PM
Hi
I found that if i dont write a next in a for the compiler only says "error: Unexpected end of file"
pointing to the LAST LINE of the program
if i only have a few lines is "easy" to find the error
but if i have 2000 or more lines is a crazy thing to find the error
Can the compiler add a rule to search if every FOR have a NEXT and throw the error "for without next" ?
This way is more easy to find the error in a BIG program with a lot of lines
You can look the example code
''EXAMPLE CODE WITH EXPLAINED ERROR
dim example as uByte = 0
for example = 0 to 10
print example
'' THE NEXT MUST GO HERE IN LINE 9 but the compiler logically dont know that
'' BUT Can the compiler say "error: for without next"
'' instead of "19: error: Unexpected end of file" ?
'' because if we have 2000 or more lines
'' and we dont know what happens
'' is a crazy thing search that error
print "end of program"
I found that if i dont write a next in a for the compiler only says "error: Unexpected end of file"
pointing to the LAST LINE of the program
if i only have a few lines is "easy" to find the error
but if i have 2000 or more lines is a crazy thing to find the error
Can the compiler add a rule to search if every FOR have a NEXT and throw the error "for without next" ?
This way is more easy to find the error in a BIG program with a lot of lines
You can look the example code
''EXAMPLE CODE WITH EXPLAINED ERROR
dim example as uByte = 0
for example = 0 to 10
print example
'' THE NEXT MUST GO HERE IN LINE 9 but the compiler logically dont know that
'' BUT Can the compiler say "error: for without next"
'' instead of "19: error: Unexpected end of file" ?
'' because if we have 2000 or more lines
'' and we dont know what happens
'' is a crazy thing search that error
print "end of program"