TOPIC: "Error at line....." syndrom
"Error at line....." syndrom 3 Years, 10 Months ago
Hi, people of Suneido

New to Suneido, I am facing the same "Syntax error at line...." attacks that Mr. Ajith said brought him to write its excellent "Suneido Syntax" manual for the safe of beginners.

At my first test, with very simple and short lines of code, the Work Space reacts insisting to notify "Error at line ..." messages, addressing lines not existing in my code (shorter than that).

Phantom lines or my phantom errors?

Second question: considering that Suneido is addressing the code errors by line number, is there any possibility to have the code lines automatically numbered, as it was with the old Basic?

Thanks for the help

Post edited by: gianfmal, at: 2006/10/17 13:47
Re:"Error at line....." syndrom 3 Years, 10 Months ago
The line numbers do not match because when you run code on the WorkSpace it is "wrapped" in some extra code (to turn it into a function which can be called). We could fix this by adjusting the line numbers in syntax errors to allow for the extra code. No one has done this because usually you are only running a few lines of code and it is not too hard to see the error. (Harder for beginners, of course.)

For more than a line or two of code, I would suggest entering the code in LibraryView (in your own library). LibraryView does a better job of reporting syntax errors.

If you right click on your code in LibraryView you can choose Show Line Numbers. (You can also do this on the WorkSpace but it is not so useful there.)

Hope that helps.
Re:"Error at line....." syndrom 3 Years, 10 Months ago
Hi, Andrew
Thanks for your immediate and accurate answer

After your reply I made some additional tests with the Work Space and had the confirmation: in case of syntax errors the line numbers are provided in line with a random concept; almost a way for testing the user reactions.

Also some other minor elements may confuse the new user, at his first approach with Suneido operating the Work Space, with the risk of altering his enthusiasm for this system:
- If some blank lines follow the last line of code and the mouse points to this area, the code is not executed.
- Similar problems in case of white lines among the code or before the first line.
- A solution to these problems is the selection of the block of code to be executed, but this is not a simplification.
- In case a value is assigned to a variable in the last line of the tested code (x =20), it is transferred to the output area, as if it were followed by a Print(x) command

Thanks also for the advice of using the Library View: it will be my lesson N.2.
Best regards