New in PerfectScript for Corel Office 7



This document describes new and improved features in PerfectScript. It includes new features and changes since WordPerfect Suite 7. This version of this document also includes the undocumented features and commands.



Document Change Log

4/13/98 JDan 3.07 - Update return value information for some commands.

9/8/97 JDan 3.06 - Minor document changes.

6/27/96 SteveCa Documented change in MacroDialogResult on dialog editor dialogs.

6/26/96 SteveCa Added the Overview of Compatibility section

6/26/96 AlanG DialogDismiss and DialogHandle tokens have changed behavior

6/6/96 SteveCa Added Help Online to PerfectScript's Help menu.

6/5/96 SteveCa Changed InternetBrowser token to GoOnline and made it more general.

6/5/96 JDan Document exit handler commands OnExit, and ExitHandlerState, and changes to the Condition, OnCondition, OnCondition Call and MacroInfo commands to support exit handlers.

6/5/96 JDan Document negative Beginning parameter to SubStr and SubChar.

6/5/96 JDan Document new Options parameter to StrTransform command.

6/3/96 SteveCa Added InternetBrowser token; document new type in RegistrySetValue and RegistryQueryValue

5/30/96 JDan Document optional last parameter in SubStr and SubChar.





Quick Overview of PerfectOffice 3.0 Macro Compatibility



This section provides a quick overview of things you may need to do to your PerfectOffice 3.0 (WPWin 6.1) macros to make them work in PerfectScript 7.



72% ran without change

15% had to be changed because of DLLCall usage, Callback changes for Windows 95, or BIF usage that is no longer applicable because settings are now in the Windows Registry

10% had to be changed because of changes to WordPerfect or Draw commands

2% had to be changed because of new reserved words in PerfectScript (MAX, SIN, COS, etc.) and WordPerfect 5.2 syntax that is no longer supported





PerfectScript (the program--PS70.EXE)



• "Help Online" is now available in PerfectScript. This will allow the user to connect to the Corel PerfectScript site on the Internet or to the Corel forums on CompuServe.





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 MacroFacility (PS70) is controlled by a specific registry setting. This registry setting is (note the leading space in the name of the value):



HKEY_CURRENT_USER\Software\PerfectOffice\PerfectScript\7\Settings\" Show Hidden 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 settings are available in the "Settings" dialog.



This registry setting can only be set by running the registry editor (regedit.exe) and manually adding or modifying this registry setting, and cannot be be toggled on/off through a command accelerator key sequence in the MacroFacility.



Hidden keystrokes Macro Facility (PS70)

Control Shift Alt Key Command

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



Hidden keystrokes in the Command Inserter

Control Shift Alt Key Command

Control Shift Insert button Dump Command List

Control Shift Alt Insert button Brief Command Dump



Hidden registry settings

All hidden registry settings (except those stated below) can be accessed in the "Settings" dialog of the MacroFacility.

"Prefered 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)



Hidden preference dialog settings

The following preference settings are accessable from the "Settings" dialog of the MacroFacility when the Advanced / Hidden settings are enabled:

General page

Show icon during compile

Show icon during play

