Customer Login

Creating NT services

Visual DialogScript can create programs that run as a service under Windows NT family operating systems. Services are programs that start when Windows starts, and stop when Windows closes down.

Making CGI applications

DialogScript can be used to create CGI programs. The WRITE CONSOLE command is used to write lines of HTML text which are sent by the web server to the web browser.

XML Documents

DialogScript has special support for XML documents!

Syndicate

Syntax

Unlike other programming languages, the syntax of DialogScript is very simple. Each command occupies one line, and has a plain English name that clearly describes its purpose. Variables are typeless, and can hold many kinds of information, for example, numbers or text. Functions are clearly distinguishable with names that start with '@', just like a spreadsheet.

The DialogScript language has a simple syntax not unlike MS-DOS batch language. It is designed for ease of use and efficiency when being interpreted by the run-time engine. There are 10 system variables, %0 to %9, which initially have the script file name in %0 and command line parameters in %1 through %9, just as in a batch file. There are also a further 26 user variables, %A to %Z. The contents of all variables (including system ones) can be changed once the script is running. There are now also 4032 global variables. These variables begin with %%, a letter, then alphanumerics plus underscores (e.g. %%my_variable_1.) There is no limit on the length of these user-defined variable names.

Read more...

Dialog Capabilities

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.

Read more...

Dialog Elements

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.

Read more...

Commands

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. 

Read more...

Functions

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.        

Read more...

Compiler

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.
Read more...
Dialog Capabilities PDF Print E-mail

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.

Last Updated ( Thursday, 20 December 2007 )
 
< Prev   Next >