Suggestion regarding Script Syntax Errors.

Posted by Magnum on Sat 22 Dec 2001 01:00 PM — 3 posts, 11,188 views.

Canada #0
I just got the following error when saving my script:

Error number: -2146827282
Event: Execution of line 1577 column 20
Description: Expected ')'
Called by: Immediate execution

The problem for me, is that I just added a whole pile of subroutines into the script, and the error code given above only serves as an "approximation" of where the error is located. Why do I say that?

The line number does NOT count comment lines. By line 15xx, I have very many comment lines in my script.

I would like to suggest:

The error handler count comment lines, thus giving an accurate event location.

OR

The error handler echoes the error line.

I realize that the first suggestion may not be practical/possible, because the error occurs during compilation... and there is no point looking at comment lines during compilation. Heopfully, you could at least implement the second option though...
Australia Forum Administrator #1
Are you sure it doesn't count comment lines? I think the line number is supposed to be accurate, it is reported from the script engine (eg. vbscript.dll) which I can't alter.

Possibly the problem is that you have line wrapping enabled in the notepad, that will throw out the line counts.

Turn off line wrapping as a notepad option (or use an editor that lets you do that) and then the line count should be accurate. Otherwise each wrapped line counts as a "line" in the notepad, but not a line to the script engine, as the wrapping is "soft".

Possibly that discrepancy is what is making you think comment lines are not counted.
Canada #2
Eek!

You were absolutely correct! I hate reporting errors that are *my* screw-ups. LOL!

I turned off Wordwrap in my text editor, then entered gibberish on a new line (near the end of my file), and the error handler reported the same line my text editor indicated. :)

I use a text editor called "MetaPad", if anyone is curious.