New in PerfectScript 8 for WordPerfect Suite 8



This document describes new and improved features in PerfectScript since Corel Office 7. This version of this document also includes the undocumented features and commands.



Document Change Log

6-23-98 JDan 1.55 - Misc typos.

4-13-98 JDan 1.54 - Update return value types for some commands.

9-8-97 JDan 1.53 - Minor changes.

9-4-97 JDan 1.52 - Correct information about block comments /* and */.

8-4-97 JDan 1.51 - Various cleanups and corrections. Add information about various undocumented commands and options.

7-30-97 JDan 1.50 - Add hidden text and comments, and made other minor type corrections.

4-28-97 SteveCa Changed some enumerations on the FileConvert commands.

4-28-97 JDan 1.48 - Added explanation of the values placed into MacroDialogResult by the Dialog... commands.

Explain the removal of enumerations from the IfPlatform commands.

Describe new ObjectInfo command.

Update the reserved word list.

4-25-97 JDan 1.46, 1.47 - Finished callbacks description. Made NameOf description italics. Added "Object" return value and parameter to ValueType command. Renamed VersionItem parameter of VersionInfo command to InfoItem.

4-24-97 JDan 1.45 - Some sections were duplicated when I merged 1.44 with 1.43. This was corrected. More information added to callback array descriptions.

4-23-97 JDan 1.44 - Return value of DialogShow command was never Documented. Clarify return value from the DialogDismiss command. Describe the new "==" equality comparison operator. Describe the NameOf command.

Finally added the section on callbacks.

4-23-97 SteveCa 1.43 - Minor editing

4-22-97 JDan 1.42 - Change syntax of built-in (non-product) macro commands to not use the named parameter syntax (":"). The following are still builtin commands and were affected by this change: IfPlatform, EndIfPlatform, ElseIfPlatform, DLLCall, DLLCall Prototype, Object, EndApp, NewDefault, With, EndWith, LIKE, IN, Indirect and CompileMessage.

Data type of VariableName parameter of Indirect command changed from "variable" to "string".

4-22-97 JDan 1.41 - Add month enumerations to Month parameter of DateOfNthWeekday command.

Removed trailing underscore from _VERSION8! for IfPlatform command.

4-21-97 JDan ObjectType parameter of the Object statement is now optional.

Added more entries to the obsolete section.

Miscellaneous typo changes.

Added missing information in IfPlatform.

4-17-97 JDan Rename TimeZoneInformation to be TimeZoneInfo.

4-16-97 JDan Add description of RandomSeed command.

Describe change to IN operator. Describe existing (but not documented) LIKE operator.

Describe behavior of RegionGetSelectedText.

Add descroption of block comment ability.

Describe OLE Object statements, and changes to product mnemonic statements that also support OLE objects.

4-15-97 JDan Add clarification of enumerations for the Style parameter of the MessageBox command.

Clarify description of enumerations of the Prompt command.

Add enumerations to Beep command.

4-14-97 JDan RegionSetFocus returns the handle of the previous window with focus.

4-11-97 JDan Add names of more new reserved keywords. Change name of new values for IfPlatform. Describe ErrorNumber better.

Describe new and never documented changes to DLLCall and DLLCall Prototype.

4-9-97 JDan Added DateTime! enumeration to ConvertType and ValueType commands.

4-8-97 JDan Described the error enumeration returned from date and time tokens, and more fully describe the date tokens.

4-4-97 JDan Reserved word conflict for keyword ErrorMessage was internal mistake, and has been renamed to ErrorSeverity. Description of other new reserved keywords has been added.

Spelling of return enums from ErrorNumber were changed, and a new enumeration was added.

Added new InfoItem enumerations to the MacroInfo token.

4-2-97 SteveCa Added FileTypeExtension command.

3-27-97 SteveCa Added FileTypeList and FileConvertError commands.

3-25-97 SteveCa Changed the FileConvert command.

3-25-97 JDan Renamed RegionExists command to DoesRegionExist.

Added RegionGetListContents command.

Added additional information for VersionInfo.

3-25-97 SteveCa Added description of the new commands FileType, FileTypeName and FileConvert.

3-24-97 JDan Changed description of DialogSetBitmapFilename to RegionSetBitmapFilename.

No longer document the Assign command.

Added clarifying explanation for the Parent parameter of the DialogShow command.

Return value of DialogDismiss is not a boolean, but a string with the control name in it.

Added explanation of the use of "..." in this document. Added more "..." entries where appropriate.

Removed description of change to RegionGetWindowText and RegionSetWindowText commands. These commands have not been changed.

Added description to Region... commands to explain that the index used in these commands is a 1 based index.

Reversed order of Item and Index parameters in RegionAddListItemByIndex command.

Added description of return-value for RegionGetPosition command.

Changed description of the VersionInfo command.

Added description of changes to the NewDefault and EndApp commands for OLE objects.

3-11-97 SteveCa Document the source code stripper

3-11-97 JDan No longer document the Coach... () commands.

3-11-97 JDan Added corrections to various new and changed commands.

3-11-97 JDan Correct description of DialogControlUpdate and DialogControlQuery to match code.

Add initial part of OLE object documentation (just new command names: Object, GetObject, CreateObject, With and EndWith).

3-10-97 SteveCa Changes in PerfectScript User Interface

2-13-97 SteveCa RegionSetCheck now takes Checked and Unchecked in place of Check and Uncheck.

1-24-97 JDan Describe irregularities in Counter controls and the RegionGetWindowText and DialogAddCounter commands.

1-7-97 SteveCa Document RegionSetBitmap (which supercedes RegionSetBitmapFilename).

12-18-96 JDan Describe default value for optional State parameter of DialogAddScrollBar command.

Describe new enumerations for RegionGetCheck and RegionSetCheck commands.

Describe new RegionIsVisible command.

Describe new RegionGetListItem command.

Describe default value for optional State parameter of RegionShowWindow command.

Describe default value for optional State parameter of RegionSetModified command.

Describe new VersionInfo command.

Describe new StrMakeList and StrParseList commands.

12-18-96 SteveCa Changed RecentFiles parameter of FileNameDialog

12-12-96 JDan Rename new region list by index commands to be consistent with the non-index types of the same names.

12-11-96 JDan Add True and False to command inserter. Changed RegionGetInfo to RegionGetPosition. Describe RegionExists command. Describe new return value of RegionEnableWindow command.

12-4-96 SteveCa Allow Reg commands to access HKEY_PERFORMANCE_DATA, HKEY_CURRENT_CONFIG, and HKEY_DYN_DATA.

