Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I have learned something new: how to get a run-time syntax error
#1
In the following code

Code: (Select All)
Dim a As Integer
On Error GoTo Error1

Read a
Read b

Print a
Print b
End

Dim As Integer ER, EL
Error1:
ER = Err: EL = _ErrorLine
Resume Quit



Quit:
Print "?Error"; ER; " on line"; EL; "described as "
Print _ErrorMessage$(ER)
End

Data 6
Data 7        ' the number

It will trap with an error 2 on line 5. I discovered something today:
You can't put a comment on a data statement.
Without the comment it works just fine.
While 1
   Fix Bugs
   report all bugs fixed
   receive bug report
end while
Reply


Messages In This Thread
I have learned something new: how to get a run-time syntax error - by TDarcos - 09-25-2024, 04:08 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Today I learned loops are slow CMR 10 933 12-20-2025, 02:15 PM
Last Post: TDarcos
  Pointlessly Walk or Run forever! (update 0002) Cobalt 14 2,687 01-24-2025, 07:04 PM
Last Post: bplus

Forum Jump:


Users browsing this thread: 1 Guest(s)