OPTION |
|
| Top Previous Next | |
Syntax:
OPTION CENTURYWINDOW,nn
OPTION COLORDLG,<mode>
OPTION DATEFORMAT, <short format>
OPTION DATESEP, <separator>
OPTION DECIMALSEP, <separator>
OPTION ERRORTRAP, <label>
OPTION FIELDSEP, <separator character>
OPTION FILENAMES, <SHORT|LONG>
OPTION FONTDLG, <mode>
OPTION LANGUAGE, <language>
OPTION MSGEVENT, <message no>, <event name> {,HANDLED}
OPTION PRIORITY, <IDLE|NORMAL|HIGH|REALTIME>
OPTION REGBUF, <buffer-size>
OPTION REGKEY,<new_default_key>
OPTION SCALE, <pixels-per-inch>
OPTION SHUTDOWN, <label>
OPTION SKDELAY, <interval>
OPTION SLEEPTIME, <interval>
OPTION TIMESEP, <separator>
OPTION TIPTIME, <delay>
OPTION TIPWIDTH, <width> [VDS6]
Description:
The OPTION command is used to set various parameters that affect execution of a script. If the parameter value is missing the option is reset to the default.
OPTION CENTURYWINDOW lets you specify a different start year for the 100 year window for two digit year numbers which will run from 19nn to 20nn-1. Numbers >= nn have 1900 added, < nn have 2000 added. So if you make nn 100, all years will be 21st century.
OPTION COLORDLG lets you decide the format for specifying colors when using the color box dialog. Possible modes are:
NORMAL |
(default) Use color names or hex values not prefixed by '#' |
WEBONLY |
Use color names or hex values prefixed by '#' as in HTML |
HEXONLY |
Use standard VDS hex format (numbers prefixed by '$') |
RGBONLY |
Use RGB values separated by '|' |
This option also allows the appearance of the color box itself to be set:
AUTO |
Allows the user to select custom colors |
CUSTOM |
Forces the color dialog to always open the custom colors panel |
NOCUSTOM |
Disable the selection of custom colors |
OPTION DATEFORMAT sets the short date format string used within the script. It is necessary for correct operation of the @datetime() function if hard-coded dates are present in the script, or if the script will process strings containing dates that may not be in the same format as the Windows system settings, which is the format that is used by default.
OPTION DATESEP sets the date separator character that will be used when dates are interpreted by the @datetime() or @timer() functions, or the TIMER command. Errors may occur if the system settings differ from those used in hard-coded dates in the script.
OPTION DECIMALSEP is used to force a specific decimal separator to be a period, e.g. OPTION DECIMALSEP,"." This option should be used if there are any floating point numeric constants in the script. If it is not, then numeric values will be interpreted according to the Windows regional settings (for example, a separator of a comma would be expected in many European countries) so a script that worked in one country would fail in another. This is such a common fault that the compiler will show a warning about it. Note: Numeric values with commas as a decimal separator should have quotes round them if they are used in a script. Commas are treated by the interpreter as parameter separators, so if a value is written with a comma as a decimal separator the interpreter will treat the number as two separate integers.
OPTION ERRORTRAP lets you define a label which execution will branch to if a run-time error occurs. If the <label> parameter is omitted, error trapping is turned off.
OPTION FIELDSEP sets the field separator to be used by the PARSE command when it splits a string up into its separate fields. The default is the vertical bar (|).
OPTION FILENAMES lets you specify whether the filenames returned by the LIST ... DROPFILE command are short or long filenames. It is usually better to use short filenames if you will be passing filenames to a DOS program.
OPTION FONTDLG allows the appearance of the font dialog to be defined. The options are:
STANDARD |
(default) Do not show extra attributes such as STRIKE and UNDERLINE. |
EXTENDED |
Show extra attributes such as STRIKE and UNDERLINE. |
OPTION LANGUAGE changes the value returned by the @SYSINFO(LANGUAGE) function, overriding the value derived from Windows settings, in order that the behavior of a script in different language environments can readily be tested.
OPTION MSGEVENT causes an <event name> event to be generated when a window message <message no> is sent to the application window. The optional HANDLED parameter specifies whether the message should be passed on to the program's internal message handling or not. If a message is not a user defined message then not passing it on is likely to have undesirable results. For efficiency reasons, the maximum number of messages that can be specified to generate events is limited to 4. Note: This option is for advanced users only. An understanding of Windows messasge processing is required to use it.
OPTION PRIORITY lets you set the priority level of the program. If IDLE, the program runs only if the system is idle, which is a good choice for scripts that are intended to run in the background. NORMAL is the priority level that all programs run at by default. HIGH and REALTIME are higher priority levels and should be used with care, if at all, as they may cause problems by giving your program a higher priority than Windows system functions.
OPTION REGBUF lets you specify the size of the buffer used when reading and writing registry key entries using the REGISTRY command and @REGREAD function. The default size is 256 bytes, which is large enough for most purposes. Registry keys can be much larger, though, in which case you will need to use this option to make the buffer larger.
OPTION REGKEY defines the registry key root to be used when DEFAULT is specified in the REGISTRY command and @REGREAD function. If not changed by this option the default registry key root is HKCU\Software\Commercial Research\VDS\<version>\User Scripts\<scriptname>\. The option prepends 'Software\' to <new_default_key>, and appends a '\', so <new_default_key> should be something like 'MyCompany\MyApp'. The purpose of this option is to allow script writers to use their own registry key root without having to specify the full path in each registry command or function call. However, if scripts are for your own use there is nothing wrong with using the default setting.
OPTION SCALE is used to make a dialog scale itself when different font sizes are used. The value in <pixels-per-inch> should be the same value given by @SYSINFO(PIXPERIN) on the system on which the dialog was designed (see Screen Metrics.) This value is determined by the font size chosen in Control Panel Display Settings. The standard setting is Small Fonts, which gives a value of 96 pixels per inch. If the value on the user's system is different from the value specified in this option then the size of the dialog and the position and size of dialog elements will be scaled to display the correct proportions with the font size chosen.
OPTION SHUTDOWN specifies a label from which execution will continue when the script receives a Windows shutdown notification. By default this is CLOSE.
OPTION SKDELAY specifies a delay, in milliseconds, between sending characters using the WINDOW SEND command, if this is required for more reliable sending. The default is 10ms.
OPTION SLEEPTIME specifies the interval, in milliseconds, that a DialogScript program suspends itself while executing a WAIT command. The default is 50ms. Increasing this value to, say, 500, would reduce the system overhead of a script that simply waits in the background, but would give poor performance when users interact with a dialog. Where a faster response is required, the value may be reduced.
OPTION TIMESEP set the time separator character that will be used when times are interpreted by the @datetime() or @timer() functions, or the TIMER command. Errors may occur if the system settings differ from those used in hard-coded dates in the script.
OPTION TIPTIME specifies the time that tooltips are displayed before automatically closing to be specified (in seconds). The default is 3.
[VDS6] OPTION TIPWIDTH specifies the maximum width of tooltips, in pixels. The default is 320.
OK:
Unchanged.
Example:
OPTION FILENAMES,SHORT
OPTION SLEEPTIME,200