11-20-96 SteveCa Encourage users to remove popup controls from their macro dialogs.

10-25-96 SteveCa Macro extension is no longer user-configurable. It is now always .wcm.

10-16-96 SteveCa Added RegionGetInfo command (same as CoachGetRegionInfo)

9-11-96 JDan Added full description of the parameters for the DialogControlQuery, DialogControlUpdate, RegionListGetItemByIndex, RegionRemoveItemByIndex, RegionSelectItemByIndex and RegionSetEditSelection commands.

8-15-96 JDan Indirect command can now be used on the left hand side of an implicit assignment statement.

8-13-96 JDan Dimensions command is now a command, and the second parameter is now an enumeration.

8-13-96 JDan Exists and Discard commands are now commands.

8-9-96 AlanG New commands: RegionList[Get | Remove | Select]ItemByIndex, DialogControlQuery, DialogControUpdate, fix RegionSelectListItem to work with Multi/Extended selection controls.

8-9-96 AlanG User dialogs are positioned relative to the task tray.

8-8-96 AlanG Repeating item param added to DialogAddListItem command.

8-8-96 AlanG Added RegionSetEditSelection command.





Quick Overview of Corel Office 7 Macro Compatibility



This section provides a quick overview of things that may need to be done to Corel Office 7 macros to make them work in PerfectScript 8. 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--PS80.EXE)



The default filename extension for macros is now always .wcm and is no longer configurable by the user. However, a macro can have any extension (or no extension) and still be compiled and played. But the default extension will now always be .wcm.



PerfectScript now sends another token through its third party token chain:

MacroEnd (<PlayLibraryStruct>rawbinary)

This token is passed to the third party token chain when a macro is ending. The intent is to inform a third party DLL that a macro is ending.

TokenID = 2

Application = "PerfectScript"

ParamCount = 1

Requestor = [will vary]

MacroID = [will vary]

rgParam[0].eType = eParmRawBinary (94)

rgParam[0].uData.lpvPtr = ptr to MAC_PLAYLIBRARY structure

Third Party return values: all token return values are ignored





PerfectScript Interface Changes



The Edit and Resource menu items were removed. In their place is a Tools menu that contains items to edit macro dialogs and change settings. These changes are consistent with similar changes in the other Suite applications. PerfectScript now also has a status bar at the bottom of its window.



An option has been added to the File menu that allows the source code to be removed from a macro. This is useful, for example, if you want to ship macros to customers but don't want them to be able to modify or view the source code. Before removing source code from a macro, you should compile and make an archival copy of the file, since removing the source code permanently deletes the source.





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 (PS80) 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\Corel\PerfectScript\8\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 menu items are available in the MacroFacility, 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.



This same registry setting may be toggled on/off through a command accelerator key sequence of "Control Shift Alt ENTER" in the MacroFacility.



Hidden keystrokes Macro Facility (PS80)

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



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)



Hidden keystrokes in the Macro Interpreter

Control Shift Alt Object Action

Control Shift Alt Cancel button in "Prompt" Invoke Macro Debugger



Hidden registry settings

All hidden registry settings (except those stated below) can be accessed in the "Settings" dialog of the MacroFacility. These settings are located in HKEY_CURRENT_USER\Software\Corel\PerfectScript\8\Settings\...

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

"Compiler\Generate Scrubber File" = (DWORD) 1 or 0 (default=0) [not used]

"Compiler\Allow Unknown OLE Objects" = (DWORD) 1 or 0 (default=0)

"Interpreter\Show matherr Messages" = (DWORD) 1 or 0 (default=0) [not used]

"Interpreter\Use New Error Dialog" = (DWORD) 1 or 0 (default=1) [not used]

"Interpreter\VersionInfo-Platform" = (string) "" (default "VERSION.DLL")

"Interpreter\VersionInfo-PerfectFit = (string) "" (default "PFIT80.DLL")

"Interpreter\VersionInfo-PerfectScript = (string) "" (default "PS80.EXE")

"Interpreter\VersionInfo-%s" = (string) "" (default "")



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 elapsed time

Display debug messages

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





OLE Automation



The PerfectScript macro language is now an OLE Automation Controller. This means that PerfectScript macros can be written to control and send commands to any OLE Automation Server program, such as MS Word, Excel, etc. This ability has been designed into the macro language to be as compatible and consistent as possible with the current language sytnax used to reference and send commands to Existing Corel applications that are PerfectScript compatible (such as WordPerfect, Presentations and QuattroPro). A few new statements and commands were added to provide this support, and a number of existing statements and commands were modified iinternally recognize and support OLE objects in a transparent manner. The new statements and commands added were: Object, CreateObject, GetObject and With / EndWith. The existing commands that needed to be modified internally were NewDefault and EndApp. See the external document OLEAUTO.WPD for design and implementation details.



(more needs to be added to this section)





Dialog Editor, and Dialog and Region Statements



The user dialogs are now positioned on the screen so that the task tray is accounted for when calculating the position.



Several existing dialog commands have been modified to add extended functionality. See DialogAddListItem below.



Several new dialog commands have been added to add new functionality. See DialogControlUpdate and DialogControlQuery below.



Users are discouraged from using popup controls on their dialogs, since Corel's products will no longer use such controls. These controls should be replaced with comboboxes. The DialogAddPopupButton statement will not be available in a future release of PerfectScript, nor will the popup button be supported in the Macro Dialog Editor in a future release.



Counter controls on user defined macro dialogs have some unexpected behaviors that need to be explained. In Version 7, if the number display style of a counter control was changed through the use of a DLL call, the value returned in the associated variable was still in the format established when the control was added to the dialog. In Version 8, the value returned will match the format of the control at the time the value is obtained, even if the format of the control has been changed by a DLL call. For example, if a counter was added with the WPU style, and then a DLL call was made to change the style to INCHES, then when the dialog is dismissed, the associated variable would have a WPU measurement value in version 7, but an INCHES measurement value in version 8. At first glance, this may appear to be a problem, but it turns out not to be a problem since the values are tagged as measurement values, not as simple numeric values, and will always be converted to the appropriate values when used in expressions or passed as values to commands. The value still represents the same measurement quantity, but is displayed in different units. We feel that it was much more consistent to return a value that matched as it appeared in the control. The second item could cause a potential confusion, but the version 7 behavior was retained for compatibility. The RegionGetWindowText command will always return a unitless numeric value representing WPUs. For example, even if the counter control was added with the INCHES style, and if the control currently displays "2i", RegionGetWindowText will return 2400. Note that it does not return the measurement value of 2400w, but the plain, unitless integer numeric value of 2400. This appears inconsistent, but was retained for compatibility with prior versions.



