Script Window

The most of commercial software packages has some form of embedded "macro" languages, because programming language provides the highest degree of flexibility and extensibility that cannot be obtained by means of any configurable user interface. The problem is that most of such languages are developed without appropriate standardization and incompatible with each other.

However, two well-standardized scripting languages, known as JavaScript and Visual Basic scripting edition (aka VBScript or VBA) are preinstalled with any copy of Microsoft Windows operating system. DM2000 Script window can use both languages. Actually, DM2000 has no own script interpreters; it uses external scripting engines built in Windows instead. Thus, using DM2000 you can create powerful applications without any additional development tools!

DM2000 Script window looks like Notes window but has additional toolbar. You should load your scripts into the text editor (or edit new scripts), then select language and compile script from the text editor using "Compile" button. If compilation was successful, you may select procedures and functions from the drop-down list and run selected procedure (if it has parameters you will be prompted for their values). After execution complete you will see message box with the function result (if any). Note that all global statements are executed immediately after compilation.

Script window does not allow you to create custom user interface or extend DM2000 UI. Instead you should use MiniBrowser window that can display any set of UI controls and execute the same script applications.

DM2000 object model is exposed to the script engine via the predefined Server object. See sample scripts supplied with DM2000 (in the samples.zip archive) for examples. You can get more information about scripting languages in the Windows help system (detailed language references and tutorials, as well as powerful script debugger from MS Visual Studio, are included with the Microsoft Office 2000) or on the special Microsoft web site.

Script window may be floating or docked into DM2000 main window. When floating, it has its own status line and toolbar with standard set of buttons. When Script window is docked, these controls are invisible and it uses toolbar and status line of the main window instead (script commands may be placed on the main toolbar or main menu). For example, when Script window has input focus, edit commands from the main menu will act on the contents of this window. Keep in mind that File|Open command from the main menu always opens script files in the Script window (JavaScripts have *.js default extension and VBScripts - *.vbs).

Note that like any text editor control, under Windows 9.x Script window can hold text file less than 64 kB in size (for NT/2000 file size is not limited).