Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
for without next error
#1
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"
Reply


Messages In This Thread
for without next error - by maeloterkim - 10-10-2021, 02:22 PM
RE: for without next error - by boriel - 10-11-2021, 06:51 AM
RE: for without next error - by boriel - 10-12-2021, 03:52 PM
RE: for without next error - by maeloterkim - 10-12-2021, 04:15 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)