Several new Region... commands have been added, many of them dealing with list controls by item index numbers. In these commands, the item index number is a 1 based index number. Indexes of -1 are sometimes used to indicate that all items are to be accessed. Refer to the description of each command for more information.





Command Inserter



When the Advanced / Hidden settings are enabled in PerfectScript (see above), then a two new buttons appear on the command inserter called "Brief Dump" and "Full Dump". Pressing on thes button performs the same function that Control Shift and Control Shift Alt clicking on the Insert button performs (dumps a list of the commands to a text file).





Obsolete Commands and Language Features



In a future release of PerfectScript, there are some commands that will 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.

...



Assign

The full functionality of this command is available through the ":=" operator (and the Indirect command in some cases).



Coach...

Coach... commands may be eliminated in some future release. They are no longer documented but work as they did in version 7.



DialogAddPopupButton

Use comboboxes or DialogAddComboBox instead. This control type will not be available in the dialog editor. None of Corel's products will use popup buttons.



Exists.Pool.Persist! and Exists.Persist!

This enumeration has been renamed to Persistent!.



IfPlatform.PlatformID. and EndIfPlatform.PlatformID. DG!, DOS!, MAC!, NEXT!, OS2!, UNIX!, VAX!

Any values for the PlatformID parameter of these commands that are not the name of the current platform are always ignored by the PerfectScript macro compiler. There enumerations were the names of other platforms, and were only specified for documentation purposes. The only enumerations that will be documented are the enumerations recognized by the current platform. Enumerations for other platforms are specified by the documentation of that platform only.



RegionSetBitmapFilename

This command has been replaced by RegionSetBitmap, which is compatible and also provides additional functionality.



RegionSetCheck.State.Check! and RegionSetCheck.State.Uncheck!

These enumerated values have been replaced with Checked! and Unchecked! respectively. These were renamed to make the enumeration set for the State parameter of the RegionSetCheck command, and the return value enumeration set for the RegionGetCheck () command, be the same set.





Modified and Improved Commands and Language Features



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

...



callbacks

New callback types have been added for version 8.



This section originally appeared in the documentation describing changes for version 7. It also appeared in the printed documentation, but due to printing errors, the printed documentation suffered from formatting errors that made the information nearly useless. That original information has been restated here, with new additions and features that have been added in version 8.



When a macro executes a callback routine, global return and parameter array variables are automatically created by the macro system that are accessible to the callback routine. The callback routine can access the callback parameter array for information about the callback event, and will place its return value (if any) in the callback return variable. The parameters for the callback are placed into a global array variable that has the same name as the callback label. The return value (if any) returned from callback routines is placed in a (non-array) global variable that also has the same name as the callback label. For example, parameters would be passed to the callback routine 'MsgHandler' in an array called 'MsgHandler[ ]', and any return value would be placed into a variable called 'MsgHandler'.



The return value, the number of callback array entries, and the values contained in the callback array depend on the type of callback being called. The callback type is found in the first ([1]) entry of the callback array. The callback array element count can be retrieved by using the Dimensions command, or by accessing the [0] callback array element.



(no changes to this section)

Callback array entries:

RTN Callback return value (depends on [1])

[0] Count of elements in callback array

[1] Callback type:

0 = CBTYPE_MOUSE - Mouse callback (CoachFilterAdd command)

1 = CBTYPE_KEY - Key and Keystring callback (CoachFilterAdd command)

2 = CBTYPE_TOKEN - Product command callback (CoachFilterAdd command)

3 = CBTYPE_DIALOG - Dialog callback (DialogShow and CoachSetDialogFilter commands)

4 = CBTYPE_CBTMSGBOX - MessageBox callback (CoachMessageBox command)

[2]... ..., etc (depends on [1])



(no changes to this section)

Entries for Mouse callback (type 0 - CBTYPE_MOUSE)

This type of callback is no longer supported.

RTN Callback return value:

undefined = Discard the event

0 = Pass the event to the application

1 = Discard the event

[0] Callback array contains 7 elements

[1] Callback type 0 = CBTYPE_MOUSE

[2] Result of comparison between user's action and defined action:

-1 = Error - The array is not complete.

0 = Match - The user's actions exactly match the defined actions.

1 = No match - The user's actions do not match the defined actions.

2 = (not used)

3 = Regression - The event undoes previous events. A regression is not a match

4 = Quit filter - The callback is not called.

[3] Window handle of the window where the event occurred

[4] X position of the mouse

[5] Y position of the mouse

[6] Windows flags for the message (depends on [7])

[7] Windows event message id:

513 = WM_LBUTTONDOWN, 514 = WM_LBUTTONUP, 515 = WM_LBUTTONDBLCLK

516 = WM_RBUTTONDOWN, 517 = WM_RBUTTONUP, 518 = WM_RBUTTONDBLCLK

519 = WM_MBUTTONDOWN, 520 = WM_MBUTTONUP, 521 = WM_MBUTTONDBLCLK

161 = WM_NCLBUTTONDOWN, 162 = WM_NCLBUTTONUP, 163 = WM_NCLBUTTONDBLCLK

164 = WM_NCRBUTTONDOWN, 165 = WM_NCRBUTTONUP, 166 = WM_NCRBUTTONDBLCLK

167 = WM_NCMBUTTONDOWN, 168 = WM_NCMBUTTONUP, 169= WM_NCMBUTTONDBLCLK



(no changes to this section)

Entries for Key and Keystring callback (type 1 - CBTYPE_KEY)

This type of callback is no longer supported.

RTN Callback return value:

undefined = Discard the event

0 = Pass the event to the application

1 = Discard the event

[0] Callback array contains 5 elements

[1] Callback type 1 = CBTYPE_KEY

[2] Result of comparison between user's action and defined action:

-1 = Error - The array is not complete.

0 = Match - The user's actions exactly match the defined actions.

1 = No match - The user's actions do not match the defined actions.

2 = Partial match - The user's actions partially match the defined actions.

3 = Regression - The event undoes previous events. A regression is not a match

4 = Quit filter - The callback is not called.

[3] Key code

[4] Windows flags for the message (depends on [5])

[5] Windows event message id:

256 = WM_KEYDOWN, 257 = WM_KEYUP

260 = WM_SYSKEYDOWN, 261 = WM_SYSKEYUP



(no changes to this section)

