|
Seb Wizard
Joined: 14 Aug 2004 Posts: 1269
|
Posted: Mon Mar 05, 2007 3:02 am
[1.25] How is one supposed to find Syntax errors with Ctrl-K? |
When Ctrl-K says things like "unmatched parenthesis at row 0 col 747" and puts the cursor at the end of the first line (wrapped) which most certainly isn't at col 747?
In the end I had to put the script into Textpad to find it (and found what I consider a parsing bug with %if, but that's another story). |
|
|
|
Larkin Wizard
Joined: 25 Mar 2003 Posts: 1113 Location: USA
|
Posted: Mon Mar 05, 2007 3:13 am |
I asked this very same question a few months ago. The answer is that the code box will one day have a status indicator for cursor row and column. If an error is found, though, doesn't CMUD move your cursor to the location automatically?
|
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Mon Mar 05, 2007 4:17 am |
It does, Larkin. You aren't guaranteed to notice the error, however, especially in a really long or complicated string of gobbledygook.
One of the tricks I've started to incorporate is to create snippets of code at the very bottom of the edit window or simply in the Notes field. That way if I messed up I am far more likely to notice the error. |
|
_________________ EDIT: I didn't like my old signature |
|
|
|
Arminas Wizard
Joined: 11 Jul 2002 Posts: 1265 Location: USA
|
Posted: Mon Mar 05, 2007 7:25 am |
If it is an especially long complicated script I copy everything, open the Editor (Not the settings editor the but the one on the main menu), turn off word wrapping then paste it in there. Then I do a ctrl+k.
The only issue I've had with that is if you have commented out a line RIGHT below the actual error it will put the cursor at the end of the commented line. Otherwise it moves right smartly to the error. |
|
_________________ Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram |
|
|
|
Seb Wizard
Joined: 14 Aug 2004 Posts: 1269
|
Posted: Wed Mar 07, 2007 2:07 am |
Thanks, Arminas - I tried that before but didn't think to turn off word wrapping first so it didn't help me.
The script editor does not move the cursor to the correct position if the lines are wrapped (it moves the cursor to where the line gets wrapped instead), so Arminas' solution seems to be the only one available within CMUD at the moment. |
|
|
|
|
|