General XMetaL Discussion
spyro May 28, 2009 at 5:03 pm
Check Syntax in XMetal 5May 28, 2009 at 5:03 pmParticipants 2Replies 3Last Activity 13 years, 6 months ago
I'm trying to debug several vbs-files inside a XMetal 5 project with Visual Studio 2005. The build process stops with the message “There were build errors” but doesn't give me further information such as position and description of the error. The Macro Editor in XMetaL 3 had a “Check syntax” functionality in the context menu to avoid language-specific errors. How can this done with XMetaL 5?
Currently I'm spending hours searching for bugs just to find out that a simple, small “,” to much in module X, Line Y ruined my code. 🙁
Rupert JungDerek Read May 29, 2009 at 12:51 am
Reply to: Check Syntax in XMetal 5May 29, 2009 at 12:51 am
XMetaL Developer plugs into Visual Studio's UI and when errors are raised you can take full advantage of all the functionality that VS provides.
Any errors identified during the build process should be listed in a window called “Task List” which should normally appear at the bottom of the VS main window. If you don't see this window you can select View (menu) > Show Tasks > Build Errors.
The Task List shows the error, the file containing the error and the line number. The description will sometimes contain the column number of the error if it was identified.
There are other things you may wish to take advantage of during debugging:
– Setting breakpoints (F9 to toggle them).
– Various ways to step through code (Step Into, Step Over, Step Out).
– Edit and continue functionality that lets you modify (some forms of) code after starting a debug session. Whether or not this is possible depends on how your code is written.
– Setting variables to “watch”. This allows you to check values as code executes (including objects and their child objects and values). It is often useful to set breakpoints to help with this so you can periodically suspend code (as a loop executes for example).
The information here might help:
Watches and the edit and continue functionality of Visual Studio's debugger are also documented by Microsoft.spyro May 29, 2009 at 8:33 am
Reply to: Check Syntax in XMetal 5May 29, 2009 at 8:33 am
Hello Derek Read,
thanks for your quick answer.
Unfortunaly your recommendation isn't working. This is what it looks like after I attempting a build-process with syntax errors (please notice the doubled “End Sub”-line at the bottom of the code):
(German Version of Visual Studio)
The error lists in VS are also empty:
Do you mean the “output”-Window instead? XMetal produces a log there which I can scroll through to find compiling errors. A clean error message in vs would be more practicable, sure. But in fact that's better than nothing.
BTW, I'm getting a error message (?) while starting to debug every time just before the “DEBUG STARTED”-statement: “Warning: Script code can not be debugged. Incorrect function.” (Translated from german)
What could be the possible reason for that?
Thanks again for your help,
Rupert JungDerek Read May 29, 2009 at 10:27 pm
Reply to: Check Syntax in XMetal 5May 29, 2009 at 10:27 pm
You will also see errors in the Output window when a build fails as well, yes. I see most of the same errors listed in the Task List window. The following statement will throw an error:
x = 5 +
C:Documents and Settingstest1.PR-QA-XPPSP2My DocumentsVisual Studio ProjectsXMetaLProject1On_Click.vbs
error Line 11:Col 7 Syntax error
Exactly the same information (error, filename, line 11, column 7) appears in a slightly more readable fashion (for me) in the Task List.
Not all errors are found this way however. I don't believe the VS scripting validator is hooked into our APIs to know the proper spelling, properties, methods, etc, for each of them, so if you make an error like the following I don't think it will be caught until execution:
Which should be:
It does catch language specific syntax and other errors during the build phase.
- You must be logged in to reply to this topic.