This document describes new and improved features in PerfectScript since WordPerfect Office 2000. This version of this document also includes all documentation for the undocumented features and commands (as hidden text).
Document Change Log
05-30-01 JDan 1.3 - Typo when describing a change to the dialog editor.
04-05-01 JDan 1.2 - More version 10 updates for undocumented MacroInfo changes.
04-03-01 JDan 1.1 - Updated for changes made in version 10.
02-22-01 JDan 1.0 - Initial creation.
Quick Overview of WordPerfect 9 Macro Compatibility
This section provides a quick overview of things that may need to be done to WordPerfect 9 macros to make them work in PerfectScript for version 10. The sections Obsolete Commands and Language Features and Modified and Improved Commands and Language Features provide more extensive details. As new commands and capabilities are added, new reserved words have also been added. A description of these new reserved words is in the section New Commands and Language features.
PerfectScript (the program--PS100.EXE)
In the past, on startup of PerfectScript, it has automatically re-written all the macro file association registry settings in HKEY_LOCAL_MACHINE to refer to itself. These settings are established by the Setup process, and don't normally change - unless a different version of PerfectScript has run in the mean time, and has done this same re-write to refer to itself instead (these are the only registry settings which are not version specific - all other registry settings are stored in version specific registry keys, and there is no possibility of conflict).
These settings are not critical to the proper operation of PerfectScript, but are a matter of convenience for the user. They control how Windows deals with a macro file in the Windows Explorer - what icon is displayed, what context menu items are available, and what action is performed when the icon is double-clicked.
Under most circumstances, this re-write of the registry settings is of no immediate concern to a user. However, if running on some form of Windows NT (NT4, Win2000, WinXP or Windows Terminal Server), and if the current user does not have write access to the registry, this process would fail, causing PerfectScript to abort on startup.
This standard re-write behavior has been changed. On startup, PerfectScript will now verify that these settings are as it would expect. If the user has write access, and if these settings are missing, then the settings are silently created and PerfectScript continues. If the user has write access, but the settings are incorrect, then the user is advised, and given the opportunity to correct the settings, or continue without changing them. If the user does not have write access, and the settings are either missing or incorrect, then the user is advised to run setup to correct them. PerfectScript will then continue to startup.
This startup checking can be disabled with either a checkbox on the warning dialog which appears, or from the settings dialog in PerfectScript.
PerfectScript User Interface Changes
PerfectScript now supports text on the toolbar buttons. This option may be turned on or off from the settings dialog in PerfectScript.
PerfectScript also supports large toolbar button images, which can also be turned on or off from the settings dialog. This setting also applies to the Macro Dialog Editor and the Macro Debugger. In addition, when the special High Contrast mode in the Windows Accessibility options is turned on or off, then PerfectScript will automatically switch into (or out of) the large toolbar button image mode.
The online help URL has been changed from www.corel.com/support/product_specific/wp9.htm to product.corel.com/query.htm?prod=WPO&ver=10&box=WordPerfect_Office_2002&lang=en&topic=corel.com/products/wordperfect/perfectscript&src=online_help_button.
Advanced / Hidden Features, Settings and Keystrokes in PerfectScript
The PerfectScript Macro system has a number of hidden features and settings that are not documented, and not supported. These are used primarily for internal debugging and testing, and may contain bugs. Direct access to these features and settings from the user interface of the PerfectScript (PS100) is controlled by a specific registry setting. This registry setting is:
HKEY_CURRENT_USER\Software\Corel\PerfectScript\10\Settings\"Show Advanced Settings" = 1 (DWORD value)
If this setting does not exist, or has a value of 0, then direct access is not available. When this setting does exist, with a value of 1, then additional menu items are available in PerfectScript, and additional settings are available in the "Settings" dialog. As a reminder that these are hidden features and settings, the text of these menu items is enclosed in "[ ]" symbols, and the text of the settings in the "Settings" dialog are show in italics. New advanced/hidden settings are now available in the "Settings" dialog.
This same registry setting may be toggled on/off through a command accelerator key sequence of "Control Shift Alt ENTER" in PerfectScript.
Hidden keystrokes in the PerfectScript user interface
Control Shift Alt Object Action
Control Alt F10 key Compile
Shift Alt Insert key Registered Apps
Control Shift Insert key Command Inserter 1
Control Shift Alt Insert key Command Inserter 2
Control Alt Insert key Command Inserter 3
Control Shift Alt Enter key Toggle Hidden Settings
Shift Alt Enter key Macro Info
Control Shift Alt Recent file menu item Compile
Control Shift Recent file menu item Edit
Control Alt Recent file menu item Macro Info
Control Recent file menu item Record
Shift Alt Recent file menu item Debug Compile
Shift Recent file menu item Compile
Alt Recent file menu item Debug Play
Recent file menu item Play
Del Recent file menu item Remove from recent file list
Home Recent file menu item Move to top of recent file list
Shift About menu item Display easter egg
Hidden keystrokes in the Command Inserter
Control Shift Alt Object Action
Control Shift Insert button Dump Command List (also button in advanced)
Control Shift Alt Insert button Brief Command Dump (also button in advanced)
Control Select command list item Show Return-value Enumerations (also button in advanced)
Hidden keystrokes in the Macro Interpreter
Control Shift Alt Object Action
Control Shift Alt Cancel button in "Prompt" Invoke Macro Debugger
Control Shift Alt Cancel button in "Get..." Invoke Macro Debugger
Control Shift Alt Any button in "MessageBox" Invoke Macro Debugger
Hidden preference dialog settings
The following preference settings are accessible from the "Settings" dialog of PerfectScript when the Advanced / Hidden settings are enabled:
General page
Display debug messages
Compile page
Convert commas to semicolons
Ignore trailing semicolons
Ask to overwrite current object
Ask for listing filename
Ask to overwrite listing file
Generate detailed listing
Generate opcode statistics
Allow unknown OLE objects
Save scrubber file
Display compile warnings
Display compile errors
Display compile fatal errors
Display compile message %d [not used]
Debug page
Show full routine data
Show actual variable data types
Show "Internal Variables" button
Show "Runtime Stack" button
Show "Object Code" button
Show "Load" and "Save" buttons
Display all breakpoints
Debugger startup file
Debug page 2
Play page
Run unattended
Show progress
Use new runtime error dialog
Platform version info file
PerfectFit version info file
PerfectScript version info file
Command Browser page
Use theta indexes
Show actual data types
Show all PIDs
Show all parameters
Show all enumerations
Show token ids
Show enumeration values
Non-preference dialog registry settings
All registry settings not accessible from the "Settings" dialog of PerfectScript are listed below. These settings are located in HKEY_CURRENT_USER\Software\Corel\PerfectScript\10\Settings\...
"Preferred Interface Language" = (string) "US" (default="US")
"Time Out Tkn App Launch" = (DWORD) (default = 300)
"Prompt on Tkn App Launch" = (DWORD) 1 or 0 (default=0)
"Interpreter\Show matherr Messages" = (DWORD) 1 or 0 (default=0) [not used]
"Debugger\Color For Source Code Lines" = (DWORD) 1 or 0 (default=-1)
"Debugger\Color For Source Non-Code Lines" = (DWORD) 1 or 0 (default=0x00008000)
"Debugger\Color For Source Opcode Lines" = (DWORD) 1 or 0 (default=0x00808080)
"Debugger\Color For Source Opcode Statistic Lines" = (DWORD) 1 or 0 (default=0x00c0c0c0)
"Debugger\Show Grid Lines" = (DWORD) 1 or 0 (default=1)
"Debugger\Select Entire Line" = (DWORD) 1 or 0 (default=1)
"Debugger\Debugger Toolbar Configuration" = (BINARY) (default=0)
"Debugger\Use Flat Toolbar" = (DWORD) 1 or 0 (default=1)
"Debugger\Minimize When Macro Running" = (DWORD) 1 or 0 (default=0)
"Debugger\Show Numbers in Hex" = (DWORD) 1 or 0 (default=1)
"Debugger\Show Numbers in Octal" = (DWORD) 1 or 0 (default=0)
"Debugger\Show Numbers in Binary" = (DWORD) 1 or 0 (default=0)
"Debugger\Show Last Return Value Button" = (DWORD) 1 or 0 (default=0)
"Debugger\Display Last Return Value" = (DWORD) 1 or 0 (default=0)
"Debugger\Find Case Sensitive" = (DWORD) 1 or 0 (default=0)
"Debugger\Find Whole Words Only" = (DWORD) 1 or 0 (default=0)
"Debugger\Find Start at Top" = (DWORD) 1 or 0 (default=0)
"Debugger\Find Wrap Around" = (DWORD) 1 or 0 (default=1)
"Debugger\Find Forward" = (DWORD) 1 or 0 (default=1)
"Debugger\Find Last Text" = (string) "" (default="") [not used]
"Debugger\Find Last Line" = (DWORD) 1 or 0 (default=0) [not used]
"Debugger\Show Label Table" = (DWORD) 1 or 0 (default=0)
"Debugger\Show UseFile Table" = (DWORD) 1 or 0 (default=0)
"Debugger\Show Product Table" = (DWORD) 1 or 0 (default=0)
"Debugger\Show Dialog List" = (DWORD) 1 or 0 (default=0)
"Debugger\Show Condition Handler List" = (DWORD) 1 or 0 (default=0)
"Debugger\Show MacroInfo List" = (DWORD) 1 or 0 (default=0)
"Debugger\Show Callback Queue" = (DWORD) 1 or 0 (default=0)
"Debugger\Show Macro Header Dialog" = (DWORD) 1 or 0 (default=0)
OLE Automation
Dialog Editor, and Dialog and Region Statements
PerfectScript supports large toolbar button images in the Macro Dialog Editor. This mode can be turned on or off from the settings dialog. In addition, when the special High Contrast mode in the Windows Accessibility options is turned on or off, then the Macro Dialog Editor will automatically switch into (or out of) the large toolbar button image mode.
Depending on the number of initial items assigned to a listbox or combobox control in the Macro Dialog Editor, duplicating such a control would sometimes cause an allocation error, which could cause PerfectScript to abort with an IPF or GPF. These errors are now trapped and displayed, preventing a loss of data and the crash of PerfectScript.
Macro Debugger
When the special High Contrast mode in the Windows Accessibility options is on, then the Macro Debugger will display the toolbar using large toolbar button images.
When changing the contents of a variable in the debugger, the edit field had a limit of 2048 characters. Normally, this is sufficient, but when dealing with large string values, this may not be sufficient. This limit has been raised to 20000 characters now, which should be sufficient for nearly any value.
The macro debugger accepts a large number of keyboard accelerator keys, which can be different depending on which window in the macro debugger is currently active. By pressing Control+F1, a dialog is displayed, listing the accelerator keys which are valid at that time, and the name (if any) of the corresponding menu item. This dialog is now fully sizeable (a bug in version 9 allowed this dialog to be sizeable, but the listbox displayed on the dialog would not resize itself, making this feature useless). The full menu and menu items name is now displayed, where only the name of the menu item was displayed in version 9. When in advanced mode, *all* accelerators are displayed, not just the documented ones.
When an array variable was partially expanded (when it contains more elements that are normally expanded), and if the variable list is displayed in descending order, then the first array element was displayed with an incorrect icon next to it.
Command Inserter
Macro Compiler
When an obsolete or unsupported feature is found in a macro as it is compiled, a compile warning is displayed. These warnings can safely be ignored, which will produce a successful macro. The message text has been reworded to make it clearer, that this is a warning only, and not an error, and can safely be ignored.
These serve as reminders only. Warnings are displayed when an old EN English synonym is used in the Application statement (US, UK, CE, OZ), or when an obsolete/unsupported command, enumeration or parameter is used. (However, the use of an obsolete/unsupported built-in command or operator does not generate a warning). A new PerfectScript setting has been defined on the Compiler page that is used to enable/disable these warnings. This setting is initially enabled. A bug was corrected in version 9, which prevented unsupported "commands" from being detected properly. Unsupported commands are those that are not listed in the application token index table. Unsupported enumerations are those defined without a trailing "!". Unsupported parameters, are those used by the HasProc tokens, where the return value is still shown as the first parameter when used as a procedure.
Obsolete Commands and Language Features
In a future release of PerfectScript, there are some commands that may or may not be supported. Users are encouraged to replace these commands with their functional equivalents (if any) as soon as possible. For backward macro compatibility, these commands will continue to be supported, but they will no longer be documented in the command browser or in the macro help information. These commands may be eliminated in some future release.
These items were not added in the initial release:
FileTypeName.FileType.WordPerfect6789!
FileTypeExtension.FileType.WordPerfect6789!
FileConvert.SourceFIleType.WordPerfect6789!
FileConvert.DestinationFileType.WordPerfect6789!
FileTypeName.FileType.WordPerfect6789!
FileTypeExtension.FileType.WordPerfect6789!
FileConvert.SourceFIleType.WordPerfect6789!
FileConvert.DestinationFileType.WordPerfect6789!
These enumerations have been renamed from WordPerfect6789! to WordPerfect678910!.
Modified and Improved Commands and Language Features
This section describes changes to existing commands and, where applicable, incompatibilities that may arise with old macros. In this section, "..." indicates places where existing capabilities have not been changed.
<version number>
ElseIfPlatform
EndIfPlatform
FileConvert
FileType
FileTypeExtension
FileTypeName
IfPlatform
MacroInfo
<version number>
The version number of the PerfectScript macro system has been changed to 10.0.0, to allow compile time and runtime version specific checks. This affects the IfPlatform, ElseIfPlatform, EndIfPlatform, MacroInfo and VersionInfo commands. This will also cause a macro compiled under this PerfectScript macro system to recompile on an older version macro system.
... := DialogAddListBox (...; [Style:enumeration]; ...)
A new Style enumeration has been added.
[Style] The style for the list box.
UseTabStops! When this style is specified, then the listbox supports having tabstops. It is not necessary to specify this style. If the tab stops are set in the RegionSetTabStops command, then this style is automatically added to the listbox.
ElseIfPlatform ([{<PlatformID>enumeration}])
EndIfPlatform ([{<PlatformID>enumeration}])
See IfPlatform below.
... := Exists ([VariableName:variable]; [Pool:enumeration])
The VariableName parameter is now optional. New options have been added to the Pool parameter.
[VariableName] The name of the variable to check for. If missing, then this routine will check if *any* variables exist in the specified pool, or any pool if no pool is specified.
[Pool] The variable pool to search in, and any special options. If missing, then the value of ExactMatch! | AnyPool! is used. If no pool type is specified, then all pools are checked.
AnyPool! Synonym for Any!. All variable pools are checked for the specified variable. If this pool type is specified, then the return value is the pool type the variable was located in (if any).
ExactMatch! The variable name specified must *exactly* match the name of an existing variable. This is the default. If no variable name is specified, then this option has no meaning and is ignored.
PartialMatch! The variable name specified is only the first part of the variable name, and any variable name starting with these characters will match. If no variable name is specified, then this option has no meaning and is ignored.
Declared! Normally, this command will check that the variable is declared, *and* whether it contains a value. If Declared! is specified, it is sufficient that the variable exists even if it has no value currently assigned to it. For SP1, if the variable name is missing, this should work the same, but for release, it will return true if a declared but undefined variable exists.
... := FileConvert (...; SourceFileType:enumeration]; ...; DestinationFileType:enumeration)
New enumerations have been defined for the SourceFileType parameter and DestinationFileType parameter.
[SourceFileType] The file type of the source file. The following new enumerations have been added.
CorelDRAW10!
These types were not defined in time for release:
WordPerfect678910! This is the same as the now obsolete enumeration WordPerfect6789!.
WordPerfect10!
[DestinationFileType The file type of the destination file. The following new enumerations have been added:
WordPerfect678910! This is the same as the now obsolete enumeration WordPerfect6789!.
WordPerfect10!
enumeration := FileType (...)
New return enumerations have been defined for some new file types.
return-value The type of the file if recognized.
CorelDRAW10!
These types were not defined in time for release:
WordPerfect678910! This is the same as the now obsolete enumeration WordPerfect6789!
WordPerfect10!
... := FileTypeExtension (FileType:enumeration)
New enumeration values have been defined for the FileType parameter.
FileType The type of the file to return the file name extension for.
CorelDRAW10!
These types were not defined in time for release:
WordPerfect678910! This is the same as the now obsolete enumeration WordPerfect6789!
WordPerfect10!
... := FileTypeName (FileType:enumeration)
New enumeration values have been defined for the FileType parameter.
FileType The type of the file to return the file type name for.
CorelDRAW10!
These types were not defined in time for release:
WordPerfect678910! This is the same as the now obsolete enumeration WordPerfect6789!
WordPerfect10!
string := FileTypeName (...)
A typo in a return value has been corrected.
return-value The return value for the PerfectScript protected macro file type used to return "PerfectSctipt Protected Macro", but has been corrected to return "PerfectScript Protected Macro".
GetNumber (...; [Prompt:string]; ...)
GetString (...; [Prompt:string]; ...)
GetUnits (...; [Prompt:string]; ...)
The prompt string parameter length limit has been increased.
[Prompt] The prompt string to display. Was limited to 2048, but now extended to 10000 characters.
IfPlatform ([{<PlatformID>enumeration}])
New enumerations have been added to the PlatformID parameter. This is a compile time only statement, and cannot be used at runtime to determine the platform id or version that the macro is running on. Use the MacroInfo command, or the VersionInfo command to determine platform type and version numbers at runtime.
[{PlatformID}] This parameter specifies a list of ids. If any of the ids in this list matches the id that this version of the macro system recognizes, then the statements in the body of the IfPlatform block will be compiled. Otherwise the body is ignored as if it contained comments. If the id is a numerical or string value, then this value is compared to the version number of the current macro system, and if equal, then the body of statements are compiled. If this parameter is missing, then the statement body is ignored as if no recognized id was specified.
_Version10! This enumeration is recognized if the macro is compiled using any version 10 PerfectScript macro system.
_Version10_0_0! This enumeration is recognized if the macro is compiled using the version 10.0.0 PerfectScript macro system.
10.0 Any numeric value is compared against the macro system version number.
"10.0", "10.0.0" Any string value is compared against the macro system version number.
string := MacroInfo (InfoItem:enumeration; ...)
New values for the InfoItem PlatformName! are now returned.
return-value New platform names are now returned.
InfoItem A new value is returned for the platform name. The following new names can be returned:
PlatformName! Windows ME and Windows XP are now detected, and a string identifying this is returned.
"WinME" For Windows ME.
"WinXP" For Windows XP.
"Win32_m.n" For unknown 32-bit Windows, where 'm' and 'n' are the major and minor versions numbers of the OS.
"WinNT_m.n" For unknown Windows NT, where 'm' and 'n' are the major and minor versions numbers of the OS.
any := MacroInfo (...; [ItemData:enumeration])
New enumerations for new ItemData values have been defined.
return-value New items are now returned.
[ItemData] The item of data for the item to return.
When the InfoItem is PlatformName!:
Title! string - Return the title, or name of the item (the platform name). This is the default if ItemData is missing.
TitleInfo! string - Return additional info for the title or name of the platform.
When the InfoItem is PlatformVersion!:
SPMajorVersion! numeric - Return the major service pack number.
SPMinorVersion! numeric - Return the minor service pack number.
ProductSuiteMask! numeric - Return a mask indicating the product suites installed. See the ProductSuiteMask! value for the VersionInfo command.
ProductTypeMask! numeric - Return additional information about the system. See the ProductTypeMask! value for the VersionInfo command.
VersionReservedByte! numeric - Return the value of the reserved version info.
Prompt (...; [Prompt:string]; ...)
The prompt string parameter length limit has been increased.
[Prompt] The prompt string to display. Was limited to 2048, but now extended to 20000 characters.
RegionSetTabStops (...)
A change in behavior. When this command is called for a listbox, then the UseTabStops! style is automatically added to the listbox control, making it unnecessary to specify this style on a listbox control when it is defined.
any := VersionInfo (...; [InfoItem:enumeration])
New InfoItem types are now available.
return-value New values are returned.
[InfoItem] The item to return.
ProductTitle! string - The title or name of the item.
ProductTitleInfo! string - Extra info about the product title.
ProductSPMajorVersion! numeric - The major version number of any Service Pack installed.
ProductSPMinorVersion! numeric - The minor version number of any Service Pack installed.
ProductSuiteMask! numeric - A mask indicating the product suites installed. Multiple of the following bit values may be present. Us the bitwise AND operator (&) to test for the presence of these values.
1 - MS Small Business Server is installed.
2 - Win2000 Advanced Server is installed.
4 - MS BackOffice is installed.
8 - Communications?
16 (10x) - Terminal Services is installed.
32 (20x) - MS Small Business Server is installed with restrictive client licenses.
64 (40x) - EmbeddedNT?
128 (80x) - Win2000 DataCenter is installed.
256 (100x) - SingleUserTS?
512 (200x)? - Whistler Personal is installed.
1073741824 (40000000x) - NT workstation?
2147483648 (80000000x) - NT Server?
ProductTypeMask! numeric - A value indicating additional information about the system. Only 1 value may be present at a time.
1 - Win2000 Professional.
2 - Win2000 domain controller.
3 - Win2000 Server.
ProductReservedByte! numeric - The reserved byte from the version info.
New Commands and Language features
This section describes new commands and language features which have been added.
<new reserved words>
<new reserved keywords>
New keywords have been added to the macro language. These keywords are reserved words and may not be used as variable or label names in macros. In addition to these new reserved keywords, the name of any new commands are also considered reserved words, since those names also cannot be used as variable or label names. (However, just because a new reserved keyword is on this list, does not imply that there is a new command or feature by that name that can be accessed.) The new reserved keywords that have been added are:
Several new commands have been added, which are now reserved words, but they do not need to be listed separately. See below for the list of new commands.
DiscardAll ([VariableName:variable]; [Pool:enumeration])
This command will discard all variables in the specified pool
[VariableName] The name of the variable to discard. If missing, then all variables in the specified pool are discarded.
[Pool] The variable pool to discard the variables from. If missing, then AllPools! | ExactMatch! is used. If the variable name is missing, then all variables in the specified pool are discarded.
Only one pool may be specified:
AllPools! All or specified variables in all pools are discarded.
Local! All or specified variables in the local pool are discarded.
Global! All or specified variables in the global pool are discarded.
Persistent! All or specified variables in the persistent pool are discarded.
Only one match option may be specified.
ExactMatch! Only variables with the specified exact name are discarded. If no variable name is specified, then this option has no meaning and is ignored.
PartialMatch! All variables whose name begin with the specified characters are discarded. If no variable name is specified, then this option has no meaning and is ignored.
numeric or string := VarLocate (Pool:enumeration; [Index:numeric])
Return the count of variables in the specified pool, or return the name of a particular variable by index number in the specified pool.
Pool The variable pool to locate variables in.
Local! Locate variables in the local variable pool.
Global! Locate variables in the global variable pool.
Persistent! Locate variables in the persistent variable pool.
[Index] The variable number to locate the name of, starting at 1. If missing, or 0 is specified, then the count of variables in the specified pool is returned. If a positive value is specified, then the name of the specified variable by numeric index is returned.
Bugs Fixes and Corrections