New in PerfectScript for WordPerfect version 9 (WP Office 2000),
in the Professional, SP1, SP2 (Legal), SP3 and SP4 releases
This document describes new and improved features in PerfectScript since the initial release of Corel WordPerfect Suite 9, including changes in the Professional release, and SP1, SP2 (Legal), SP3 and SP4. Each change is prefixed by an indicator of the release to which it applies; shown as [Pro], [SP1], [SP2], [SP3] or [SP4]. Since this document contains descriptions of features for multiple releases, there may be descriptions of a feature for a particular release, which is followed immediately by another (possibly) contradictory description for a later release. In all cases, that last description reflects the status of that feature in the latest feature documented. A description of the bugs which were fixed in these releases is also included at the end of this document (as hidden text) This version of this document also includes the undocumented features and commands (as hidden text).
Document Change Log
2-27-01 JDan 1.7 - Added descriptions of specific problems fixed.
2-21-01 JDan 1.6 - Added clarification of the Value and ValueNumber parameters for the RegistryQueryValue, RegistrySetValue and RegistryEnumValue commands.
2-15-01 JDan 1.5 - Further additional changes. RegistryEnumValue description change.
1-23-01 JDan 1.4 - Updated entry for SP3-FileTypeList. Added description of the OLE automation interface in PSDLL.
1-22-01 JDan 1.3 - Further cleanup.
8-11-00 JDan 1.2 - Added SP4 info.
1-29-00 JDan 1.1 - Added SP1, SP2, SP3 info.
1-27-00 JDan 1.0 - Initial creation.
Quick Overview of WordPerfect Suite 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 9 Professional. 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 may also have been added. A description of these new reserved words is in the section New Commands and Language features.
PerfectScript (the program--PS90.EXE)
[SP4] PerfectScript now supports 3rd party token handler DLLs. All tokens (not just its own tokens) are passed to the ValidateToken entry point. If the 3rd party DLL does not accept or approve of the token, then it can cause PerfectScript to abort the macro. PerfectScript's own tokens (it currently has none) are passed to the HandleToken entry point in the 3rd party DLLs. If the 3rd party DLL defines its own tokens, then these tokens can be compiled in to a macro, and can be played in a macro by PerfectScript by passing the token to the 3rd party DLL. .... explain the rest.... [Macro3rdPartyInfo] token, ...
[SP4] A Windows shell menu item of "Debug" has been added for macros, that is displayed on the context menu for a desktop icon for a macro.
[SP4] In the past, PerfectScript would always write certain settings to HKLM of the system registry as part of its startup. PerfectScript now checks these entries, and if they are not correct, then it displays a warning, and if the user has write access to the system registry, PerfectScript will ask before correcting these entries.
[SP3] The protected macro file type is now properly accepted for all commands. Some commands were not properly checking for protected macros.
PerfectScript User Interface Changes
[SP3] When removing source from macros, you now have control over the separate options of this operation. A dialog is presented, displaying the options to remove the source or protect the macro from being accidentally edited in WordPerfect. You may choose either one, or both of these options separately. Once the source is removed from a macro, it cannot be restored. But the protection on a macro can be reversed later on and turned off, or subsequently turned on again as well. Once a macro is marked as protected, it may be compiled and played, but it cannot be opened in WordPerfect. Attempts to do so cause WordPerfect to display an unknown file type error.
[SP4] When removing source from a macro, the options dialog presented now displays the current state of whether the macro has already had the source code removed, and whether the macro is marked as protected or not. Once the source has been removed from a macro, this operation cannot be reversed, and so this item may be disabled. But marking a macro as protected can be reversed, and this option will always be enabled.
[SP3] The Macro Info dialog now indicates whether the source of a macro has been removed, and whether a macro is marked as protected or not.
[SP3] The toolbar in PerfectScript can now be displayed as a flat toolbar like the other applications in the Suite. This advanced option is tied to the flat toolbar option in the macro debugger for now, and defaults to False.
[SP4] The toolbar in PerfectScript (and the macro debugger) is now shown as a flat toolbar. An advanced setting can be used to revert to the old "non-flat" toolbar style.
[SP4] The version number of the macro system (which differs slightly from the version number of the PerfectFit shared code) is now displayed on the About dialog. Also, the version number of certain special types of 3rd party DLLs attached to PerfectScript is also displayed. These 3rd party DLL must respond to a special token whose ID is 3...
[SP4] When the advanced features are enabled, then the actual internal state of the running macros is displayed in the macro list in PerfectScript.
[SP4] The online help URL has been changed from www.corel.com/products/WordPerfect/PerfectScript to www.corel.com/support/product_specific/wp9.htm.
[SP1] The preference settings have been regrouped and rearranged by adding a second page for the macro debugger settings.
[SP4] New settings have been added to the settings dialog:
Compile/Warn when using unsupported features - defaults to true
Remove the Debug/Flat Toobar setting
General/Flat Toolbar - true
Debug/Show All Variables - Ask on first time
Debug/Max variables to show - 100
Debug/Max array elements to expand - 100
Browser/Show dyna-thetas - false
Browser/Highlight unsupported features - true
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 (PS90) is controlled by a specific registry setting. This registry setting is:
HKEY_CURRENT_USER\Software\Corel\PerfectScript\9\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 shown 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 menu items in the PerfectScript user interface
File > Macro Info
View > Advanced Settings
Tools > Execute Token
Tools > Register Applications
Hidden menu items in the Macro Debugger
View > Object Code
Variables > View > Internals
Variables > View > Runtime Stack
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
(documented accelerators are described in the section "Command Inserter")
Control Shift Alt Object Action
Control Insert button Generate Abbreviated command list (also advanced button)
Shift Insert button Generate Full/Verbose command list (also advanced button)
Alt Insert button Generate Brief command list (also advanced button)
Control Shift Insert button Generate Full/Verbose command List (also advanced button)
Control Shift Alt Insert button Generate Brief command list (also advanced button)
Control Select command list item Show Return-value Enumerations (also advanced button)
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 keystrokes in the Macro Debugger
(documented accelerators are listed in the section "Macro Debugger")
Control Shift Alt Object Action
Alt F1 key Display the accelerator dialog
Control F1 key Display the accelerator dialog
Alt Home key Set focus to main debugger window
Alt End key Set focus to main debugger window
Control End key Set focus to main debugger window
Alt Down-Arrow key Set focus to the next debugger info window
Alt Right-Arrow key Set focus to the next debugger info window
Control Right-Arrow key Set focus to the next debugger info window
Alt Page-Down key Set focus to the next debugger info window
Control Page-Down key Set focus to the next debugger info window
Alt Up-Arrow key Set focus to the previous debugger info window
Alt Left-Arrow key Set focus to the previous debugger info window
Control Left-Arrow key Set focus to the previous debugger info window
Alt Page-Up key Set focus to the previous debugger info window
Control Page-Up key Set focus to the previous debugger info window
Hidden "Settings" 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
Show splash screen
Flat toolbar
Show icons on settings tabs
Compile page
Use commas as param separators
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 all variables
Max variables to show
Max array elements to show
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
Show "Last Return Value" button
Display all breakpoints
Debugger startup file
Debug page 2
Show grid lines
Select entire line
Minimize when active
Take focus when active
Number formats
Include hex
Include octal
Include binary
Text colors
Source lines
Non-code lines
Opcode lines
Statistics lines
Play page
Run unattended
Show progress
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
Show 3rd party dyna-thetas
Highlight unsupported features
Non-"Settings" 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\9\Settings\...
"Preferred Interface Language" = (string) "US" (default="US") - or is this "EN" now?
"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\Debugger Toolbar Configuration" = (BINARY) (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
[SP1, SP3] An OLE automation iDispatch interface has been added to the PerfectScript programing commands, allowing any OLE automation controller (such as VB or VBA), to access the extensive set of PerfectScript programing commands. The OLE object name is "PerfectScript.Script", and if used with the VBA editor interface built in to WordPerfect, an instance of this object is automatically available through the global variable/method called "Script".
This OLE automation object implements most of the commands in PerfectScript. PerfectScript includes a large set of statements and commands. In a general sense, we can divide these commands into 2 groups. The first group are the built-in statements (like IF, SWITCH, FOR, etc...) and operators (+, -, *, /, AND, etc...) of the core macro language itself. The other group is the set of commands (procedures and functions) that are considered "tokens" (or commands) of the macro system (like DialogDefine, AppActivate, RegistryCreate, etc...).
The OLE automation interface provides access to most of the "tokens" of the macro system, but does not provide access to the statements and operators of the macro language. Some of the commands of the macro system are not available, or may not work quite as expected, since they require access to data and capabilities that are inherent in the PerfectScript macro system that are not available in VBA.
This OLE automation interface has been available in some form or another since the release of version 9, but was not fully implemented or available until SP3.
Dialog Editor, and Dialog and Region Statements
[SP1] <Dialog Editor>
A number of bugs were fixed in the dialog editor.
[SP4] <Dialog Editor>
The wording "Windows" when referring to the Windows standard type of listbox, combobox, editbox, etc, has been replaced with the wording "Standard".
[SP3] <region names>
For all places where a region name is accepted, two special values may be passed.
"" If a "" is passed, then this is the same as leaving off the region name (where possible), and the current default parent window is used, which is set to the main window of the application that started the macro, but can be changed in the macro at any time using the SetDefaultParent command.
"*" If a "*" is passed, then the Windows desktop window is used (the same as a NULL window handle).
Macro Debugger
[SP3] All hidden/advanced features in the debugger are now displayed in [ ] symbols.
[SP1, SP3] The ability to restart a macro while it is running has been added. The capability has been assigned the keyboard accelerator of Shift-F5. When a macro is restarted, all variables created by the macro (except Persistent variables) are deleted, and the debugger will begin at the top of the macro. All other state information is also reset to the initial conditions so that when the macro is restarted, it is as if the macro had not run yet (except for Persistent variables - any Persistent variables created or changed during the macro are not reset). In SP1, a macro cannot be restarted once it has reached the end of execution. In SP3, a macro can be restarted once it has finished running.
[SP1] The internal numeric value of a date/time variable is now displayed along with the date/time value that it represents.
[SP3] At each breakpoint, the debugger displays the contents of the current variables in the variable list. This includes the values of array variables, where the contents of all the elements are displayed in an abbreviated list. But when an array has a large number of elements, the display of all elements is time consuming, and of little practical value, so only the value of the first 25 elements are displayed. The values of all array elements are still visible by expanding the array.
[SP3] When the contents of an array are expanded, a lot of time and memory can be consumed. To speed up this process, initially only the first 100 elements of an array are displayed When the array is expanded, a warning prompt is displayed, asking whether all elements of the array should be expanded, or only the first 100 elements. An additional [101]th element will also be displayed, representing the remaining elements in the array (without their values). The remaining elements can be displayed by either clicking on the [...] icon next to the [101]th element, or by collapsing the array, and expanding it again, causing the same warning prompt to be displayed again, where the choice to expand all elements can be selected.
[SP4] This limit of displaying only the first 100 elements of an array can be changed through a setting in the preferences dialog, on the Debug page.
[SP3] Whenever the debugger stops at a breakpoint, the contents of all the variables is refreshed and displayed. When a macro contains a large number of variables, this process can become quite lengthy, and so the macro debugger can be configured to display only the first few variables, which speeds up the refresh time. Initially, the debugger will display the value of only the first 100 variables. At any time, the contents of all the variables may be displayed, by selecting the menu item "Show All Variables".
[SP4] This display limit of 100 variables can be disabled or changed through settings on the Debug page of the settings dialog.
[SP3] A number of new features were added to the debugger. These features have menu items, toolbar buttons, and keyboard accelerators (were appropriate). Now that there is a limit on the number of variables that are initially displayed, there is a command to display all variables, called "Variables > View > All". To quickly close all the debugger info windows, a command called "View > Close All" has been added. To quickly locate the current line of code where the macro has been interrupted in the debugger, a command named "Edit > Find Current Line" has been added.
[SP3] A keyboard accelerator of Alt-0 has been added for the "Execute Token" dialog.
[SP3] The "macro header" info window now displays whether the macro is protected and whether the macro still contains the macro source code (or whether the source has been removed).
[SP3] The entire line in the source list window is now highlighted. In the past, the highlighting only extended to the end of the longest source line text. There is an advanced setting that can be used to disable this.
[SP3] Many redundant ".all" text descriptors have been removed from breakpoint descriptions in the breakpoint dialog.
[SP3] A number of new items are now recorded in the debugger config file for the macro. The following items are now recorded, and restored the next time the macro is debugged:
Macro listing filename is saved with macro file names in the MRU list
Which info windows are open
Which variable pools are being displayed (inc watchlist and Show All, and internal)
If stack/return value is showing
If object code is showing
In addition, when the debugger config file for a macro is loaded, the version number check is for <= the current version. In the past, this check was for an exact match. If the version numbers did not match, then the config file would not be reloaded.
[SP3] Whenever a macro is debugged, the debugger loads the debugger config file for that macro. Before this macro specific config file is loaded, the debugger will load a common config file named STARTUP.DBG, and any commands in that file are loaded first. There is an advanced setting that can be used to change the name of this file.
[SP4] Callbacks can be removed from the Callback Queue list. Pressing the <DEL> key causes the currently selected callback entry to be deleted from the queue. A warning is presented to confirm this action, since deleting an entry from the callback queue can dramatically alter the behavior of the macro.
[SP4] The variable contents edit field is now a non-preselect edit field.
[SP4] The Macro Header info window is now a modal dialog, rather than a modeless dialog.
[SP4] The splitbars between the Source list and Call history and Variable list windows had no keyboard interface. Now a splitbar may receive focus, and when it has focus, then its position can be changed using the arrow keys on the keyboard. The arrow keys will move the splitbar by 1 pixel. Holding the Shift key with the arrow keys will move the splitbar by 5 pixels. Holding down the Control key will move it by 10 pixels.
[SP4] The info windows in the debugger now have context menus, containing options to navigate from that window to the other info windows, and to the main debugger window, and to jump to the matching macro source line (if any).
[SP4] The main debugger window has new menu items to navigate through the info windows.
[SP4] The Callback Queue list info window now indicates which callbacks are currently active, and which are pending (it is now possible for multiple callbacks to be active at once).
[SP4] The Breakpoints dialog now has a context menu to allow the breakpoints to be sorted by various columns.
[SP4] A dialog has been added to the main debugger window and its info windows that will display all the currently active accelerator keys, and the associated menu items. This dialog is brought up by typing Alt-F1or Control-F1.
[SP4] A number of accelerator keys have been added to the debugger info windows (and some to the main debugger window). See the section Hidden / Advanced Features, Settings and Keystrokes in PerfectScript for additional accelerator keys.
Space Jump to the associated macro source line (if any)
Del/Backspace Delete the current callback queue entry
Alt 0 - Alt 9 Display one of the debugger info windows
Control Home Set focus to main debugger window
Control F6 Set focus to the next debugger info window
Control Down-Arrow Set focus to the next debugger info window
Shift Control F6 Set focus to the previous debugger info window
Control Up-Arrow Set focus to the previous debugger info window
??? [SP4] Add an icon column to the dialog control list info window???
Command Inserter
[SP4] Obsolete/unsupported commands/features are shown in strikeout text. This includes commands, parameters and enumerations. This is controlled by a setting on the Browser page of the PerfectScript settings dialog, which is initially enabled.
[SP4] Holding down Shift, Control or Alt when clicking on a command in the command listbox will display the return enumerations (if any) for that command.
[SP4] Holding down Shift, Control *and* Alt when bringing up the command inserter from the "Commands" button on the Macro Toolbar in WP, or from the Command Browser menu item of the About menu in PerfectScript will display the "alternate" Command Inserter interface. In the Linux release, this was Shift, Control *OR* Alt.
[SP4] A new "abbreviated" format for dumping commands lists is now available. This format displays only a single character for each parameter, representing the parameter data type.
[SP4] New accelerator keys (and button clicks) are available for generating command lists, even when the command list buttons are not visible on the dialog. See the section "Advanced / Hidden Features, Settings and Keystrokes in PerfectScript" for more info.
[SP4] When command names, parameter names or enumeration names are too wide for the listbox, then a horizontal scroll bar is displayed allowing the list items to be scrolled horizontally.
[SP4] The dyna-thetas created by 3rd party DLLs attached to an application can now be displayed in the command list for that application. This is enabled/disabled through a setting on the Browser page of the settings dialog of PerfectScript. This setting is normally turned off, causing the dyna-thetas NOT to be displayed.
[SP4] A button is now available to display the return value enumerations for those commands that have enumerations as return values. In the past, this button has been available only while the advanced settings were enabled.
[SP4] The name of the application that the command inserter is attached to is displayed in the caption bar of the command inserter.
[SP4] The command list for the application that the command inserter is attached to is initially displayed when the command inserter is brought up.
Macro Compiler
[SP1] When no "return" statement is found within the body of a user defined function, then a compile warning is generated, and a "return (0)" statement is generated by the compiler.
[SP1] When a "return" statement with no return value is found in the body of a user defined function, then a compile warning is generated, and a value of 0 will be returned.
[SP3] When compiling a macro, if the macro appears to be empty, then a compile warning is generated. This is done because an empty macro could be an already compiled macro which has had its source removed. Compiling such a macro will destroy the existing compiled macro object.
[SP4] 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. 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. Unfortunately, a bug prevents 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.
[SP4] Values can no longer be assigned to variables that have the same name as command token names. In prior versions, an assignment to a variable name with such a name was allowed, but the value could never be retrieved later on, since an attempt to retrieve the value from such a variable name would be compiled as a call to the command with no parameters, which caused compile errors if the command has any required parameters. However, assignments to names which are the same as builtin statements (such as IF, NAMEOF, etc...) and keywords are still compiled, but as in the past, their values cannot be properly retrieved.
[SP4] The "cancel" button on the Compile Progress dialog has been made the default button on the dialog. This allows the compile of a macro to be canceled by pressing the Enter key without having to use the mouse, or without having to use the tab key to shift focus to the cancel button first.
Obsolete Commands and Language Features
In future releases of PerfectScript, there may be some commands that 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. Use of these obsolete features in a macro will cause a compile warning when the macro is compiled (see the Section "Macro Compiler" above for more information).
[SP4] FileError.InvalidDivePath!
[SP4] FileError.InvalidDivePath!
This enumeration was misspelled, and has been corrected. The new spelling is InvalidDrivePath!. The old name has been retained as an unsupported feature for backward compatibility.
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>
[SP4] <most dialogs>
[SP1, SP4] <date control>
[SP4] <color wheel control>
[SP4] <callbacks>
[SP3] <region names>
[SP4] <operators on non-array and array values>
[SP3] <most dialogs>
[SP3] <user defined macro dialogs>
[SP3] <other dialogs and message boxes>
[SP3] <dialogs in the compiler>
[SP4] AppExecute
[SP4] AppExecuteExt
[SP4] caseof
[SP4] case
[SP4] case call
[SP4] DialogAddBitmap
[SP4] DialogAddComboBox
[SP4] DialogAddEditBox
[SP4] DialogAddListbox
[SP4] DialogAddRadioButton
[SP4] DialogAddScrollbar
[SP4] DialogAddText
[SP4] DialogDismiss
[SP3, SP4] DialogDisplay
[SP3, SP4] DialogShow
[SP4] DialogUndisplay
[SP4] DLLCall
[SP2] FileConvert
[SP4] FileError
[SP3] FileNameDialog
[SP2] FileType
[SP2] FileTypeExtension
[SP2, SP3] FileTypeList
[SP2] FileTypeName
[SP1, SP3, SP4] IfPlatform
[SP1, SP3, SP4] ElseIfPlatform
[SP1, SP3, SP4] EndIfPlatform
[SP3] GetNumber
[SP3] GetString
[SP3] GetUnits
[SP1, SP3, SP4] MacroInfo
[SP1, SP3] Menu
[SP1, SP3] MenuList
[SP3] MessageBox
[SP1] MaxN
[SP1] MinN
[SP1, SP3, SP4] Prompt
[SP3] RegionGetName
[SP4] RegionGetStyle
[SP3] RegionSetFocus
[SP4] RegistryOpenKey
[SP4] RegistryCreateKey
[SP4] RegistryCloseKey
[SP4] RegistryDeleteKey
[SP4] RegistryDeleteValue
[SP4] RegistryEnumKey
[SP4] RegistryEnumValue
[SP4] RegistryQueryLastError
[SP4] RegistrySetValue
[SP4] repeat until
[SP4] Speed
[SP4] switch
[SP4] ValueType
[SP4] VersionInfo
[SP4] while
[SP1, SP3, SP4] <version number>
The version number of the PerfectScript macro system has been changed to 9.1.1 / 9.3.3 / 9.4.4 (respectively for SP1, SP3 and SP4 - SP2 did not change the version number), 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 the latest version of the PerfectScript macro system to recompile on an older version macro system.
[SP4] <most dialogs>
Most dialogs that are part of the macro system (non-user defined macro dialogs) now allow the static text message part of the dialog to be copied to the clipboard.
[SP1] <date control>
The date edit control is now a bit easier to use. To choose the year in the control, the arrow buttons were used to advance the year by one year for each click. This made it difficult to change the year rapidly. The year may now also be advanced by 10 or 100, by holding down the Control or Shift keys (respectively) while clicking the arrow buttons.
[SP4] <date control>
A keyboard interface has been added to the date controls. Pressing the Alt key and the arrow keys (up/down) will change the month by 1 month. The PageUp/PageDown keys are used to change the years. Using the Alt key will change the year by 1 year. With Alt & Control, change the year by 10 years, and with Alt & Shift, change the year by 100 years.
[SP4] <color wheel control>
A keyboard interface has been added to the color wheel control. The arrow keys may be used to move the color selection. Hold down the Control key while using the arrows to change the value of the color saturation bar.
[SP4] <callbacks>
In the past, when a macro was currently executing code in the macro due to a callback event, then no other callback event would cause its associated code to be executed until the current callback completes. This is no longer true. If a callback event occurs for a callback label different from any callback label that is currently executing, then that callback event will cause the current callback code to be suspended, and the new callback code will be called. This fixes the difficult problem of displaying a callback dialog from the callback code of a previous callback dialog. By restricting this to different callback labels than any currently active callback label, this guarantees that a callback will complete before another callback for that same callback label it is allowed to occur, which could interfere.
[SP3] <region names>
For all places where a region name is accepted, then two special values may be passed.
"" If a "" is passed, then this is the same as leaving off the region name (where possible), and the current default parent window is used, which is set to the main window of the application that started the macro, but can be changed in the macro at any time using the SetDefaultParent command.
"*" If a "*" is passed, then the Windows desktop window is used (the same as a NULL window handle).
[SP4] <operators on non-array and array values>
Non-array values and arrays may now be combined with the ** (^^) and \ operators.
[SP4] <operators on non-array and array values>
When a non-array and an array are combined with the following operators, undefined array elements are ignored and skipped over. They used to cause a runtime error:
&, |, ^, <<<, >>>, <<, >>, ~, AND, OR, XOR, NOT, ** (^^), +, -, *, /, DIV, MOD, %, \, unary -, comparisons, IN
n in a[]
n <bitwise> a[] for &, | and ^
a[] <bitwise> n for &, | and ^
~a[]
n <logical> a[] for AND, OR and XOR
a[] <logical> n for AND, OR and XOR
not a[]
n <math> a[] for +, -, *, /, DIV, %, MOD, ^^, ** and \
a[] <math> n for +, -, *, /, DIV, %, MOD, ^^, ** and \
- a[]
n <rel> a[] for =, !=, <>, >, >=, < and <=
a[] <rel> n for =, !=, <>, >, >=, < and <=
a = "xyz'
declar b[10]
b[1] = "abc"
b[2] = "def"
if (not (a in b[]))
endif
This used to cause an error at runtime: "Values can't be compared in the IN operator". This is because some of the elements of the array were undefined. Undefined elements are now ignored.
[SP3] <most dialogs>
... := FileNameDialog (...)
GetNumber (...)
GetString (...)
GetUnits (...)
... := Menu (...)
... := MenuList (...)
... := MessageBox (...)
Prompt (...)
<user defined macro dialogs>
... := DialogShow (...)
...: = DialogDisplay (...)
<other dialogs and message boxes>
<dialogs in the compiler>
In previous releases, using these commands would occasionally cause anomalies in the display. For example, a Prompt or a Get command could sometimes result in the dialog displaying behind the application rather than in front of it. In version 9, these commands display their dialogs in front of the default parent. The parent for these dialogs is now maintained by the macro, and is initially set to the application that started the macro. These dialogs may be attached to a different application or window by setting a new default parent with the SetDefaultParent command.
[SP4] caseof a[]:
caseof (a=a[]):
case ( )
case call ( )
DLLCall ( )
repeat until (a=a[])
switch (a[])
while (a=a[])
Expressions involving whole arrays were not allowed on the above statements. These commands now accept expressions involving whole arrays.
[SP4] variable :=: variable2
This operator swaps the value of the two variables used as operands of this operator. This command works for simple variables, array elements, or entire arrays. But this command does not work for array slices.
return-value The value of the right hand variable is returned and assigned to the left hand variable.
[variable2] This must be a variable, and the value of this variable is assigned to the left hand variable, and the value of the left hand variable is assigned to this variable.
[SP4] ...: = AppExecute (CommandLine:filename; ...)
... := AppExecuteExt (CommandLine:filename; ...)
This command now accepts application command lines containing spaces in the program filename.
CommandLine If parameters are also being passed to the application in the command line parameter, then the filename of the application must be enclosed in double quote marks so that the begin and end of the filename can be determined. If no parameters are being passed, then no quote marks are required.
[SP4] numeric or enumeration ... := AppExecute (...)
numeric or enumeration ... := AppExecuteExt (...)
Explanation of range of return values.
return-value This command used to treat all values < 32 as errors. 32 is also an error value as well, and so now all values < 33 are treated as errors instead.
[SP4] enumeration := AppExecute (...)
enumeration := AppExecuteExt (...)
The return value is now an enumeration.
return-value The return value is now an enumeration. If treated as a numeric value, all return values less than 33 are considered errors. An enumeration called Success! has been defined with the value of 33, so any value less than Success! is an error. The following enumerations have been defined for the most common return values. As a matter of clarification, if the return value is >= 33, then this function was successful. This return value is an internal Windows handle associated with the process, but appears to have no documented significance. This value is NOT a window handle. Also, the AppExecuteExt command does not cause an error condition if an error occurs starting the application, as AppExecute does.
Success! This is the lowest of all the successful return values. To see if successful, compare the return value to see if it is >= Success!.
AccessDenied! The operating system denied access to the specified file.
BadFileFormat! The .exe file is invalid (non-Win32 .exe or error in .exe image).
DDEBusy! The DDE transaction could not be completed because other DDE transactions were being processed.
DDEFailed! The DDE transaction failed.
DDETimeout! The DDE transaction could not be completed because the request timed out.
DLLNotFound! The specified dynamic-link library was not found.
FileNotFound! The specified file was not found.
InvalidFileAssociation! The file name association is incomplete or invalid.
NoFileAssociation! There is no application associated with the given file name extension.
OutOfMemory! The system does not have enough memory.
OutOfResources! The operating system is out of memory or resources.
PathNotFound! The specified path was not found.
SharingError! A sharing violation occurred.
[SP4] ... := DialogAddListbox (...; [Style:enumertion]; ...)
A new Style enumeration has been added.
[Style] An enumeration called UseTabStops! has been added. This enumeration specifies that the listbox supports tab stops. Without this style, the RegionSetTabstop command will set tabstops on the listbox, but will have no effect. [Unfortunately, this new style does not show in the Command Browser interface for this parameter, even though it is accepted by the macro system.]
[SP3] ... := DialogShow (...; [Parent:string]; ...)
... := DialogDisplay (...)
Change to behavior for parent for dialog editor dialogs.
[Parent] When displaying dialogs created by the Macro Dialog Editor, if no parent is specified, then the same parent is used as when displaying a dialog defined by the DialogDefine statement without a parent. This parent defaults to the window of the application which started the macro, but can be changed using the SetDefaultParent command. In the past, Macro Dialog Editor dialogs would use the Windows desktop in this case. This was the original behavior from earlier versions, and was always preserved for backward compatibility, but has been changed to be consistent with the behavior of all other user interface components of the macro system.
[SP4] numeric or string := DialogShow (...)
numeric or string := DialogDisplay (...)
Clarification of return-value.
return-value This command returns the control name used to dismiss the dialog (for non-callback dialogs), or the window handle of the dialog (for callback dialogs), but it was improperly documented as always returning a numeric value, and not also returning a string.
[SP4] string := DialogDismiss (...)
[SP4] string := DialogUndisplay (...)
Clarification of return-value.
return-value This command returns the name of the control that was used to dismiss the dialog, but it was improperly documented as returning a boolean value.
[SP4] DialogAddBitmap.Style.HasBMPFile!
DialogAddComboBox.Style.NoIntegralHeight!
DialogAddComboBox.Style.DisableNoScroll!
DialogAddEditBox.Style.NoBorder!
DialogAddEditBox.Style.NoHideSelection!
DialogAddListbox.Style.DisableNoScroll!
DialogAddListbox.Style.NoIntegralHeight!
DialogAddListbox.Style.NoRedraw!
DialogAddListbox.Style.HighCapacity!
DialogAddRadioButton.Style.RadioRight!
DialogAddScrollbar.Style.SizeBoxTopLeftAlign!
DialogAddScrollbar.Style.SizeBoxBottomRightAlign!
DialogAddScrollbar.Style.SizeBox!
DialogAddText.Style.Icon!
DialogAddText.Style.LeftWordNoWrap!
These style values for the Style parameters of these commands were accepted by the commands as undocumented numeric values. Enumeration names have been added for these numeric style flags. [describe their purpose later...]
[SP2] ... := FileConvert (...; [SourceFileType:enumeration]; ...)
A new enumeration has been defined for the SourceFileType parameter.
[SourceFileType] The file type of the source file. The following new enumeration has been added.
CorelDRAW9! A Corel Draw version 9 file.
[SP4] enumeration := FileError (...)
An return-value enumeration name was corrected.
return-value A value indicating the last file error to occur.
InvalidDrivePath! This enumeration was misspelled, and has been corrected. The old enumeration name has been retained as an obsolete name for compatibility.
[SP2] enumeration := FileType (...)
A new return enumeration has been defined for a new file type.
return-value The type of the file if recognized.
CorelDRAW9! A Corel Draw version 9 file.
[SP2] ... := FileTypeExtension (FileType:enumeration)
A new enumeration has been defined for the FileType parameter.
FileType The type of the file to return the file name extension for.
CorelDRAW9! A Corel Draw version 9 file.
[SP2] array := FileTypeList (...)
A new return value has been defined for a new file type.
return-value An array of file type enumerations. A new enumeration for CorelDraw9 files is now returned, that corresponds to the enumeration CorelDRAW9! for the FileType parameter of the FileTypeName command.
[SP3] array := FileTypeList (...)
A new return value has been defined for a new file type.
return-value An array of file type values. A new value for the PerfectScript Protected Macro file type (type = 19) is returned. The FileTypeName command does not define an enumeration name for its FileType parameter for this file type, but this new value can still be passed to the FileTypeName command to retrieve its name.
[SP2] ... := FileTypeName (FileType:enumeration)
A new enumeration has been defined for the FileType parameter.
FileType The type of the file to return the file type name for.
CorelDRAW9! A Corel Draw version 9 file.
[SP1, SP3, SP4] IfPlatform ([{<PlatformID>enumeration}])
ElseIfPlatform ([{<PlatformID>enumeration}])
EndIfPlatform ([{<PlatformID>enumeration}])
A new enumeration has 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}] A new enumeration has been added for the current version number of the macro system.
[SP1] _Version9_0_1! This enumeration is recognized if the macro is compiled using the version 9.1.1 (SP1) PerfectScript macro system.
[SP3] _Version9_0_3! This enumeration is recognized if the macro is compiled using the version 9.3.3 (SP3) PerfectScript macro system.
[SP4] _Version9_0_4! This enumeration is recognized if the macro is compiled using the version 9.4.4 (SP4) PerfectScript macro system.
[SP4] IfPlatform ([PlatformID:enumeration])
ElseIfPlatform ([PlatformID:enumeration])
EndIfPlatform ([PlatformID:enumeration])
New platform ids have been added. If the PlatformID parameter matches the current platform id then the enclosed statements are compiled.
[{PlatformID}] The platform id to compile the enclosed statements for.
Win2000! This platform id is recognized, but will not match since the current code build is for Windows 9.x.
CorelWine! This value is recognized as a synonym for Linux! in the Linux version of the suite.
[SP1, SP3, SP4] numeric or string := MacroInfo (InfoItem:enumeration; ...)
MacroInfo now returns a new value for the PerfectScript version.
return-value A new value is returned for the PerfectScript version, depending on the SP level.
InfoItem The item to return information about.
PerfectScriptVersion! (Numeric) A numeric form of the PerfectScript version number. The value is either 901001, 903003 or 904004, depending on the SP level.
PerfectScriptVersionString! (String) A string version of the PerfectScript version number. The string returned is "9.01.001", "9.03.003", or "9.04.004", depending on the SP level.
[SP4] any := MacroInfo (InfoItem:enumeration; ...)
New items are available for the InfoItem parameter.
return-value See the information about the InfoItem parameter.
InfoItem The item to return information about.
SpeedDelay! (Numeric) Return the current delay set by the Speed command.
MacroID! (Numeric) The macroid that was specified by the requestor.
Requestor! (String) The name of the application that requested the macro play.
StartLabel! (Label string) The name of the label that was specified when the macro was started.
CallbackDepth! (Numeric) The depth in the callback hierarchy of the current routine call.
[SP4] string := MacroInfo (InfoItem:enumeration; ...)
MacroInfo now returns a new value for the PlatformName! InfoItem.
return-value A new value is returned for the platform name. The following new names can be returned:
"Win2000" For Windows 2000.
"Win32??" For an unrecognized version of Windows 32.
"WinNT??" For an unrecognized version of Windows NT.
"Corel Wine" For the Corel Linux version.
[SP1] ... := Menu (...; [HorizontalPosition:numeric]; [VerticalPosition:numeric])
... := MenuList (...; [HorizontalPosition:numeric]; [VerticalPosition:numeric])
The position parameters are now DWORD, not unsigned WORD.
[SP3] ... := Menu ([MnemonicType:enumeration]; ...; {MenuChoice:string})
... := MenuList ({MenuChoice:string}; [Title:string]; ...)
A number of new features have been added.
[MnemonicType] A new Mnemonic type has been added. This new type currently has no enumeration name, but has a numeric value of 2. When used, the first char in the string is used as the accelerator key and that accelerator character is removed from the menu text (or if the first char is a "&", then the next char is used instead).
MenuChoice A horizontal separator can be created by a menu choice with the text string of "-----" or "_____" (5 characters). This separator counts in the menu item count, and the index of the following items includes the separator item in their index numbers.
For Mnemonics types of Letters! and Digits!, the character just after an embedded "&" will be used as the accelerator (the & is then removed).
All excess "&" characters are removed from the menu item strings.
[Title] The Title parameter in MenuList displays as an additional first item in the menu, which is a disabled item.
[SP1] ... := MaxN (Nth:numeric; ...)
This command returns the Nth largest value in a list values.
Nth If a value < 1 is passed, then return the largest value. If a value > than the number of elements is passed, then return the smallest value. Out of range values used to return a very large negative value to indicate an error.
[SP1] ... := MinN (Nth:numeric; ...)
This command returns the Nth smallest value in a list values.
Nth If a value < 1 is passed, then return the smallest value. If a value > than the number of elements is passed, then return the largest value. Out of range values used to return a very large negative value to indicate an error.
[SP1] Prompt (...; [HorizontalPosition:numeric]; [VerticalPosition:numeric])
The position parameters are now DWORD, not unsigned WORD.
[SP4] Prompt (...)
The text displayed on the prompt dialog can now be selected and copied to the clipboard.
[SP3] string := RegionGetName (...)
Return the region name of the specified region. This command now works for named regions of other WordPerfect Suite applications besides PerfectScript. It used to work only for regions of dialogs created by macros, or dialogs belonging to PerfectScript.
return-value The name of the region. If the region does not exist, then "" is returned.
[SP4] numeric := RegionGetStyle (...; [StyleWord:enumeration])
The return value has been changed.
return-value The return value for the Styles! option of the StyleWord parameter used to return the set of control styles used by the macro system internally. This value was of no value externally, and has been changed to return the styles that are specified by the Style/Option parameters of the DialogDefine and DialogAdd... statements. The return value can now be bit tested against the enumerations of the Style/Options parameters of these commands to see if a specific style is present.
[SP3] ... := RegionSetFocus ([NamedRgn:string])
The NamedRgn parameter is now optional.
[NamedRgn] If this parameter is missing, then the focus is not moved to a new region, but remains where it currently is, and the current focus is returned.
[SP4] ... := RegistryOpenKey (...; [Access:enumeration])
... := RegistryCreateKey (...; [Access:enumeration])
A new parameter has been added.
[Access] This parameter specifies the access mode to be used for the Registry... command on this key. If missing, then the access mode is the default for the platform that the macro is running on, which is what was used in the past. This is generally the same as ReadWrite!. If an attempt to access the key is made which requires access that is not allowed by this parameter's value, then this command will fail and generate an error. (Win95 and Win98 do not support access rights to the registry, and all access attempts will work regardless of the access mode specified).
ReadOnly! Items in this key will only be read, and not written.
WriteOnly! Items in this key will only be written to, and not read from.
ReadWrite! Items in the key opened will be both read and written.
[SP4] enumeration := RegistryCloseKey (...)
enumeration := RegistryDeleteKey (...)
enumeration := RegistryDeleteValue (...)
enumeration := RegistryQueryLastError
enumeration := RegistrySetValue (...)
A new return value has been defined.
return-value 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 the specified registry key in the specified manner. For example, a non-administrator user will get this return code when an a key in LocalMachine! is opened for WriteOnly! or ReadWrite! access, and then RegistrySetValue is called.
[SP4] ... := RegistryEnumValue (Hkey:enumeration; ...)
Correction to information displayed in the command inserter.
Hkey The command inserter used to display a default value for this parameter, even though this parameter is required. No default value is displayed for this parameter.
[SP4] ... := RegistryEnumValue
Clarification of the ValueNumber parameter.
ValueNumber The index of the value to obtain. This index is zero-based, and so starts with 0 (zero) as the first value. If the index is a -1, then the value of the default registry value for this key is returned.
[SP4] ... := RegistryQueryValue (...; [Value:string]; ...)
Clarification of the Value parameter.
[Value] The name of the registry value to get. If missing or "", then the value of the default value is returned.
[SP4] ... := RegistrySetValue (...; [Value:string]; ...)
Clarification of the Value parameter.
[Value] The name of the registry value to set. If missing or "", then the value of the default value is set. The default registry value must a type of String! (for Win95/98).
[Rel or SP3?] numeric := SetDefaultParent ([Parent:string or enumeration])
This command sets and gets the handle that will be used as the parent window for the Prompt, MessageBox, and Get... commands and Macro Dialogs that don't otherwise specify a parent window.
return-value The previous parent window is returned from this command.
[Parent] The named region or the window handle of the window to be used as the new default parent for dialogs and prompts. Some enumerations have also been defined to specify certain regions. If missing, NoChange! is used.
ResetToOriginal! Restore the default parent to the original parent. The original parent is always the top-level window of the application that started the macro.
NoChange! Don't set a new default parent, simply return the current default parent's window handle.
Desktop! Set the parent window to be the Windows Desktop.
PerfectScript! Set the parent window to be PerfectScript.
V8Compatible! Set the parent window to be the same as what version 8 used (a non-child window).
[SP4] numeric := Speed ([TenthsOfSeconds:numeric])
The parameter is now optional, and the current speed delay value is returned.
return-value The current speed delay value in tenths of a second. 0 means there is no delay.
[TenthsOfSeconds] The new speed delay value. If missing, then the speed delay is not changed, and the current value is returned.
[SP4] enumeration or boolean := ValueType (...)
Clarification of return-value.
return-value This command returns either the type of the value, or a True/False value (depending on input parameters) but it was improperly documented as always returning an enumeration value, and not also returning a boolean value.
[SP4] ... := VersionInfo (ObjectItem:enumeration; ...)
New enumerations have been defined for the ObjectItem parameter.
ObjectItem The item that version information is requested for.
WordPerfectVersion! Return information about WordPerfect (uses wpwin9.exe).
PresentationsVersion! Return information about Presentations (uses prwin9.exe).
QuattroProVersion! Return information about QuattroPro (uses qpw.exe).
New Commands and Language features
This section describes new commands and language features which have been added.
<new reserved words>
[SP1] <starting a macro>
[SP4] <third party DLLs>
[SP4] __Extend
[SP4] CallbackFlush
[SP4] DatePart
[SP4] FileGetLongName
[SP4] FileGetShortName
[SP4] MacroProtect
[SP4] MacroHasSource
[SP4] MacroIsProtected
[SP4] RegionGetFocus
[SP4] RegionSetTabStops
[SP4] Resume
[SP4] TimePart
<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.
[SP1] <starting a macro>
When a macro is started from an application, that application can specify an initial starting label to begin at. This is for future planned capabilities, and would be documented in the SDK, not in the end user documentation.
[SP4] <third party DLLs>
2 new API routines have been added to the PerfectFit shared code to support 3rd party DLLs. These routines are TPHRegisterDLL and TPHUnregisterDLL. These routines can be called by a 3rd party DLL to register (or unregister) itself for a particular version of an application. These routines write the proper entries in the system registry. This is to be documented in the SDK, and not in the end user documentation.
[SP4] boolean := __Extend (Option:numeric)
This is a dummy test token of the macro facility.
return-value True if successful.
Option A value specifying which type of test routine to exercise.
0 Display the "About" dialog.
1 Display the "Tools" dialog.
2 Display the "Splash" screen.
3 Remove the "Splash" screen.
4 Display the "Settings" dialog.
[SP4] CallbackFlush (Label:label)
This command is used to purge pending callbacks from the callback queue for the specified label. Use this command with extreme caution. Removing callbacks form the callback queue for a label will change the behavior of the macro.
Label The label to purge callbacks for.
[SP4] date := DatePart ([Date:date])
Remove the time from the specified date, returning a date with only the date part in it. The time portion of the date/time value returned will be cleared, which is interpreted as midnight.
return-value The date part of the specified date.
[Date] The date to return the date part of. If missing, then the current date is used.
[SP4] filename := FileGetLongName (Filename:filename)
This command returns the full long name of a filename.
return-value The long file name for a short file name containing the short 8.3 DOS name format.
Filename The short 8.3 filename form of the file.
[SP4] filename := FileGetShortName (Filename:filename)
This command returns the short 8.3 form of a filename.
return-value The short file name for a long file name containing the long name format.
Filename The long filename form of the file.
[SP4] boolean := MacroProtect (MacroFileName:filename; [ProtectMacro:enumeration]; [RemoveSource:enumeration])
This command will protect and/or remove the source code from a macro file.
Return-value Returns True if successful, False otherwise.
MacroFilename The name of the macro file to protect.
[ProtectMacro] Specifies whether the macro is to be marked as a protected macro file. If this parameter is missing, then NoChange! will be used (the protection of the macro will not change). The protection on a macro can be reversed in the future.
Yes! Mark the macro as a protected macro file. This will prevent WordPerfect from recognizing this file as a WP document, and will not allow the document to be opened or edited.
No! Don't mark this macro as protected. If the macro is already marked as protected, then this will clear the protection, allowing the macro to be opened in WP.
Toggle! This will toggle to protection of the macro. If protected, it will clear the protection. If not protected, it will protect it.
NoChange! Don't change the current protection of the macro.
[RemoveSource] Specifies whether the source should be removed from the macro or not. If this parameter is missing, then NoChange! will be used (the source will not be removed from the macro). Once the source is removed from a macro, then source cannot be restored in the future. This is a permanent one-way operation.
Yes! The source is removed from the macro. This cannot be reversed.
No! The source is not removed from the macro.
NoChange! No change is made to the source of the macro.
[SP4] boolean := MacroHasSource (MacroFilename:filename)
This command returns whether the specified macro still has the source in it.
return-value True if the macro still has its source code.
MacroFilename The name of the file to check for source.
[SP4] boolean := MacroIsProtected (MacroFilename:filename)
This command returns whether the specified macro is marked as a protected macro file.
return-value True if the macro is protected.
MacroFilename The name of the file to check for protection.
[SP4] numeric := RegionGetFocus ( )
Return the window handle of the region that currently has the focus.
return-value The window handle of the window with focus.
[SP4] RegionSetTabStops (NamedRgn:string; [{Tab:numeric}])
This command sets the tabstops in a named region. Only certain types of regions support tabstops (like listboxes), and will have no effect on other region types. The region must also have been defined with the UseTabStops! style, or the tabstops will be ignored.
NamedRgn The name of the named region to set the tab stops from.
[{Tab}] The list of tab stops to apply to the listbox. These tabstops must be in ascending order, or the results are unpredictable. If this parameter is left off, then tab stops are set to a value of every 2 dialog units for the entire width of the control. If there is only 1 tabstop specified, then all tabs stops are set to this spacing for the entire width.
[SP4] Resume ( )
This command cancels a "pause" condition that was entered because of a Pause command, or from a pause menu item in PerfectScript or one of the applications in the suite. Normally, once a macro has entered a paused state, it does not execute any macro commands. But through the use of timers (see OnTimer), a macro can execute macro code even while in a paused state. This command accepts no parameters, and returns no values.
[SP4] date := TimePart ([Time:date])
Remove the date from the specified time, returning a date/time with only the time part in it. The date portion of the returned date/time value is cleared, which represents an invalid date.
return-value The time part of the specified date/time.
[Time] The date/time to return the time part of. If missing, then the current date/time is used.
Bugs Fixes and Corrections
[SP1]
<macro dialog editor>
- Could not resize view control in dialog editor.
- Disable "right" and "center" justification for single line edit controls
- Remove useless initial text value from edit controls.
- Sample font text was hard coded in English.
- Cascade multiple open dialogs in dialog editor.
- When editing 2 dialogs, after switching back to first dialog, sizing a control with the mouse brought up the properties dialog.
- Disable non-applicable menu items when editing a dialog.
- After setting tab stops on custom controls and closing the dialog editor, the position of the custom controls moved to the upper left.
- When a dialog created with a prior version of PerfectScript with a viewer control is loaded into the dialog editor, an error used to occur. But no error message was displayed, the dialog just wouldn't load. This was because the viewer control defined in the dialog referred to a window class name that does not exist in the current version. This has been corrected, and viewer controls from dialogs created in all older versions now load properly.
- When a dialog containing a custom control of an unknown class type was loaded, it would not load at all. No error messages was displayed, the dialog just couldn't be loaded. Now, this control is converted to a generic button control and labeled with "** Error **". The control can then be modified. It is important then, that the control class be registered at the time the control is added, and when the dialog is loaded to be worked on (and of course when the macro is played). Older versions of the dialog editor will not be able to load the dialog at all, while version 9 SP1 can at least load the dialog, though the control will require some work.
<open file dialog>
Setting of the "Change Default folder" option in the open file dialog was not being remembered.
<remove macro source>
Once a macro has had its source removed, the macro could no longer be used. The file type was not recognized, and couldn't be converted.
<protected macros>
Protected macros were being marked with the wrong document type, and were not useable again, even in PerfectScript itself.
SmartShape
IPF during playback of macro containing smartshape creation (deallocate of invalid macro array variable error).
Menu
MenuList
Use of certain "menu" commands caused IPF in NT.
<play from Explorer>
Play of macro from Explorer icon with parameters generated error on the first parameter.
<macro debugger>
When selecting a dialog in the dialog list info window, the "controls" area was not cleared properly before displaying the controls of the newly selected dialog (if any).
<DDE>
- Commands sent to the DDE topic of an application were not parsed properly if there was a space before the "(", and the parameters were not recognized.
MMPlay
MMSpeak
MMSpeakClipboard
MMPlay, MMSpeak and MMSpeakClipboard were not working properly in Win98.
[SP2]
DateOfNthWeekday
Failed on some dates (like leap days, and 5th weeks).
AppActivate
Sometimes failed even when the window handle was valid. Now do a SetForegroundWindow to the specified window first.
[SP3]
Menu
MenuList
Menu items for the Menu and MenuList commands was limited to 39 characters. Longer text caused a memory overrun to corrupt memory.
<help>
- The wrong help file was being displayed from the context sensitive help in the About dialog of PerfectScript.
- The wrong help pages were being displayed for the individual pages of the settings dialog (help was swapped on some pages).
- Various context sensitive help topics were generating the wrong help index id, and so generating "No help topic found", or "No help file found" messages.
- Help context id for WP listboxes was wrong.
DialogShow
When dialog width was > height of the screen, then the dialog was placed centered at the top of the screen when using percent positioning. It should have been comparing the height of the dialog to the height of the screen instead.
<recompile>
Canceling a recompile of an already compiled macro would report a "Bad File Format" error message.
<compiler>
Compiling empty macros now causes an error.
DLLLoad
Was always displaying an error message, even when OnError was enabled in the macro.
<file type detect>
- Improve WP4.2 and Unicode file format detection.
- dBase IV database file detection was checking for the year of the last update to be greater than 80 using 2 digits. For files created in 2000, this check was failing.
<macro debugger>
- "?" button on toobar now invokes the "whats this" help mode rather than the general help.
- Splitbar in "dialog" list info window wasn't full width of the window.
- Context sensitive help for tokens was case sensitive to how it was spelled in the macro. If case didn't match the PID, then no tooltip was found.
- Debugger no longer stops twice on the first line of the macro now.
- Breakpoints on array variables were causing an internal error and macro stack was being corrupted.
- (??a[?] or a[. Is a wild card in watchlist??)
- Calling routine name for local labels was displayed as the label itself, not its parent.
- Many context sensitive help topic ids were the same, so the same generic help was being displayed. The help topic ids are more specific now to the context.
[SP4]
<assignments>
522195 - Can no longer assign value to a variable with same name as a command token, such as GetString.
<date controls>
The date control will now read the system settings for short dates when ever it needs to format the date to place into the date control, or to get the date out of the control. These settings were only read on startup of the shared code before, and if the system settings changed while shared code was loaded, the setting would not be examined until the shared code was completely shut down and restarted.
<listbox controls>
Listbox controls with the WPChars! style were not properly supporting or handling wide list entries and horizontal scroll bars attached to them.
<edit boxes>
Edit boxes with the WPChars! style and ReadOnly! were not being drawn with the proper background color.
<counter and filename controls>
These controls had resource memory leaks in them that would deplete system resources after a time
<region names>
In some cases, the lookup of a region name was case sensitive. Region name lookups are no longer case sensitive.
NetConnect
NetDisconnect
Sometime in version 8, these tokens were damaged so that they would only bring up the dialog if the RunUnattended flag were set; which is completely backwards.
<Command Inserter>
When copying the name of an enumeration into the edit box when the enumeration was highlighted as a default enumeration, then non-visible formatting characters were also copied into the edit field, which would cause a compile error if placed into a macro.
<dyna-enumerations>
Enumerations for dyna-thetas were not properly recognized and invalid code was produced. This has never been a problem, since dyna-thetas have not been able to have enumerations before now.
<Macro Compiler>
<Macro Debugger>
<Macro Decompiler>
The Compiler, Decompiler, and Debugger were showing the wrong opcodes for some opcodes in the listing/decompiled code for the following opcodes. The opcodes were exchanged with the specified opcodes:
ProductFunctionCallDyna exchanged with ProductFunctionCallWord
ProductProcedureCallDyna exchanged with ProductProcedureCallWord
ObjectProcedureCall exchanged with ObjectSetProperty
<PerfectScript>
The splash screen is no longer displayed when PerfectScript is started with the "/#" command line option.
<Interpreter>
dir[] = {""; ""; ""}
d[] = {""; ""; ""}
if (d[1..3] != dir[1..3])
endif
This used to cause an error at runtime: "Internal error - An incorrect number of entries are on the stack".
b[] = {1}
c[] = b[1..b[0]-2]
[Rel version??] This used to cause an error at runtime: "Array index of dim 1 of b[3] must be between 1 and 1; found 3".