Entries for Product command callback (type 2 - CBTYPE_TOKEN)

This type of callback is setup by the CoachFilterAdd command.

RTN Callback return value:

undefined = Pass the event to the application

0 = Pass the event to the application

1 = Discard the event

[0] 7 + [6] = Callback array contains 7 elements plus 1 for each command parameter (count in [6])

[1] 2 = Callback type CBTYPE_TOKEN

-1= Error - The callback array is not complete.

0 = Match - The user's actions exactly match the defined actions.

1 = No match - The user's actions do not match the defined actions.

2 = Partial match - The user's actions partially match the defined actions.

3 = Regression - The event undoes previous events, such as a Backspace. A regression is not match. Received only if LabelType is Any! or NonMatch!.

4 = Quit filter - The callback is not called.

[3] Name of application that sent this command

[4] Macro id of the macro that sent this command (if sent by a macro)

[5] Product command id

[6] Number of parameters for this command

[7] Command flags:

0100x = MAC_REQUIRED - This parameter was required.

0400x = MAC_REPEATING - This parameter belongs to a repeating parameter group.

8000x = MAC_NONODATA - This parameter is missing.

[8] Value of first parameter

[9] Value of second parameter

[10]... Value of ..., etc



(this section has changed)

Entries for Dialog callbacks (type 3 - CBTYPE_DIALOG)

This type of callback is setup by the DialogShow and CoachSetDialogFilter commands.

RTN Callback return value (only if [5] = WM_COMMAND (273) from CoachSetDialogFilter, else not used):

undefined = Send the event to the application

0 = Send the event to the application

1 = Don't send the event to the application

[0] 11 = Callback array contains 11 elements

[1] 3 = Callback type CBTYPE_DIALOG

[2] Dialog name

[3] Control name = If [5] = WM_COMMAND (273), WM_HSCROLL (276), WM_VSCROLL (277), WPMSG_SET_NSLB_POPUP (4104), or TCN_SELCHANGING (-552)

"" = Other messages have no control name

[4] Dialog window handle

[5] Windows message id being sent (see below)

[6] Value of the 32-bit DWORD wParam parameter that was received with the message

[7] Value of the 32-bit DWORD lParam parameter that was received with the message

[8] Value of the HIWORD of the lParam parameter [7] that was received with the message

[9] Value of the LOWORD of the lParam parameter [7] that was received with the message

[10] Value of the HIWORD of the wParam parameter [6] that was received with the message

[11] Value of the LOWORD of the wParam parameter [6] that was received with the message

Elements [6] to [11] have different meanings for each Windows message (contained in [5]). See Windows 95 documentation for more information.

When [5] is:

272 = WM_INITDIALOG

Sent just before the dialog is first displayed. This messge is sent BEFORE the values of the controls are set from their associated variables. If the values of any controls are changed when responding to this message, the values will be changed again by the macro system to reflect the contents of the variables associated with the controls.

This message is for notification only, and cannot be altered or prevented.

RTN Callback return value not used

[0..2],[4..5],[8..11] are as described above

[3] "" - No control name

[6] Window handle of the control that will receive focus

[7] 0 = Sent from WM_INITDIALOG of dialog callback proc

1 = Sent from DialogLoad if dialog didn't exist

2 = Sent from DialogLoad if dialog already existed

1272 = MX_POST_INITDIALOG (only sent from DialogShow, not sent from CoachSetDialogFilter)

This is a new message.

Sent when the dialog is first displayed. This messge is sent AFTER the values of the controls are set from their associated variables. If the values of any controls need to be changed when the dialog is displayed to something other than the initial values from the associated variables, then they should be set in response to this message.

This message is for notification only, and cannot be altered or prevented.

RTN Callback return value not used

[0..2],[4..5],[7..11] are as described above

[3] "" - No control name

[6] Window handle of the control that will receive focus

2 = WM_DESTROY

Sent when the dialog goes down.

This message is for notification only, and cannot be altered or prevented.

RTN Callback return value not used

[0..2],[4..11] are as described above

[3] "" - No control name

6 = WM_ACTIVATE

Sent when the dialog is activated or deactivated.

This message is for notification only, and cannot be altered or prevented.

RTN Callback return value not used

[0..2],[4..6],[8..9] are as described above

[3] "" - No control name

[7] Window handle of the window being activated or deactivated

[10] Minimized flag (non-zero means minimized)

[11] Dialog activation state:

0 = WA_INACTIVE - dialog becomes inactive

1 = WA_ACTIVE - dialog becomes active

2 = WA_CLICKACTIVE - dialog becomes active from mouse click

3 = WM_MOVE (now sent from DialogShow as well as from CoachSetDialogFilter)

Sent when the dialog is moved to a new location.

This message is for notification only, and cannot be altered or prevented.

RTN Callback return value not used

[0..2],[4..7],[10..11] are as described above

[3] "" - No control name

[8] New X position

[9] New Y position

5 = WM_SIZE (only sent from DialogShow, not sent from CoachSetDialogFilter)

This is a new message.

Sent when the dialog is sized.

This message is for notification only, and cannot be altered or prevented.

RTN Callback return value not used

[0..2],[4..5],[7],[10..11] are as described above

[3] "" - No control name

[6] Size type:

0 = SIZE_RESTORED - Dialog has been restored, but not minimized of maximized

1 = SIZE_MINIMIZED - Dialog has been minimized

2 = SIZE_MAXIMIZED - Dialog has been maximized

3 = SIZE_MAXSHOW - Some other window has been restored

4 = SIZE_MAXHIDE - Some other window is maximized

[8] New x size (width) of client area

[9] New Y size (height) of client area

22 = WM_ENDSESSION (only sent from DialogShow, not sent from CoachSetDialogFilter)

This is a new message.

Sent when the Windows session is about to be terminated.

This message is for notification only, and cannot be altered or prevented.

RTN Callback return value not used

[0..2],[4..5],[8..11] are as described above

[3] "" - No control name

[6] True = The session is being ended

False = Otherwise

[7] True = The user is logging off

False = The user is shutting down

-552 = TCN_SELCHANGING

Sent when a different tab on a tab control is selected.

This message can be altered by the callback by returning a value in the callback return variable.

RTN Callback return value (used only from CoachSetDialogFilter command):

undefined = Send the event to the application

0 = Send the event to the application

1 = Don't send the event to the application

[0..2],[4..7],[10] are as described above

[3] Control name of tab control

[8] Zero based tab index number (the first tab is 0) of old tab

[9] Zero based tab index number (the first tab is 0) of new tab

