Compiling a script

Top  Previous  Next

Once your DialogScript programs are finished and fully debugged you will probably want to run them on their own, as standalone programs.  To do this you must create an executable file.

 

From the File menu select Compile to EXE. 

 

The compiler performs extensive checking on the script during compilation, returning informative error messages together with the line number where the error was found.

 

It is not necessary (though you may still consider it advisable) to save your script files before compiling. If a source file is open in the editor, the compiler will read the code from there instead of the copy on disk.

 

You also have the ability to compile sections of script to unit files, which have a .dsu file type. Units can be used in scripts by specifying them in the #INCLUDE directive, and they can be compiled into executable files, but being compiled the script code is hidden from the user. They are therefore an ideal way for developers to distribute code without giving away the source code.

 

Click on any area to learn what it does.

 

Because the linker has the capability to link resources into the executable file, VDS 5 supports the ability to load text and graphical elements from embedded resources. To specify that a file is to be linked into the EXE and used as a resource, you simply prepend a '#' to the filename or path. When testing the project in the IDE, the resource is loaded from the disk file as usual. When a compiled program is run, the data is read from a resource instead.

 

The VDS compiler also functions as a resource compiler. When resources are specified in the filename parameters of DIALOG ADD commands for BITMAP, ICON, TASKICON and ANIICON dialog elements, a line is added to the resource script that is passed to the VDS linker. This also occurs if a resource is specified in the filename parameter of a LIST LOADFILE command, allowing text files to be embedded as resources. Custom cursors are linked automatically if a resource filename is specified in a DIALOG CURSOR, CUSTOM command. (The second parameter, CUSTOM, is no longer required in this case.)

 

A compiler directive, #RESOURCE ADD, is also provided, to allow resources to be specified by the developer. The compiler will not automatically add resources specified in DIALOG SET commands, DIALOG ADD commands for BITCOMBO or BITLIST dialog elements (where they are specified as part of a text string), or where the resource file names are held in a variable. The #RESOURCE ADD directive can be used to ensure that the required files are linked into the executable file in this case.

 

The resource linker has the capability to link a Windows XP manifest into the executable file. This file is necessary to tell Windows XP to use the latest version of the common controls DLL which is XP theme-aware. This feature is selectable using the project manager.