Show progress during play [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

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

Display compile warnings

Display compile errors

Display compile fatal errors

Display compile message %d [not used]

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 enumeration return type control [not used]





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.

<none>





Modified and Improved Commands and Language Features



This section describes changes to existing commands and, where applicable, incompatibilities that may arise with old (PerfectOffice 3.0 and prior) macros. In this section, "..." indicates places where existing capabilities have not been changed.

Assert

Condition

DialogDismiss

DialogHandle

MacroInfo

OnCondition

OnCondition Call

RegistryQueryValue

RegistrySetValue

StrTransform

SubChar

SubStr



Assert

A new enumeration has been has been added to the Condition parameter of the Assert command:

ExitCondition! Asserting this condition causes the macro to terminate, as if a Quit command had been encountered.



Condition

A new enumeration has been added to the Condition parameter of this command:

ExitCondition! Specify the new state of the exit handler for this macro. This command is equivalent to the ExitHandlerState(state) command.



DialogDismiss

DialogDismiss will no longer give an error if the dialog does not exist, but will just continue on in the macro.



DialogHandle

DialogHandle will now attempt to load the dialog if it isn't already loaded. If we can't load it, we fail.



MacroInfo

Four new enumerations have been added to the InfoItem parameter of this command to support exit handlers:

ExitOn! (Boolean) Return the state of exit handler calling. This is equivalent to the command:

ExitHandlerState() = ExitHandlerState.On!

ExitSetup! (Boolean) Return whether an exit handler has been established. This is equivalent to the statement:

OnExit() != ""

ExitCall! (Boolean) Whether the exit handler is called, or jumped to. Exit handlers are always called and so this will always return TRUE, if an exit handler has been established.

ExitHandler! (Label) The label of the established exit handler. This is equivalent to the command:

OnExit()



OnCondition and OnCondition Call

A new enumeration has been added to the Condition parameter of these commands:

ExitCondition! Establish an exit handler to be called when the macro terminates. The Label parameter is the label of the exit handler. This command is equivalent to the command OnExit(label).



RegistrySetValue and RegistryQueryValue

A new enumeration has been added to the Type parameter of these commands:

PFLogical! Allows you to work with Registry values expecting this type.



string := StrTransform (String:string; FromChars:string; [ToChars:string]; [Options:enumeration])

A new optional last parameter (Options) has been added to the StrTransform command. The full description of the StrTransform command is now as follows.

Tranform characters in a string to other characters

return-value The string with the specified characters replaced with the specified characters.

String The string to be tranformed.

FromChars The characters in the string that are to be transformed.

[ToChars] The characters that are used in place of the characters in the FromChars parameter. There is a 1 to 1 mapping of characters in the FromChars parameter to characters in this parameter. (ie. all characters matching the first character of FromChars in String are replaced with the first character in ToChars, etc). If missing, or shorter than FromChars, then all characters in String that match characters in FromChars with no corresponding character in ToChars, are removed.

[Options] Options controlling the interpretation of the FromChars and ToChars parameters, and how many transformations are performed.

If Characters! is specified, then each character in FromChars is transformed into a corresponding character in ToChars. If Strings! is specified, then FromChars is treated as a whole string, and occurrences of this string of characters are transformed into the string in ToChars.

If FirstOnly! is specified, then only the first occurrence is transformed. If All! is specified, then all are transformed. If a number is specified, then that many occurrences will be transformed. If missing, then Characters! | All! is used.

Characters! FromChars and ToChars contain individual characters that are to be transformed independently.

Strings! FromChars and ToChars contain a single string of characters that is to be transformed as a whole.

FirstOnly! Transform only the first occurrence of the FromChars parameter that is found.

All! Transform all occurrences of FromChars that are found.



SubStr and SubChar

The last parameter (the NumberOfChars parameter) of SubStr and SubChar is now optional. If left off, it defaults to extracting the rest of the string.

The Beginning parameter can now be negative. This indicates that the SubStr should start extracting the substring this many characters from the end of the string, where -1 means the last character of the string.





New Commands and Language Features



This section describes new commands and language features which have been added.

new reserved words

ExitHandlerState

GoOnline

OnExit



new reserved words

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.

<none>



enumeration := ExitHandlerState ([State:enumeration])

Enable or disable the calling of the exit handler on exit conditions in a macro.

return-value The previous state of exit handler recognition.

On! Exit handler condition calling was enabled.

Off! Exit handler condition calling was disabled.

[State] The new state of exit handler condition recognition. If left off, then the current state is not changed. This command is similar to the Error(), Cancel() and NotFound() commands. However, those commands prevent the error, cancel or notfound condition from being recognized, continuing as if the condition had not occurred. Unlike those commands, this command does not prevent or enable the condition from occurring, but enables or disables the calling of the established handler when the condition occurs.

On! Enable exit handler condition calling. Enabling the exit handler state allows any established exit handler from being called when an exit condition occurs. This is the default state of the exit handler.

Off! Disable exit handler condition calling. Disabling the exit handler state prevents any established exit handler from being called when an exit condition occurs.



GoOnline ([Service:enumeration]; [Location:string])

This command will start an online service at a particular location.

[Service] Specifies the service with which to connect. It can be one of the following:

Internet!

CompuServe!

Other!

If this parameter is not specified, Internet! is assumed.

[Location] The optional location at which the online service will start. If the service is the Internet, this is a URL (Uniform Resource Locater). For example, GoOnline (Internet!; "http://home.netscape.com") will start the internet browser at the Netscape home page. If the service is CompuServe, this is the "GO" location. If the service is Other! Then this parameter is required and is the command line that will be executed.



label := OnExit ([Label:label])

Establish an exit handler for the current macro.

return-value The previous exit handler label. "" is returned if there was no previous exit handler.

[Label] The label to be established as the exit handler. Whenever an exit condition occurs, execution of the macro will call this label. An exit condition occurs when a Quit command is encountered, when a Return command from the main body of a macro is encountered, when there are no more macro statements to execute (execution falls off the bottom of a macro), or when an ExitCondition! is asserted using the Assert command. If no label is specified, then the exit handler is cleared.





Bugs Fixes and Corrections