[11] Tab control id

4104 = WPMSG_SET_NSLB_POPUP

Sent when a name search text box pops up on a name search list box.

RTN Callback return value not used

[0..2],[4..7] are as described above

[3] Control name of name search listbox

[8] Coordinate of bottom edge of text box

[9] Coordinate of right edge of text box

[10] Coordinate of top edge of text box

[11] Coordinate of left edge of text box

276 = WM_HSCROLL (only sent from DialogShow, not sent from CoachSetDialogFilter),

277 = WM_VSCROLL (only sent from DialogShow, not sent from CoachSetDialogFilter)

Sent when the user clicks on a scroll bar control.

This message is for notification only, and cannot be altered or prevented.

RTN Callback return value not used

[0..2],[4..6],[8..9] are as described above

[3] Control name of the ScrollBar control

[7] Window handle of the ScrollBar control

[10] Position of thumb in ScrollBar control (if [11] = SB_THUMBPOSITION (4) or SB_THUMBTRACK (5), else not used)

[11] Scroll notification code:

6 = SB_TOP - HOME key pressed - scroll to the top or left

7 = SB_BOTTOM - END key pressed - scroll to the bottom or right

8 = SB_ENDSCROLL - Scroll bar activity ended

0 = SB_LINEDOWN - Down or Right arrow clicked - scroll ahead 1 line

1 = SB_LINEUP - Up or Left arraw clicked - scroll back 1 line

2 = SB_PAGEDOWN - Area between Down or Right arrow and thumb clicked - scroll ahead 1 page

3 = SB_PAGEUP - Area between Up or Left arrow and thumb clicked - scroll back 1 page

4 = SB_THUMBPOSITION - Position of thumb after it is dragged is in [10]

5 = SB_THUMBTRACK - Current position of thumb as it is dragged is in [10]

274 = WM_SYSCOMMAND (only sent from DialogShow, not sent from CoachSetDialogFilter)

Sent when the user presses Alt+F4, chooses Close from the system menu, or double clicks the system menu.

This message is for notification only, and cannot be altered or prevented.

RTN Callback return value not used

[0..2],[4..10] are as described above

[3] "" - No control name

[11] Menu item id of system menu item selected:

61536 = SC_CLOSE - Close, Alt+F4 or double click on system menu

273 = WM_COMMAND

Sent when the user interacts with a control or menu item on the dialog.

These messages can be altered by the callback if sent from the CoachSetDialogFilter command, by returning a value in the callback return variable.

RTN Callback return value (used only from CoachSetDialogFilter command):

undefined = Send the event to the application

0 = Send the event to the application

1 = Don't send the event to the application

[0..2],[4..6],[8..9] are as described above

[3] Control name or:

"OKBttn" = from the predefined OK button

"CancelBttn" = from the predefined Cancel button

[7] Control window handle ("" if from a menu item)

[10] Notification code (depends on the control type):

Popup Button Menu items:

SelectChangeCallbacks! style:

0 = (not used)

FocusCallbacks! style:

(none)

EditChangeCallbacks! style:

(none)

Windows ListBox:

SelectChangeCallbacks! style:

1 = LBN_SELCHANGE - Item selection changed (not sent from CoachSetDialogFilter)

2 = LBN_DBLCLK - Item was double clicked

FocusCallbacks! style:

5 = LBN_KILLFOCUS - The control lost focus.

4 = LBN_SETFOCUS - The control gained focus.

EditChangeCallbacks! style:

(none)

WP ListBox:

SelectChangeCallbacks! style:

1 = WLBN_SELCHANGE - Item selection changed (not sent from CoachSetDialogFilter)

2 = WLBN_DBLCLK - Item was double clicked

10 = WLBN_RBUTTONDOWN - The right mouse button was clicked in the list box (not sent from CoachSetDialogFilter)

11 = WLBN_VK_DELETE - The delete key was pressed in the list box (not sent from CoachSetDialogFilter)

12 = WLBN_VK_INSERT - The insert key was pressed in the list box (not sent from CoachSetDialogFilter)

13 = WLBN_CHECKCHANGE - The check box next to an item was clicked in a list box with the CheckBoxes! style (not sent from CoachSetDialogFilter)

FocusCallbacks! style:

5 = WLBN_KILLFOCUS - The control lost focus.

4 = WLBN_SETFOCUS - The control gained focus.

EditChangeCallbacks! style:

(none)

Windows ComboBox:

SelectChangeCallbacks! style:

1 = CBN_SELCHANGE -Item selection changed (not sent from CoachSetDialogFilter)

2 = CBN_DBLCLK - Item was double clicked

FocusCallbacks! style:

4 = CBN_KILLFOCUS - The control lost focus.

3 = CBN_SETFOCUS - The control gained focus.

7 = CBN_DROPDOWN - The dropdown list was dropped down.

8 = CBN_CLOSEUP - The dropdown list was closed up.

EditChangeCallbacks! style:

5 = CBN_EDITCHANGE -The contents of the edit field have changed.

WP ComboBox:

SelectChangeCallbacks! style:

1 = WCBN_SELCHANGE -Item selection changed (not sent from CoachSetDialogFilter)

2 = WCBN_DBLCLK - Item was double clicked

FocusCallbacks! styletyle:

4 = WCBN_KILLFOCUS - The control lost focus.

3 = WCBN_SETFOCUS - The control gained focus.

7 = WCBN_DROPDOWN - The dropdown list was dropped down.

8 = WCBN_CLOSEUP - The dropdown list was closed up.

EditChangeCallbacks! style:

5 = WCBN_EDITCHANGE -The contents of the edit field have changed.

Color control:

SelectChangeCallbacks! style:

5123 = HLSN_NEWVALUEDONE - A new color was selected (not sent from CoachSetDialogFilter)

FocusCallbacks! style:

(none)

EditChangeCallbacks! style:

5122 = HLSN_NEWVALUE -The contents of the control have changed.

Counter control:

SelectChangeCallbacks! style:

907 = CNTN_STEPUP - Up arrow was clicked, stepping up to next value (not sent from CoachSetDialogFilter)

908 = CNTN_STEPDOWN - Down arrow was clicked, stepping down to previous value (not sent from CoachSetDialogFilter)

FocusCallbacks! style:

901 = CNTN_KILLFOCUS - The control lost focus.

900 = CNTN_SETFOCUS - The control gained focus.

EditChangeCallbacks! style:

902 = CNTN_CHANGE -The contents of the edit field have changed.

Push Button:

SelectChangeCallbacks! style:

