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.

DialogScript allows you to create multiple dialog windows which function as window for your script application.  Dialog windows may contain a number of controls, such as text controls and a status panel for displaying captions and other information, and edit controls, check boxes and list boxes which can not only display information but allow interaction with the user, plus buttons and menus which tell you when to process information by generating events.

You create a dialog using the DIALOG CREATE command.  You can design the dialog interactively using the dialog designer , which will then generate the correct DialogScript code to create the dialog.  The dialog must include buttons which users can press when they want the script to do something with the information in the dialog.

Note that the language makes it possible to write more sophisticated programs in which conditional statements and/or calculations are performed between the DIALOG CREATE and the DIALOG SHOW to vary the appearance of the dialog in real-time.

HOWEVER (** important!! **) the Dialog Designer can only create simple dialogs consisting of DIALOG CREATE, a number of DIALOG ADD lines, and DIALOG SHOW, where all the arguments to these commands are constants. More important still, the Dialog Designer can only edit such dialogs. So, if you use the full flexibility of the language to do calculations or execute conditional statements within the definition of a dialog, you will lose the ability to edit the dialog with the Dialog Designer. If you try to do so, the Dialog Designer might lose some of the other commands, or crash.

You can create more than one dialog. The first one, ID 0 (zero), is the application's main window. Once created, it will not close until the program terminates. When you process the CLOSE event for this dialog you should save any information and go to the EXIT or STOP command. Other dialogs we will call child dialogs.

Subsequent dialogs can be created and closed at will. DIALOG commands (and also LIST commands and functions that refer to LIST or COMBO dialog elements) refer to the active dialog. If the name of a dialog element on a different dialog is used, you will get a fatal error. To allow a particular dialog to be specified, you can use the DIALOG SELECT command.

When you close a child dialog, either by clicking its Close button or by executing a DIALOG CLOSE command, it does not close straight away. A CLOSE event is generated. A script can respond to this event by saving information in the dialog, then issuing another DIALOG CLOSE which this time closes the dialog.

Because events can have the same name, no matter which dialog generated them, the @EVENT function has been enhanced so you can obtain the dialog ID. Programming with multiple dialogs is quite difficult so it is best to examine the simple examples that show how it is done.

When a button is pressed it generates an event.  For a user-defined button the name of the event is the name of the button followed by BUTTON; for example, when the OK button is pressed an OKBUTTON event occurs.  The dialog close button (and selecting Close from the system menu) generates a CLOSE event.  Other examples of events are the DRAGDROP event, which occurs if the dialog window is drag and drop enabled and files are dragged to the window, and the CLICK event which occur when the mouse is clicked over certain controls.  See Events for more information.
There are two ways to process events.  You can use WAIT EVENT.  This halts the script entirely until an event occurs.  When it does, you can test it using the @EVENT function, carry out whatever processing is required, and if appropriate loop back to the WAIT EVENT command to wait for the next event.

If you require your script to do other work while the dialog is displayed then you can simply test @EVENT regularly: it will return null if no event has occurred.  If your script needs to respond to events as well as doing some processing on a regular basis you can use WAIT EVENT,<n>, which in addition to dialog events will generate a TIMER event every n seconds.

The dialog will remain until the program terminates, when the final EXIT command is executed.

The simplest way to write a dialog-based DialogScript program is to use the Application Wizard.  This lets you design the dialog using the dialog designer and then generates a skeleton program with labels for all the possible events.  All you need do is write the code to respond to each event.