Here is a list of the compiler directives available in Visual DialogScript:
  • #DEFINE COMMAND declares all command names that are not built in to VDS.
  • #DEFINE FUNCTION declares all command and function names that are not built in to VDS.
  • #RESOURCE ADD, ANIICON add a aniicon resource.
  • #RESOURCE ADD, BITMAP add a bitmap resource.
  • #RESOURCE ADD, CURSOR add a cursor resource.
  • #RESOURCE ADD, ICON add a icon resource.
  • #RESOURCE ADD, TEXT add a text resource.
  • #RESOURCE ADD, add a user defined type of resource.
  • #INCLUDE directive allows a program to incorporate code from multiple script files.

The #DEFINE directive declares all command and function names that are not built in to VDS.

This includes all commands and functions provided by extension DLLs, as well as commands and functions written in VDS code.

Note that the '@' symbol does not form part of the function name, so a function that was used as @prime(...) would be defined as: #DEFINE FUNCTION, PRIME

 The #INCLUDE directive allows a program to incorporate code from multiple script files, which are compiled into the program in the order in which they are specified.

The use of .dsc in the filenames is optional. If a full path is not specified, the compiler looks first in the project's main directory, and then in a special include folder that can be set using the IDE Options menu.

The #INCLUDE directive is also used to include precompiled units (.dsu files) in a script. In this case, the file type (.dsu) must be specified in the filename, so that the compiler knows to look for a unit file and not a plain text source file.

Note that commands and functions defined in a INCLUDE file (or a compiled .dsu version of it) may be defined (using #DEFINE) in that file.

The compiler preprocesses included files looking for command and function definitions, in order that they don't produce an "illegal command or function" error when they are compiled.

The VDS compiler functions as a resource compiler. When resources are specified in the filename parameters of DIALOG ADD commands for BITMAP, ICON, TSAKICON 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.)

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.

The #RESOURCE directive allows you to specify files that are to be linked into the executable file as resources.

When the resource is used in a DIALOG ADD, DIALOG SET or LIST LOADFILE command, the filename must be prefixed by a '#' character.

Note that the resource identifier is normally generated by taking the first eight characters of the filename, not including the directory path or the extension. Windows places an 8-character limit on resource identifiers. Therefore you should ensure that your resource filenames will generate unique identifiers.

An identifier different from the filename may optionally be specified as an additional parameter. This is not generally advisable. When running a script in the IDE, the linked resource does not exist so it is accessed from its original file. Consequently, the filename must be used in the command that accesses the resource, prefixed by a '#' to show that the resource is to be linked when the executable is made. The ability to specify an identifier is supported for internal use and documented for possible future use by extensions.

The resource type MANIFEST is also supported and is used internally to add a Windows XP manifest to the compiled executable file.

Any resource type other than ANIICON, BITMAP, CURSOR, HTML, ICON, STRING or TEXT is treated as a user-defined resource type. The resource will be an exact copy of the file on disk. Image files to be opened using the IMAGE dialog element should be compiled using the user-defined resource type IMAGE.