0 = BN_CLICKED - Button was clicked

5 = BN_DBLCLK - Button was double clicked (not sent from DialogShow)

FocusCallbacks! style:

7 = BN_KILLFOCUS - The control lost focus.

6 = BN_SETFOCUS - The control gained focus.

EditChangeCallbacks! style:

(none)

Radio Button:

SelectChangeCallbacks! style:

0 = BN_CLICKED - Button was clicked

5 = BN_DBLCLK - Button was double clicked (not sent from DialogShow)

FocusCallbacks! style:

7 = BN_KILLFOCUS - The control lost focus.

6 = BN_SETFOCUS - The control gained focus.

EditChangeCallbacks! style:

(none)

Checkbox:

SelectChangeCallbacks! style:

0 = BN_CLICKED - Button was clicked

5 = BN_DBLCLK - Button was double clicked (not sent from DialogShow)

FocusCallbacks! style:

7 = BN_KILLFOCUS - The control lost focus.

6 = BN_SETFOCUS - The control gained focus.

EditChangeCallbacks! style:

(none)

Edit Box:

SelectChangeCallbacks! style:

(none)

FocusCallbacks! style:

512 = EN_KILLFOCUS - The control lost focus.

256 = EN_SETFOCUS - The control gained focus.

EditChangeCallbacks! style:

768 = EN_CHANGE -The contents of the control have changed.

FileNameEntry:

SelectChangeCallbacks! style:

0 = FNEN_DLGDISMISS - File dialog was dismissed (not sent from CoachSetDialogFilter)

1 = FNEN_DLGRAISE - File dialog was displayed (not sent from CoachSetDialogFilter)

2 = FNEN_PFMK_DLGRAISE - File dialog was displayed (not sent from CoachSetDialogFilter)

3 = FNEN_DLGDISMISS_OK - File dialog was dismissed by OK button (not sent from CoachSetDialogFilter)

4 = FNEN_DLGDISMISS_CANCEL - File dialog was dismissed by Cancel button (not sent from CoachSetDialogFilter)

FocusCallbacks! style:

512 = EN_KILLFOCUS - The control lost focus.

256 = EN_SETFOCUS - The control gained focus.

EditChangeCallbacks! style:

768 = EN_CHANGE -The contents of the edit field have changed.

Date control:

SelectChangeCallbacks! style:

0 = DATEN_DLGRAISE - Date dialog was displayed (not sent from CoachSetDialogFilter)

1 = DATEN_DLGDISMISS - Date dialog was dismissed (not sent from CoachSetDialogFilter)

2 = DATEN_DLGDISMISS_OK - Date dialog was dismissed by OK button (not sent from CoachSetDialogFilter)

3 = DATEN_DLGDISMISS_CANCEL - Date dialog was dismissed by Cancel button (not sent from CoachSetDialogFilter)

FocusCallbacks! style:

512 = EN_KILLFOCUS - The control lost focus.

256 = EN_SETFOCUS - The control gained focus.

EditChangeCallbacks! style:

768 = EN_CHANGE -The contents of the control have changed.

Bitmap:

SelectChangeCallbacks! style:

(none)

FocusCallbacks! style:

(none)

EditChangeCallbacks! style:

(none)

HotSpot:

SelectChangeCallbacks! style:

0 = BMPN_CLICKED - Bitmap was clicked

1 = BMPN_DOUBLECLICKED - Bitmap was double clicked

FocusCallbacks! style:

(none)

EditChangeCallbacks! style:

(none)

Popup Menu Button:

SelectChangeCallbacks! style:

500 = WPN_MENUCLOSE - Popup menu was closed (not sent from CoachSetDialogFilter)

FocusCallbacks! style:

(none)

EditChangeCallbacks! style:

(none)

others:

(none)

[11] Control id or menu item id (depends on the control type):

Menu item:

Menu item id - Dividing this by 100 gives the position of the item in the menu

Controls:

Control id or:

1 = from the predefined OK button

2 = from the predefined Cancel button



(no changes to this section)

Entries for MessageBox callback (type 4 - CBTYPE_CBTMSGBOX)

This type of callback is setup by the CoachMessageBoxEx command.

Callbacks called only if Modality parameter is not Simple!.

RTN Callback return value not used

[0] 4 = Callback array contains 4 elements

[1] 4 = Callback type CBTYPE_CBTMSGBOX

[2] Name of the message box

[3] Name of the control

[4] Control state:

0 = Checked, pressed or clicked

1 = Unchecked, not pressed, or not clicked



App... (Window:numeric or string; ...)

The App... commands accept either a window title or a window handle for the Window or WindowTitle parameters.

Window This specifies the name of the window title (caption), or a window handle.



numeric := AppActivate (Window:numeric or string; [State:enumeration])

This command now returns a value. A new State parameter has been added. The Window parameter may be either the window title or a window handle.

return-value The window handle of the window that was activated is returned.

Window This specifies the name of the window title (caption), or a window handle.

[State] The state to set the window to. If missing, no new state is used, and the window is restored if minimized. These enumerations are the same as the enumerations for the State parameter of the AppShow command.



boolean := AppClose (Window:numeric or string)

The command now retuns a value. The Window parameter may be either the window title or a window handle.

return-value True if successful, False otherwise.

Window This specifies the name of the window title (caption), or a window handle.



numeric := AppExecute (CommandLine:string; [State:enumeration])

This command is now the same as the AppExecuteExt command, with the same parameters, and the same return value. See AppExecuteExt for more information.



numeric := AppExecuteExt (...; [State:enumeration])

The State parameter is now optional.

[State] Is missing, CurrentState! is used. These enumerations are the same as the enumerations for the State parameter of the AppShow command.



... := AppLocate (WindowTitle:numeric or string; [State:enumeration])

The Window parameter may be either the window title or a window handle.

WindowTitle This specifies the name of the window title (caption), or a window handle.



numeric := AppShow (Window:numeric or string; [State:enumeration])

The State parameter is now optional. This command now returns a value. The Window parameter may be either the window title or a window handle.

return-value The window handle of the window is returned.

Window This specifies the name of the window title (caption), or a window handle.

[State] If missing, CurrentState! is used. These values have not changed since Version 7, but are included for completeness.

Hide!

Normal!

Maximize!

Minimize!

MinimizeNoActivate!

MinimizeActivateTopLevel!

CurrentState!

CurrentStateNoActivate!

RecentStateNoActivate!

Restore!

Default!



Beep ([BeepType:enumeration])

A new BeepType parameter has been added to this command.

