![]() |
|
![]() |
Use Script Editor to edit, compile and run scripts. Also it should be used to debug simple scripts or automate single use tasks, when you don't wish to make special menu item or toolbar button. In addition, you may explore DM2003 object model and inspect objects.
At a glance, Script Editor window is a "mini-IDE" which has following main elements:
Although you can inspect variables and run code as well as get comprehensive compilation and runtime error diagnostics, Script Editor doesn't support full set of debugging features like breakpoints, step-by-step execution and so on. Instead, you can easily use powerful professional-quality script debuggers available from Microsoft (both free stand-alone Script Debugger utility and Script Editor integrated in the MSVS and Microsoft Office). Read documentation on these products how to attach debugger to the DM2003.EXE process and debug script blocks. There's a couple of hints:
It should be noticed that Script Editor and debuggers from MS have substantially different application scope, and in fact their functionality do not significantly overlap. You use Script Editor mainly to type texts, that's why it includes various productivity features such as Code Completion and a lot of wizards, while debuggers typically are not used for editing. In addition, scripting applications usually are very simple so that one rarely has to trace code execution under debugger.
In many cases you may find convenient to use Script Editor for editing HTML code. Click File|New menu item, then select Empty HTML or HTML Applet Wizard to create new HTML document, or just open existing HTML file. Use File|Browse command to copy the contents of the editor directly into DM2003 Browser Window (this command doesn't work until Browser Window have loaded any HTML document, and some HTML features like cookies and linked files are not supported).
HTML Applet Wizard supports several type of application templates used by DM2003, including HTML-based applets and device drivers. Also you may use Measurement System Wizard to make ready-for-use DAQ applications.
Although the development of Script Editor was focused on characteristic features of Data Master 2003 software and does not duplicate existing development tools like MSE/MSVS, it includes several functions that help you write your script applications for DM2003. A set of wizards available in Help|Wizards menu assist you with creation of User Actions, event hanldlers, HTML code of ActiveX objects and application templates. Another cool features are Code Completion (you can activate it by pressing Ctrl+Space somewhere in the editor) and Auto Complete (invoked by Shift+Space).
Notice: these features now are in the beta phase, so they are more limited than IntellisenseTM features in Visual Studio. Keep in mind that script languages are typeless, and as a result, it is impossible to determine whether some variable is an object with a set of members or not. At the moment of writing Code Completion supports three modes: i) if it is invoked at some blank space, a list of constants from DM2003 TLB and dynamic set of specially declared variables is shown; ii) in the declaration clause (e.g. after dim keyword in VBScript) you can define variable type as a comment and iii) if invoked after some identifier, a list of members is displayed if the type of this identifier can be resolved. The list of members is created dynamically by TLB information, static table of identifiers (properties of DM2003 objects that return other objects) also is supported. Currently dynamic identifier table works only in VBScript mode (and in VBScript blocks in HTML files).
Screenshots below demonstrate how to use Code Completion and Auto Complete templates:
![]() |
dim MyVar ' as IDMDocument2 |