- #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.
Unlike labels, commands need not start in the first character position. It is recommended that they are indented using spaces for readability. Commands are built into the DialogScript language, or may be added using extensions. DialogScript 5 also allows user defined commands.
A command consists of the command name (see Command Reference) followed optionally by a string. The string is used as the argument (or parameters) to the command. Many commands have only a single argument, but others have more than one, in which case commas are used to separate the parameters. A space must separate the command from the first parameter. Commands are not case-sensitive.
Here are some examples of commands:
TITLE My first script
INIFILE WRITE,Reg_Info,UserName,Fred Bloggs
Strings may include variable and function references, which are evaluated before the command is carried out.
Dialog elements are things like buttons, input boxes and list boxes that are placed on a window or dialog and allow the user to receive information and interact with a script program. They are created using DIALOG ADD commands. Parameters to these commands specify the type of dialog element, its name (which is used to refer to the dialog element in the program) and the information needed to create the element, such as its position and size.
The < name> parameter is mandatory. Most dialog elements also require at least the top and left position co-ordinates to be specified. Many of the remaining parameters are optional, and may be left as null or omitted; when omitted, DialogScript will use suitable defaults. Position co-ordinates are relative to the client area of the dialog window.
Most dialog elements have parameters, which are appended to element name. The parameters are separated by commas. The < name> parameter, where required, is mandatory and is used to identify the individual dialog element. Most of the remaining parameters are optional, and may be left as null or omitted; when omitted, DialogScript will use suitable defaults. With most dialog elements you will usually want to specify at least the top and left position co-ordinates. Position co-ordinates are relative to the client area of the dialog window.
DialogScript contains a over 100 functions, (see Function Reference) which are evaluated at run time and return a string containing information. Extra functions may be added by means of extensions. DialogScript 5 also allows user user defined functions.
Functions start with an @ symbol followed by the function name. The argument(s) to the function are in the form of a string enclosed in parentheses. The parentheses must be present even if the function takes no arguments. For functions that take more than one argument the arguments are separated by commas.
Here are some examples of functions:
%A = @ASK(Do you want to continue?)
%A = @EQUAL(%F,WIN.INI)
Note that because the @ symbol is used to identify functions you cannot use it for any other purpose (such as in text) unless it is enclosed within double quotes.
Script programs can be tested instantly using the development environment. You can then create an executable file [not in the demo version] which can be run just like any other Windows application. Executable files created by Visual DialogScript, and its required run-time files, may be distributed free of any royalties. If you're creating programs for Internet distribution then note that the Visual DialogScript run-time files are smaller than those of any other comparable development system.
Using Visual DialogScript you can create programs that run entirely silently, in the background, programs that use a console window, and Windows programs that have a graphical user interface (GUI.) Most GUI DialogScript programs have a fixed-size main window or dialog (hence the name) but with a little extra code you can create programs whose windows are resizable.
The user interface of a GUI program is created using DialogScript code. You can write this code yourself, or use the Dialog Designer to design the program interface visually (this explains the visual part of the name.) When you're done with the Dialog Designer, it generates the code to create your design. And as long as you don't manually change this code too much, you can always use the Dialog Designer to edit it.