[BeepType] The parameter specifies the type of beep to produce. The types of beeps that this command can produce coorespond to the types listed in the Sounds Control Panel of Windows. Only the limited set of sound types in the Sounds Control Panel listed below are supported. If missing, Default! is used.

Default! This is the system default sound ("Default" in Control Panel).

Question! This is the system question sound ("Question" in Control Panel).

Asterisk! This is the system asterisk sound ("Asterisk" in Control Panel).

Exclamation! This is the system exclamation sound ("Exclamation" in Control Panel).

CriticalStop! This is the system stop sound ("CriticalStop" in Control Panel).

Standard! This type of beep uses the built in speaker in the computer.

Information! Same as Asterisk!.

Warning! Same as Exclamation!.

Error! Same as CriticalStop!.

None! This causes no beep.



...:= Cancel ([State:Enumeration])

A new enumeration has been added to the State parameter.

[State] The new state. If missing, NoChange! is used.

NoChange! The state is not changed.



...:= Condition (...; [State:Enumeration])

A new enumeration has been added to the State parameter.

[State] The new state. If missing, NoChange! is used.

NoChange! The state is not changed.



... := ConvertType (...)

A new enumeration of DateTime! has been added to the Type parameter.

Type This specifies the type to convert the value to. A new type has been added.

DateTime! Convert the value to a DateTime value. DateTime types are stored as numeric values by the Date and Time commands. For more information, see the Date and Time commands.

Undefined! No conversion to Undefined is currently defined.

Empty! Currently not implemented.

Object! No conversion to Object is currently defined.



numeric or enumeration := DateAndTime (...)

Illegal dates are now checked for, and an error value is returned.

return-value If there is an error (eg. illegal date), then a new enumeration value of Error! is returned. Compare the return value from this command to DateAndTime.Error! to determine if there was an error.

Error! An error occurred.



... := DateDay (...)

return-value DateAndTime.Error! is returned if there is an error.



numeric or enumeration := DateMonth (...)

return-value If there is an error (eg. illegal date), then a new enumeration value of Error! is returned that is the same value as the Error! enumeration from the DateAndTime command. Compare the return value from this command to either DateMonth.Error! or DateAndTime.Error! to determine if there was an error.

Error! An error occurred.



... := DateMonthName ([Date:numeric]; [Type:enumeration])

return-value If there is an error (eg. illegal date), then "" is returned.



... := DateString (...)

return-value If there is an error (eg. illegal date), then "" is returned.



DateStringParse (...)

Currently not implemented.



numeric or enumeration := DateWeekday (...)

return-value If there is an error (eg. illegal date), then a new enumeration value of Error! is returned that is the same value as the Error! enumeration from the DateAndTime command. Compare the return value from this command to either DateWeekday.Error! or DateAndTime.Error! to determine if there was an error.

Error! An error occurred.



... := DateWeekdayName (...)

return-value If there is an error (eg. illegal date), then "" is returned.



... := DateYear (...)

return-value DateAndTime.Error! is returned if there is an error.



string := DialogAdd... (...)

The DialogAdd... commands have been modified to return the same value as the value that they used to (and still do) place into the MacroDialogResult variable.

return-value If successful, the name of the control that was added is returned. If there was an error adding the control, then an empty string ("") is returned. This same value is placed into MacroDialogResult.



string := DialogAddComboBox (...; [Style:enumeration]; ...)

A new enumeration has been added for the Style parameter. This command also now returns a value.

return-value See the return-value described in DialogAdd... above.

[Style] Unsorted! This new enumeration specifies that the items should not be sorted in the list portion of the combo box.



string := DialogAddControl (...; [Style:numeric]; ...)

The Style parameter is now optional. This command also now returns a value.

return-value See the return-value described in DialogAdd... above.

[Style] If missing, no style bits are specified for this control.



string := DialogAddDate (...; [Style:enumeration]; ...)

A new enumeration has been added for the Style parameter. This command also now returns a value.

return-value See the return-value described in DialogAdd... above.

[Style] NoValidate! This new enumeration specifies that the contents of the edit field in the date control will not be validated, and will accept any string.



numeric := DialogAddListItem (...; {Item:string})

The Item parameter may now be a repeating parameter, so that a list of items can be passed to the command. This command also now returns a value.

return-value The 1 based index where the item was added in the list.

{Item} A repeating group of items may be specified to add multiple items at once.



string := DialogAddScrollBar (...; [Style:enumeration]; ...)

The Style parameter is now optional. This command also now returns a value.

return-value See the return-value described in DialogAdd... above.

[Style] If missing, Top! | VScroll! is used.



string := DialogDefine (...; Style:Enumeration; ...)

This command now returns a value. New enumerations have been added to the Style parameter.

return-value This command returns the same value that it places into the MacroDialogResult. If successful, the name of the dialog is returned, otherwise an empty string ("") is returned.

Style Various new styles have been added. If none of the following styles are specified, then SelectChangeCallbacks! is used.

SelectChangeCallbacks! Call callback procedure on select change notifications.

FocusCallbacks! Call callback procedure on focus change notifications.

EditChangeCallbacks! Call callback procedure on edit change notifications.



DialogDelete (Dialog:string)

Currently not implemented.



string := DialogDismiss (...)

This command now returns a value.

return-value This command places into MacroDialogResult, and returns the same value that DialogShow does for non-callback dialogs.



numeric or string := DialogShow (...)

This command now returns a value.

A bit of clarification on the behavior of this command is in order. If the dialog was preloaded (through a DialogLoad or a Region command), then the Parent parameter of this command is not used since the dialog has already been created and parented. To be sure that the parent of a dialog is proper when the dialog is preloaded because of a Region command, make sure a DialogLoad command is done first, and specify the desired parent in the DialogLoad command.

return-value For the most part, this command returns the same value that it places into MacroDialogResult. If this command is used to display a callback dialog, then this command returns the window handle of the dialog, which is the same value that is placed into MacroDialogResult. 0 is returned if there is an error. If this command is used to display a non-callback dialog, then this command returns the name of the button control that was used to dismiss the dialog. "" is returned if there is an error. This differs slightly from the value placed into MacroDialogResult. If the button was not the OK or Cancel buttons, then the name of the control is placed into MacroDialogResult. A value of "1" is placed into MacroDialogResult if the OK button was used to dismiss the dialog, and a value of "2" for the Cancel button. This command, however, will return the name of the control as "OKBttn" for the OK button, and "CancelBttn" for the Cancel button.



boolean := DialogDisplay (...)

