Seed: numeric (optional) The seed value that starts the random number generator. If missing, the current system clock is used to pick a starting seed.
numeric := RandomNumber
Syntax
([Minimum: numeric]; [Maximum: numeric])
Description
Get a random number in a range.
If only a Minimum or Maximum value is given (see Parameters), a number between 0.0 and that value is returned. The range includes 0.0; it does not include the value. If no values are given, a number between 0.0 and 1.0 is returned. The range includes 0.0; it does not include 1.0.
Minimum: numeric (optional) The minimum number to generate. Default: 0.0
Maximum: numeric (optional) The maximum number to generate. Default: 1.0
numeric := RandomSeed
Syntax
()
Description
Get the current seed of the random number generator.
Return Value
Value of the random seed. This seed is used to generate the next random number, after which the random seed is updated to a new value.
numeric := RandomStats
Syntax
([Statistic: enumeration])
Description
This command returns statistical information about the random numbers that have been generated.
Return Value
The requested statistic is returned.
Parameters
Statistic:
enumeration The statistic to return.
Count! Return the count of random numbers generated so far.
Minimum! Return the minimum random number generated so far.
Maximum! Return the maximum random number generated so far.
Mean! Return the average of the random numbers generated so far.
StdDev! Return the standard deviation of the random numbers generated so far.
Variance! Return the variance of the random numbers generated so far.
Total! Return the total of all the random numbers generated so far.
Seed! Return the seed to be used to generate the next random number.
numeric := Real
Syntax
(<Value> numeric)
Description
Pass a value as an 8-byte float (DLL call in-line parameter function and OLE type casting function). See DLLCall and OLE Automation.
numeric := RegionAddListItem
Example
Syntax
(NamedRgn: string; {Item: string})
Description
Add an item to a list box, combination box, pop-up button, or custom control.
The only way to add a list item to a custom control is with RegionAddListItem, or by sending the custom control a message. DialogAddListItem does not work on custom controls.
Controls added with DialogAddControl are considered custom controls. The user is responsible for the use of these controls.
Return Value
Index (position) of the added item, or the index of the last item in a repeating group if successful, or -1 if not.
Parameters
NamedRgn: string Dialog ID and control ID, or Dialog ID and name of a named region, or window handle of the named region. Enclose IDs in double quotation marks, separated by a period.
Item: string (repeating parameter) One or more list items separated by a semicolon.
numeric := RegionAddListItemByIndex
Syntax
(NamedRgn: string; Item: string; Index: numeric)
Description
Add an item to a list box, combination box, pop-up button, or custom control, at a specified index. Indexes are 1 based.
The only way to add a list item to a custom control is with RegionAddListItem or RegionAddListItemByIndex, or by sending the custom control a message. DialogAddListItem does not work on custom controls.
Controls added with DialogAddControl are considered custom controls. The user is responsible for the use of these controls.
Return Value
The index (position) of the added item. Indexes are 1 based.
Parameters
NamedRgn: string Dialog ID and control ID, or Dialog ID and name of a named region. Enclose IDs in double quotation marks, separated by a period.
Item: string The item to add.
Index: numeric The index (position) where to add an item. Indexes are 1 based.
enumeration := RegionEnableWindow
Example
Syntax
(NamedRgn: string; [State: enumeration])
Description
Enable or disable mouse and keyboard input to a dialog box or control.
Return Value
If State is specified, return the previous state of the named region.
Enabled! Named region was enabled.
Disabled! Named region was disabled.
If State is left off, return the current state of the named region.
Parameters
NamedRgn: string Dialog ID and control ID, or Dialog ID and name of a named region, or window handle of the named region. Enclose IDs in double quotation marks, separated by a period. If a control ID is not specified, State affects the entire dialog box.
State: enumeration (optional) Set mouse and keyboard input state. If left off, the current state of the named region is returned.
Disable! Disable named region.
Enable! Enable named region.
enumeration := RegionGetCheck
Example
Syntax
(NamedRgn: string)
Description
Report the state of a check box control.
Return Value
Up!
Down!
Checked!
Unchecked!
Indeterminate!
Gray! Same as Indeterminate!.
Parameters
NamedRgn: string Dialog ID and control ID, or Dialog ID and name of a named region, or window handle of the named region. Enclose IDs in double quotation marks, separated by a period.
numeric := RegionGetChildCount
Syntax
(NamedRgn: string)
Description
Returns the count of the child controls that belong to the specified region. A list of child windows can be retrieved by calling the RegionGetHandle command with an Index parameter from 1 to the value to be returns by this command.
Return Value
The count of child windows. Returns 0 if there was an error or if there are no child windows.
Parameters
NamedRgn: string Dialog ID and control ID, or Dialog ID and name of a named region. Enclose IDs in double quotation marks, separated by a period.
numeric := RegionGetFocus
Description
Return the window handle of the region that currently has focus.
Return Value
The window handle of the window with focus.
string := RegionGetClass
Example
Syntax
(NamedRgn: string)
Description
Return the class name (Windows) of a named region.
Return Value
Windows class name.
Parameters
NamedRgn: string Dialog ID and control ID, or Dialog ID and name of a named region. Enclose IDs in double quotation marks, separated by a period.
numeric := RegionGetHandle
Example
Syntax
(NamedRgn: string [; Index enumeration)
Description
Return the window handle of a named region.
Return Value
If the named region does not exist, use OnError to handle error message.
Parameters
NamedRgn: string The Dialog ID and control ID, or Dialog ID and name of a named region. Enclose IDs in double quotation marks, separated by a period.
If the control ID is not specified, the Window handle of the dialog box is returned.
Index: enumeration [optional] Lets you specify which handle to retrieve. If this parameter is omitted, RegionGetHandle uses the Self! enumeration.
Parent! Return the handle of the parent of this region.
Self! Return the handle of this region.
Child! A base value that you add to a numeric 1 based index to return the handle of the specified child. The valid values are 1 to the return value of the RegionGetChildCountcommand.
numeric := RegionGetID
Syntax
([NamedRgn: string])
Description
This command returns the window control ID of this region within its parent.
Return Value
The window control ID. Returns 0 if it has no control ID.
Parameters
NamedRgn: string The named region to access.
string := RegionGetListContents
Syntax
(NamedRgn: string; [ItemSeparator: string])
Description
Retrieve all the items in a specified list control.
Return Value
Text of items separated by the item separator.
Parameters
NamedRgn: string Dialog ID and control ID, or Dialog ID and name of a named region (list control). Enclose IDs in double quotation marks, separated by a period.
ItemSeparator: string (optional) String used to separate items in the return value. If missing, ";" is used.
numeric := RegionGetListCount
Example
Syntax
(NamedRgn: string)
Description
Return the number of items in a list or combo box, or pop-up button.
Parameters
NamedRgn: string The Dialog ID and control ID, or Dialog ID and name of a named region, or window handle of the named region. Enclose IDs in double quotation marks, separated by a period.
numeric := RegionGetListItem
Syntax
(NamedRgn: string; Item: string)
Description
Return the index of an item in a list control.
Return Value
Index (position) of a list item, or -1 on error.
Parameters
NamedRgn: string Dialog ID and control ID, or Dialog ID and name of a named region. Enclose IDs in double quotation marks, separated by a period.
Item: string The list item.
string := RegionGetListItemByIndex
Syntax
(NamedRgn: string; Index: numeric)
Description
Return an item from a list control by its index.
Return Value
List item text.
Parameters
NamedRgn: string Dialog ID and control ID, or Dialog ID and name of a named region. Enclose IDs in double quotation marks, separated by a period.
Index: numeric The index (position) of a list item.
numeric := RegionGetListSelectedCount
Syntax
(NamedRgn: string)
Description
Return count of the selected items in a list box, combination box, or custom control.
Return Value
The number of selected items.
Parameters
NamedRgn: string Dialog ID and control ID, or Dialog ID and name of a named region. Enclose IDs in double quotation marks, separated by a period.
boolean := RegionGetModified
Example
Syntax
(NamedRgn: string)
Description
Determine whether an edit control's contents have been modified (DialogAddCounter, DialogAddDate, DialogAddEditBox, DialogAddFilenameBox). See RegionSetModified.
Return Value
True if an edit control has been modified, False if not.
Parameters
NamedRgn: string The Dialog ID and control ID, or Dialog ID and name of a named region, or window handle of the named region. Enclose IDs in double quotation marks, separated by a period.
string := RegionGetName
Syntax
(NamedRgn: string)
Description
This command returns the region name of the specified region. This command now works for named regions of other WordPerfect Suite applications.
Return Value
The name of the region. If the region does not belong to a user-defined macro dialog, "" is returned.
Returns size and position information about a named region. Missing optional parameters are not returned.
Return Value
True if the specified region exists, False if not.
Parameters
NamedRgn: string Dialog ID and control ID, or Dialog ID and name of a named region. Enclose IDs in double quotation marks, separated by a period.
LeftVar: variable (optional) Variable to receive the coordinate of the left edge of the region.
TopVar: variable (optional) Variable to receive the coordinate of top edge of the region.
WidthVar: variable (optional) Variable to receive the width of the region.
HeightVar: variable (optional) Variable to receive the height of the region.
Units: enumeration (optional) Type of units to return the measurements in. If missing, and the region is a region on a macro dialog, DialogUnits! is used. Otherwise, if missing, ScreenUnits! is used.
ScreenUnits! Values are returned in screen units (pixels) relative to the region's parent.
DialogUnits! Values are returned in dialog units relative to the region's parent.
Note
If you specify DialogUnits! as the value of the Units parameter, the specified region must be a dialog. If you specify ScreenUnits! as the value of the Units parameter, the region specified may be a dialog or a non-dialog type of window.
numeric := RegionGetOrder
Syntax
([NamedRgn: string])
Description
This command returns the 1-based order of this region within its parent.
Return Value
The order of this region. If this region has no parent, 0 is returned.
Parameters
NamedRgn: string The named region to access.
string := RegionGetSelectedText
Example
Syntax
(NamedRgn: string; [ItemSeparator: string])
Description
Returns selected text in a control such as a list box, combination box, or counter. To return a control's full text use RegionGetWindowText.
Return Value
Selected text. If no text is selected, an empty string ("") is returned.
Parameters
NamedRgn: string Dialog ID and control ID, or Dialog ID and name of a named region, or window handle of the named region. Enclose IDs in double quotation marks, separated by a period.
ItemSeparator: string (optional) A string to insert between sub-string items. If missing, a semicolon is used.
numeric := RegionGetStyle
Syntax
([NamedRgn: string]; [StyleWord: enumeration])
Description
This command returns the specified style word for the specified named region.
Parameters
NamedRgn: string The named region to access.
StyleWord:
enumeration The style word to receive. If missing, Styles! is used.
Styles! Returns the styles that are specified by the Style/Option parameters of the DialogDefine and DialogAdd statements.
WindowsStyles! The Windows styles.
WindowsExStyles! The Windows extended styles.
string := RegionGetWindowText
Example
Syntax
(NamedRgn: string)
Description
Get caption bar, static text, or edit box text.
Return Value
Specified text.
Parameters
NamedRgn: string Dialog ID and control ID, or Dialog ID and name of a named region, or window handle of the named region. Enclose IDs in double quotation marks, separated by a period. To get the caption bar text, leave off the Control ID or named region. For example, vText := RegionGetWindowText ("Dialog1").
enumeration := RegionGetType
Syntax
(NamedRgn: string)
Description
This command returned the type of a specified region.
Return Value
The region type.
Dialog!
Bitmap!
Button!
CheckBox!
ColorWheel!
ComboBox!
Counter!
Custom! Custom control type.
DateField!
EditField!
FileNameField!
Frame!
GroupBox!
Hline! Horizontal line.
HotSpot!
HScrollBar!
Icon!
ListBox!
NameSearchListBox!
PopDownButton!
PopUpButton!
Progress!
PushButton!
RadioButton!
RecessedTextBox!
ScrollBar!
ShadowTextBox!
StaticText!
StaticPath!
TimeField!
Viewer!
Vline!
VScrollBar!
WPComboBox!
WPEditField!
WPListBox!
WPRecessedTextBox!
WPShadowTextBox!
WPStaticText!
Unknown!
Parameters
NamedRgn: The named region to access.
string := RegionGetVariable
Syntax
(NamedRgn: string)
Description
This command returns the name of the associated macro variable for the specified named region.
Return Value
The name of the associated variable. If the named region is not a user-defined macro dialog, it has no associated variable and "" is returned.
Parameters
NamedRgn: string The named region to access.
boolean := RegionIsEnabled
Syntax
(NamedRgn: string)
Description
Indicates whether a specified region is enabled.
Return Value
True if the named region is enabled, False if not.
Parameters
NamedRgn: string Dialog ID and control ID, or Dialog ID and name of a named region (list control). Enclose IDs in double quotation marks, separated by a period.
boolean := RegionIsVisible
Example
Syntax
(NamedRgn: string)
Description
Determine the visibility state of a region or window.
Return Value
True if visible, False if not. Window's WS_VISIBLE flag determines the return value, which can be nonzero even if the window is hidden by other windows. See your Windows 95 documentation for more information.
Parameters
NamedRgn: string The Dialog ID and control ID, or Dialog ID and name of a named region, or window handle of the named region. Enclose IDs in double quotation marks, separated by a period.
NamedRgn: string Dialog ID and control ID, or Dialog ID and name of a named region, or window handle of the named region. Enclose IDs in double quotation marks, separated by a period. To move or resize the dialog box, leave off the Control ID or named region. For example, RegionMoveWindow ("Dialog1"; ...)
Left: numeric (optional) The number of dialog units from the left side of the screen to the left side of the dialog box, or the number of dialog units from the left side of the dialog box to the left side of the control. If missing, no change is made.
Top: numeric (optional) The number of dialog units from the top of the screen to the top of the dialog box, or the number of dialog units from the top of the dialog box to the top of the control. If missing, no change is made.
Width: numeric (optional) The width of the dialog box or control in dialog units. If missing, no change is made.
Height: numeric (optional) The height of the dialog box or control in dialog units. If missing, no change is made.
Units: enumeration (optional) Specifies the type of units used by Left, Top, Width, and Height parameters. If missing, AbsolutePosition! is used with units appropriate to the windows type. If the window is a named region on a user-defined dialog, DialogUnits! is used. Otherwise, if missing, ScreenUnits! is used.
AppropriateUnits!
ScreenUnits!
DialogUnits! Left, Top, Width, and Height are specified in dialog units (the same units used to create the user dialog).
AbsolutePosition! Left, Top, Width, and Height are absolute positions and sizes. (Window position is always relative to its parent.)
RelativePosition! Left, Top, Width, and Height are relative to the current position and size of the window.
Note
If you specify DialogUnits! as the value of the Units parameter, the specified region must be a dialog. If you specify ScreenUnits! as the value of the Units parameter, the region specified may be a dialog or a non-dialog type of window.
RegionRemoveListItem
Example
Syntax
(NamedRgn: string; Item: string)
Description
Remove a list item from a list box, combination box, or pop-up button. Exact match items are removed before partial match items.
Parameters
NamedRgn: string The Dialog ID and control ID, or Dialog ID and name of a named region, or window handle of the named region. Enclose IDs in double quotation marks, separated by a period.
Item: string A list item.
RegionRemoveListItemByIndex
Syntax
(NamedRgn: string; Index: numeric)
Description
Remove an item from a list control by its index.
Parameters
NamedRgn: string Dialog ID and control ID, or Dialog ID and name of a named region. Enclose IDs in double quotation marks, separated by a period.
Index: numeric The index (position) of a list item.
RegionResetList
Example
Syntax
(NamedRgn: string)
Description
Clear the contents of a list box, combination box, or pop-up button.
Parameters
NamedRgn: string The Dialog ID and control ID, or Dialog ID and name of a named region, or window handle of the named region. Enclose IDs in double quotation marks, separated by a period.
Select an item in a list box, combination box, or pop-up button.
Return Value
Return the index (1-based) of the selected item.
Parameters
NamedRgn: string Dialog ID and control ID, or Dialog ID and name of a named region, or window handle of the named region. Enclose IDs in double quotation marks, separated by a period.
Item: string A list item.
Selection: enumeration (optional) Selection options. If missing, Extend! is used. For single selection lists, Extend! works the same as Select!.
Select! Unselect all selected items, and select this item.
Unselect! Unselect this item from the current selection.
Extend! Extend the current selection to include this item.
This token replaces RegionSetBitmapFilename, and adds the ability to use a bitmap in a DLL or EXE.
Parameters
NamedRgn: string Dialog ID and control ID, or Dialog ID and name of a named region. Enclose IDs in double quotation marks, separated by a period.
Filename: string The filename of a bitmap, or the filename of a DLL or EXE containing a bitmap.
Name: string (optional) The Resource ID, or name of a bitmap in a DLL or EXE (see the Filename parameter). IDs must begin with #.
RegionSetCheck
Example
Syntax
(NamedRgn: string; State: enumeration)
Description
Select/deselect a check box.
Parameters
NamedRgn: string Dialog ID and control ID, or Dialog ID and name of a named region, or window handle of the named region. Enclose IDs in double quotation marks, separated by a period.
State: enumeration Sets the state of a check box control.
Checked! (Named Check! in version 7.)
Unchecked! (Named Uncheck in version 7.)
Gray! Check box control must be Three-state or Auto three-state. See DialogAddCheckBox.
Select the text or a portion of text in a text edit control.
Parameters
NamedRgn: string Dialog ID and control ID, or Dialog ID and name of a named region. Enclose IDs in double quotation marks, separated by a period.
Start: numeric (optional) The start index (position) of the text to select. If missing, all the text is selected.
End: numeric (optional) The end index (position) of the text to select. If missing, all the text is selected.
numeric := RegionSetFocus
Example
Syntax
(NamedRgn: string)
Description
Give input focus to a specified control.
Return Value
Window handle of the region that used to have focus, or NULL if not successful.
Parameters
NamedRgn: string
(optional) The Dialog ID and control ID, or Dialog ID and name of a named region, or window handle of the named region. Enclose IDs in double quotation marks, separated by a period. If this parameter is missing, the focus is ot moved to a new region, but remains where it is, and current focus is returned.
RegionSetModified
Example
Syntax
(NamedRgn: string; [State: enumeration])
Description
Set the modified state of an edit control (DialogAddCounter, DialogAddDate, DialogAddEditBox, DialogAddFilenameBox). See RegionGetModified.
Parameters
NamedRgn: string Dialog ID and control ID, or Dialog ID and name of a named region, or window handle of the named region. Enclose IDs in double quotation marks, separated by a period.
State: enumeration (optional) If missing, Modified! is used.
Modified!
NotModified!
RegionSetProgressPercent
Example
Syntax
(NamedRgn: string; Percent: numeric)
Description
Set the percentage to display in a progress control. See DialogAddProgress.
Parameters
NamedRgn: string The Dialog ID and control ID, or Dialog ID and name of a named region, or window handle of the named region. Enclose IDs in double quotation marks, separated by a period.
Percent: numeric The percentage to set.
RegionSetTabStops
Syntax
([NamedRgn: string]; [Tab: numeric])
Description
This command sets the tab stops in a named region. Only certain types of regions support tab stops (i.e. listboxes) and will have no effect on other region types. The region must also have been defined with the UseTabStops! Style, or the tab stops will be ignored.
Parameters
NamedRgn: string The name of the named region to set the tab stops from..
Tab:
numeric The list of tab stops to apply to the listbox. These tab stops must be in ascending order or the results will be unpredictable. If this parameter is left off, the tab stops are set to a value of every 2 dialog units for the entire width of the control. If there is only one tab stop specified, all tab stops are set to this spacing for the entire width.
RegionSetSelectedText
Syntax
(NamedRgn: string; Item: string)
Description
Set the selected text of a named region.
Parameters
NamedRgn: string Dialog ID and control ID, or Dialog ID and name of a named region. Enclose IDs in double quotation marks, separated by a period.
Item: string The item to select.
RegionSetWindowText
Example
Syntax
(NamedRgn: string; Item: string)
Description
Replace caption bar, static text, or edit box text.
Parameters
NamedRgn: string The Dialog ID and control ID, or Dialog ID and name of a named region, or window handle of the named region. Enclose IDs in double quotation marks, separated by a period. To replace the caption bar text, leave off the Control ID or named region. For example, RegionSetWindowText ("Dialog1").
Item: string The replacement text.
RegionShowWindow
Example
Syntax
(NamedRgn: string; [State: enumeration])
Description
Show/hide a dialog box or control.
Parameters
NamedRgn: string Dialog ID and control ID, or Dialog ID and name of a named region, or window handle of the named region. Enclose IDs in double quotation marks, separated by a period. If you do not use the control ID, the command works on the dialog box.
State: enumeration (optional) The display state. If missing, Show! is used.
Prompt("RegistryEnumKey"; "RegistryEnumKey was "+EnumString+". RegistryQueryLastError was "+RegError+".")
Pause
Return Value
Subkey number.
Parameters
Hkey: numeric or enumeration Registry handle of an opened key. This is the key that was returned from RegistryOpenKey or RegistryCreateKey. See RegistryOpenKey command for a list of the predefined registry key enumeration values.
ClassesRoot! The HKEY_CLASSES_ROOT.
CurrentUser! The HKEY_CURRENT_USER.
LocalMachine! The HKEY_LOCAL_MACHINE.
Users! The HKEY_USERS.
PerformanceData! The HKEY_PERFORMANCE_DATA.
CurrentConfig! The HKEY_CURRENT_CONFIG.
DynData! The HKEY_DYN_DATA.
SubKeyNumber: numeric
Note
This command is not available for use on a Linux operating system.
string := RegistryEnumValue
Syntax
(Hkey: numeric or enumeration; ValueNumber: numeric)
Hkey: numeric or enumeration The registry key used to enumerate values. This is the key that was returned from the RegistryOpenKey or RegistryCreateKey.
ValueNumber: numeric
ClassesRoot! The HKEY_CLASSES_ROOT.
CurrentUser! The HKEY_CURRENT_USER.
LocalMachine! The HKEY_LOCAL_MACHINE.
Users! The HKEY_USERS.
PerformanceData! The HKEY_PERFORMANCE_DATA.
CurrentConfig! The HKEY_CURRENT_CONFIG.
DynData! The HKEY_DYN_DATA.
Note
This command is not available for use on a Linux operating system.
Handle of the opened key if successful, an error code if not.
Parameters
Hkey: enumeration Error! An error occurred opeing the specified key. This value was formerly a numeric value of 0.
ClassesRoot! Access HKEY_CLASSES_ROOT.
CurrentUser! Access HKEY_CURRENT_USER.
LocalMachine! Access HKEY_LOCAL_MACHINE.
Users! Access HKEY_USERS.
PerformanceData! Access HKEY_PERFORMANCE_DATA.
CurrentConfig! Access HKEY_CURRENT_CONFIG.
DynData! Access HKEY_DYN_DATA.
Access:
enumeration Specifies the access mode used for the Registry command on this key. I fmissing, the acess mode is the default for the platform that the macro is running on. (Win95 and Win98 do not support access rights to the Registry and all access attempts will work regardless of the access mode specified). If an attempt to access the key is made which required access that is not allowed by this parameter's value, this command will fail and generate an error.
ReadOnly! Items in this key will on only be read, not written
WriteOnly! Items in this key will only be written, not read from.
ReadWrite! Items in the key opened will be both read and written.
SubKey: string [optional] The sub key to open. If missing, or "", then the specified key itself is opened. Full path of subkey under HKey.
Note
This command is not available for use on a Linux operating system.
numeric := RegistryQueryKeyCount
Syntax
(Hkey: numeric)
Description
Get the count of subkeys under a key in the Windows Registry.
Hkey: numeric Key for which to return a count of the subkeys. This is the key that was returned from RegistryOpenKey or RegistryCreateKey. See the RegistryOpenKey command for a list of the predefined registry key enumeration values.
ClassesRoot! The HKEY_CLASSES_ROOT.
CurrentUser! The HKEY_CURRENT_USER.
LocalMachine! The HKEY_LOCAL_MACHINE.
Users! The HKEY_USERS.
PerformanceData! The HKEY_PERFORMANCE_DATA.
CurrentConfig! The HKEY_CURRENT_CONFIG.
DynData! The HKEY_DYN_DATA.
Note
This command is not available for use on a Linux operating system.
enumeration := RegistryQueryLastError
Syntax
()
Description
Return the last error code.
Example
RegKey:= RegistryQueryLastError()
Prompt("RegistryQueryLastError"; RegKey)
Pause
Return Value
The error code associated with the last executed Registry command. If the last command was successful, Success! is returned. Any other value is considered to be an error.
Parameters
Value:
enumeration Success! No error.
TokenError! Registry token error.
InvalidKey! Registry key invalid.
InvalidValue! Invalid value for registry.
NotFound! Registry key or value not found.
KeyMissing! Could not find the key in the registry.
BadIndex! On Reg.Enum...index was too large.
KeyOpenError! Configuration registry key could not be opened.
KeyReadError! Configuration registry key could not be read.
KeyWriteError! Configuration registry key could not be written.
FileIOError! Could not write registry file(s).
KeyDeleted! Illegal operation on a deleted registry key.
VolatileKey! Cannot create a stable subkey under a volatile parent key.
RegistryCorrupt! Registry or one of its files is corrupt.
UnknownError! Unknown (Uncatalogued) error.
Note
This command is not available for use on a Linux operating system.
any := RegistryQueryValue
Syntax
(Hkey: numeric or enumeration [; Value: string] [;Type: variable])
Hkey: numeric or enumeration The registry key in which to find a value. This is the key that was returned fro RegistryOpenKey or RegistryCreateKey. See the RegistryOpenKey command for a list of the redefined registry ey enumeration values.
ClassesRoot! The HKEY_CLASSES_ROOT.
CurrentUser! The HKEY_CURRENT_USER.
LocalMachine! The HKEY_LOCAL_MACHINE.
Users! The HKEY_USERS.
PerformanceData! The HKEY_PERFORMANCE_DATA.
CurrentConfig! The HKEY_CURRENT_CONFIG.
DynData! The HKEY_DYN_DATA.
Value: string [optional] The name of the value that is returned. If misssing or "", the value of the default value of the key is retrieved.
Type: variable (optional) The type of value is returned to this variable.
Note
This command is not available for use on a Linux operating system.
numeric := RegistryQueryValueCount
Syntax
(Hkey: numeric or enumeration)
Description
Return the count of values under a key in the Windows Registry.
Example
RegKey = RegistryOpenKey(LocalMachine!; "Software\Corel\PerfectScript\11\Location of Help Files")
QueryKey=RegistryQueryValueCount(RegKey)
Prompt("RegistryQueryValueCount"; QueryKey)
Pause
Return Value
Count of values under a Windows Registry key. On error, 0 is returned.
Parameters
Hkey: numeric or enumeration Key for which to return a count of the subkeys. This is the key that was returned from RegistryOpenKey or RegistryCreateKey. See the RegistryOpenKey command for a list of the predefined registry key enumeration values.
ClassesRoot! The HKEY_CLASSES_ROOT.
CurrentUser! The HKEY_CURRENT_USER.
LocalMachine! The HKEY_LOCAL_MACHINE.
Users! The HKEY_USERS.
PerformanceData! The HKEY_PERFORMANCE_DATA.
CurrentConfig! The HKEY_CURRENT_CONFIG.
DynData! The HKEY_DYN_DATA.
Note
This command is not available for use on a Linux operating system.
//CreateKey:= RegistryCreateKey(RegKey; "My SubKey")
SetKey := RegistrySetValue(RegKey; "My SubKey"; "Working"; PFString!)
Prompt("RegistrySetValue - PFString!"; "If RegistrySetValue was successful this should be a zero: "+SetKey;)
Pause
Example 2
CreateKey:= RegistryCreateKey(RegKey; "My Other SubKey")
SetKey:=RegistrySetValue(RegKey; "My Other SubKey"; "Really Working"; PFDWord!)
Prompt("RegistrySetValue - PFDWord!"; "If RegistrySetValue was successful this should be a zero: "+SetKey;)
Pause
Example 3
CreateKey:= RegistryCreateKey(RegKey; "My Other Other SubKey")
SetKey:=RegistrySetValue(RegKey; "My Other Other Key"; "It's Working"; DWord!)
Prompt("RegistrySetValue - DWord!"; "If RegistrySetValue was successful this should be a zero: "+SetKey;)
Pause
Return Value
The status of the call. If successful, Success! is returned. Otherwise, an error has occurred. See the RegistryQueryLast error command for a list of error enumerations. When an attempt to access an item belonging to this key is made, and the key was opened/created without the proper access mode, then the enumeration AccessDenied! Is returned.
AccessDenied! Returned when the current user does not have the proper access rights needed to access a specified registry key in the specified manner. For example, a non-administrator user will ge tthis return code when a key in LocalMachine! Is opened for WriteOnly! Or ReadWrite! Access, and then RegistrySetValue is called.
Parameters
Hkey: numeric or enumeration The registry key of which to set a value. This is the key that was returned from RegistryOpenKey or RegistryCreateKey. See the RefistryOpenKey command for a list of error enumerations.
ClassesRoot! The HKEY_CLASSES_ROOT.
CurrentUser! The HKEY_CURRENT_USER.
LocalMachine! The HKEY_LOCAL_MACHINE.
Users! The HKEY_USERS.
PerformanceData! The HKEY_PERFORMANCE_DATA.
CurrentConfig! The HKEY_CURRENT_CONFIG.
DynData! the HKEY_DYN_DATA.
Value: string [optional] The name of the value that is set. If missing or "", the default value of the key is set.
Data: any
Type: enumeration Binary! Free-form binary.
DWord! 32-bit number.
String! Null-terminated string.
ExpandableString! Null-terminated string with environment variable references.
PFBinary! Free-form binary.
PFDWord! 32-bit number.
PFString! Null-terminated string.
PFExpandableString!
PFWPString! WordPerfect word string.
PFByte! 8-bit number.
PFWord! 16-bit number.
PFBool! Boolean.
PFLogical!
Note
This command is not available for use on a Linux operating system.
Prompts! Prompt if the old file does not exist, or the path is incorrect.
Repeat
Example
Syntax
The general form of a Repeat statement is:
Repeat
...statement block...
Until (<Test> boolean)
Description
A loop statement that executes until the expression at the bottom of the loop is true.
The loop executes at least once, because it is not tested until the bottom of the loop. When <Test> is true, the first statement after Until is executed.
Parameters
<Test> boolean Evaluate to true or false.
You can use Return in the following ways:
Syntax 1
(<Condition> enumeration; [<Value> any])
Description 1
End Label, Function, and Procedure subroutines, or a macro (see Run), and then directs macro execution to the statement that follows the subroutine or macro's caller; or creates a Cancel, Error, or Not Found condition.
Return generally ends a Label statement called by statements such as Call or Case Call.
Call(StartMacro)
Call(QuitMacro)
Label(StartMacro)
... statement block...
Return // directs macro execution to Call(QuitMacro)
Label(QuitMacro)
Quit
If there is no caller to return to, and the macro containing Return is nested (called by another macro), Return directs macro execution to the statement that follows the macro's caller (see Run). Return ends a macro if there is no caller to return to, and the macro containing the Return statement is not nested.
Parameters 1
<Condition> enumeration (optional) Create a Cancel, Error, or Not Found condition (see Assert). <Condition> stops a macro unless preceded by OnCancel, OnError, or OnNotFound, which direct macro execution to a specified Label. <Condition> has no effect when preceded by Cancel(Off!), Error(Off!), or NotFound(Off!). The enumerations (return types) are:
CancelCondition! Stop a macro unless preceded by OnCancel.
ErrorCondition! Stop a macro unless preceded by OnError.
NotFoundCondition! Stop a macro unless preceded by OnNotFound.
<Value> any (optional) Return the result of a function operation (see Function).
Syntax 2
([<Value> any])
Description 2
End Label, Function, and Procedure subroutines, or a macro (see Run), and then directs macro execution to the statement that follows the subroutine or macro's caller.
Return generally ends a Label statement called by statements such as Call or Case Call.
Call(StartMacro)
Call(QuitMacro)
Label(StartMacro)
... statement block...
Return // directs macro execution to Call(QuitMacro)
Label(QuitMacro)
Quit
If there is no caller to return to, and the macro containing Return is nested (called by another macro), Return directs macro execution to the statement that follows the macro's caller (see Run). Return ends a macro if there is no caller to return to, and the macro containing the Return statement is not nested.
Parameters 2
<Value> any (optional) Return the result of a function operation (see Function).
Return
Example
Syntax
(<Condition> enumeration; [<Value> any])
Description
End Label, Function, and Procedure subroutines, or a macro (see Run), and then directs macro execution to the statement that follows the subroutine or macro's caller; or creates a Cancel, Error, or Not Found condition.
Return generally ends a Label statement called by statements such as Call or Case Call.
Call(StartMacro)
Call(QuitMacro)
Label(StartMacro)
... statement block...
Return // directs macro execution to Call(QuitMacro)
Label(QuitMacro)
Quit
If there is no caller to return to, and the macro containing Return is nested (called by another macro), Return directs macro execution to the statement that follows the macro's caller (see Run). Return ends a macro if there is no caller to return to, and the macro containing the Return statement is not nested.
Parameters
<Condition> enumeration (optional) Create a Cancel, Error, or Not Found condition (see Assert). <Condition> stops a macro unless preceded by OnCancel, OnError, or OnNotFound, which direct macro execution to a specified Label. <Condition> has no effect when preceded by Cancel(Off!), Error(Off!), or NotFound(Off!). The enumerations (return types) are:
CancelCondition! Stop a macro unless preceded by OnCancel.
ErrorCondition! Stop a macro unless preceded by OnError.
NotFoundCondition! Stop a macro unless preceded by OnNotFound.
<Value> any (optional) Return the result of a function operation (see Function).
Return
Syntax
([<Value> any])
Description
End Label, Function, and Procedure subroutines, or a macro (see Run), and then directs macro execution to the statement that follows the subroutine or macro's caller.
Return generally ends a Label statement called by statements such as Call or Case Call.
Call(StartMacro)
Call(QuitMacro)
Label(StartMacro)
... statement block...
Return // directs macro execution to Call(QuitMacro)
Label(QuitMacro)
Quit
If there is no caller to return to, and the macro containing Return is nested (called by another macro), Return directs macro execution to the statement that follows the macro's caller (see Run). Return ends a macro if there is no caller to return to, and the macro containing the Return statement is not nested.
Parameters
<Value> any (optional) Return the result of a function operation (see Function).
numeric or measurement := RoundOff
Syntax
(Value: numeric or measurement; [RoundTo: numeric or measurement])
Description
Get a value rounded to a value.
Example
vResult := RoundOff(12.63; 0.75)
Result: vResult equals 12.75
Return Value
Rounded value.
Parameters
Value: numeric or measurement The value to round off.
RoundTo: numeric or measurement (optional) The round value to the nearest multiple of this number. Default: 1.0
Run
Example
Syntax
(MacroFile: string; {[Parameter: any]})
Description
Call (start) a nested macro.
A nested macro starts immediately when it is called. When a nested macro ends, control returns to the calling macro. If Quit ends a nested macro, control does not return to the calling macro.
PerfectScript automatically compiles uncompiled Run macros. Macro execution stops if the macro will not compile.
Parameters
MacroFile: string The path and filename of a compiled macro.
{Parameter: any} (optional) Enclose multiple parameters in braces ({ }), separated by a semicolon. For example: Run ("macro"; {"a"; "b"; "c"}). Parameter values are passed to a special array variable named MacroArgs.
If missing, MacroArgs[ ] is not defined in the new macro.