boolean := DialogUndisplay (...)

boolean := DialogDestroy (...)

boolean := DialogSetProperties (...)

These commands now return a value.

return-value These commands return the same value that they place into the MacroDialogResult; True if successful, False otherwise.



numeric := Dimensions (VariableName:variable; [IndexOption:enumeration])

The Dimensions command has been made a macro system command rather than a builtin programming command. This means that named parameter association is now available, as well as automatic data type conversion.

return-value The number of dimensions, elements or index range, depending on the IndexOption parameter.

VariableName The name of the array variable to return dimension information about.

[IndexOption] The type of dimension information to return. If missing, then DimensionCount! is used. The numeric value of the index may also be passed (ie. the numeric value 2 is equivalent to IndexLimit2!).

DimensionCount! Return the total number of dimensions of the specified array.

ElementCount! Return the total number of elements the array was defined with.

IndexLimit1! Return the upper limit of the first index of the specified array.

IndexLimit2! ... 9! Return the upper limit of the nth (2 .. 9) index of the specified array.

IndexLimit10! Return the upper limit of the 10th index of the specified array.

IndexLimit! This is a base value that the index number may be added to in order to specify the desired index.



Discard ({VariableName:variable})

The Discard command has been made a macro system command rather than a builtin programming command. This means that named parameter association is now available, as well as automatic data type conversion.

{VariableName} A repeating parameter group specifying the variables to discard.



DLLCall and DLLCall Prototype

The capabilities of these commands was enhanced for version 7 to provide an easier 16 to 32-bit migration, but those enhancements were never documented. For 32-bit Windows 95/NT, many of the Windows DLLs were rewritten and renamed. Because of 32-bit Windows, the PerfectScript system was no longer capable of properly loading the 16-bit DLLs. In addition, any Windows DLL routine that accepts string parameters, was renamed to add an "A" (for Ansi) or a "W" (for Wide or Unicode) to the end. But all existing macros containing DLLCalls referenced the 16-bit DLLs by the old 16-bit file names., and referenced the old routine names. To ease the migration, the macro interpreter attempts to detect the 16-bit DLLs and load the 32-bit counterparts, and tries to detect the old routine names and call the new routine names. It does this as follows. First, the exact DLL is loaded. If it can't be loaded, then a list of 16-bit dll names is scanned, looking for the name of the DLL that failed to load. If it is found in the list, then the equivalent 32-bit DLL file is loaded instead. Once a DLL is loaded, the exact DLL routine name is looked for. If it is not found, then an "A" (Win95 uses "A") is added to the end, and another search in the same DLL is made. While it provides an easier migration, notice that this could become expensive since it occurs on every DLLCall that is made. If the proper DLL file name and proper DLL routine name is specified, there is no additional overhead, since those are the normal cases that are checked first.



In addition to this attempt to map 16-bit to 32-bit names, if an empty string ("") was specified as the DLL file name, then a small list of 32-bit DLLs is searched for the specified routine (first as is, and then with the "A" postfix). This was done so that if only an occasional DLL call is made, then there may not be any need to worry about what DLL it is in (assuming it is in one of the DLLs in the list).



The 16-bit to 32-bit DLL file mapping, and the list of 32-bit DLLs searched if a "" DLL file name is missing, are specified below. Notice that the names must match exactly (except for case). No attempt is made to split the filepath into its parts and compare just the file name portion. These are specified in search order, top to bottom.

16-bit DLL 32-bit DLL 32-bit search list

user user32.dll user32.dll

user.exe user32.dll kernel32.dll

kernel kernel32.dll gdi32.dll

kernel.exe kernel32.dll shell32.dll

krnl386 kernel32.dll

krnl386.exe kernel32.dll

gdi gdi32.dll

gdi.exe gdi32.dll

shell shell32.dll

shell.dll shell32.dll



In version 8, this same list was preserved, and extended to add the name of the version 6 and 7 shared code DLLs to the mapping list, and to add the name of the version 8 shared code DLL to the 32-bit search list:

old DLL V8 DLL search list

wpc20 pfit80.dll pfit80.dll

wpc20.dll pfit80.dll

shwin70 pfit80.dll

shwin70.dll pfit80.dll



DLLCall (...)

DLLCall Prototype (...; <ModuleFileName>string or variable; ...)

This compile time only command has been modified to allow a variable name (simple variables only, no array elements are allowed) to be specified as the DllLibraryFile parameter as well as the literal character string that it continues to support. When a variable name is specified, then when the DLL routine is called, the contents of the variable specified in the DLLCall Prototype statement is used and is expected to contain the name of the DLL library file to be used. If the specified variable does not exist at the point that the dll routine is called, then an undefined variable error occurs at runtime. This can occur if the DLL file name or instance handle is loaded in a local variable in a user-defined routine or one macro file, and then the DLL routine is called from a differnet file or different user-defined routine where that variable doesn't exist. One way to get around this possibly confusing situation, is to define the variable containing the DLL name of instance handle as a Glocal macro variable. This variable is then visible throughout the execution of the macro.

ModuleFileName This parameter may be either a literal character string, or thename of a variable that should contain the DLL library module name at runtime. In addition, if the variable contains an integer value, then this integer value is assumed to be the instance handle of a DLL that was loaded using the DLLLoad command.



EndApp (<Prefix>variable)

The EndApp statement has been modified to accept the prefix of an OLE object variable as well as a product mnemonic. This is a compile time only statement, and causes the specified object prefix / product mnemonic to be removed from the name list that the macro compiler maintains for these. If the prefix that is removed is the prefix for the current default object / product, then the previous default prefix becomes the new default prefix.



...:= Error ([State:Enumeration])

A new enumeration has been added to the State parameter.

[State] The new state. If missing, NoChange! is used.

NoChange! The state is not changed.



EndIfPlatform ([{<PlatformID>enumeration}])

See IfPlatform below.



enumeration := ErrorNumber

This macro system variable now returns an enumeration rather than a numeric value. The enumerations have the same numeric values as before, but now that they are enumerations, they may be refered to by name. The value of ErrorNumber is cleared before every command and set to a value to indicate if an error condition of some sort occured or not. In prior versions, ErrorNumber was only set if there was a handler enabled for the condition that was about to occur. Even if there was a handler, but that handler was disabled (inhibited with commands like Error (Off!)), then ErrorNumber was not set. Version 8 now sets ErrorNumber even if there is no handler (which will terminate the macro immediately anyway), or there is a handler but the condition is currently disabled. This allows conditions to be diabled,