Chapter 11
Corel® PerfectScript Programming Commands
Corel® PerfectScript Programming Commands
Three new macro commands have been added: MacroCompile, MacroIsCompiled, and MacroPlay. See online Help for information about these commands. Also, the following commands have been changed: DialogAddControl, DialogDelete, FileFind, FileNameDialog, GetFileAttributes, MacroInfo, OLEAutomation, and SetFileAttributes. See online Help for information about these commands.
|
Dimensions |
| Purpose | Return dimension information about an array variable. | |||||||||||||||||||||
| Examples | Appendix A: 8064 | |||||||||||||||||||||
| Return Value | Return the number of dimensions or elements, or the index range (see the IndexOption parameter). | |||||||||||||||||||||
| Syntax |
|
|||||||||||||||||||||
| Parameters |
|
|
Discard |
| Purpose |
Remove Local, Global, or Persist variables from memory, in that order. Discard does not specify a variable table. If a variable by the same name exists in all three tables, call Discard three times.
|
|||
| Examples | Appendix A: 8022 | |||
| Syntax |
|
|||
| Parameters |
|
|
DIV |
| Purpose | Operator. Precedence level 3. See Arithmetic Operators | in Chapter 4: Expressions. |
| Return Value | Return the integer quotient of two numbers. | |
| Syntax | numeric := numeric DIV numeric |
|
DLLCall |
| Purpose | Call a function in a Dynamic Link Library (DLL). | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Note | Do not use this command unless you are familiar with Windows programming. Incorrect DLL calls can damage files and/or reset your computer. Macros using DLLCalls written for Windows 3.x must be rewritten for Windows 95. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Syntax |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Parameters |
|
|
DLLCall Prototype |
| Purpose |
Define the calling format of a DLL routine (see example). DLLCall Prototype must occur before calling a DLL function. The DLL library is loaded and freed each time the DLL function is called. DLLCall Prototype makes a macro easier to read and provides safer DLL calls (routines can be called only as defined). |
|||||||||||||||||||||||||||||||||||
| Note |
Do not use this command unless you are familiar with Windows programming. Incorrect DLL calls can damage files and/or reset your computer. DLLCall is a compile-time only command that allows a variable name (simple variables only, no array elements are allowed), specified as the DllLibraryFile parameter as well as the literal character string that it supports. When a variable name is specified (see ModuleFileName parameter), the contents of the variable specified in the DLLCall Prototype statement is used, which must contain the name of the DLL library file. If the specified variable does not exist when the DLL routine is called, an undefined variable error occurs at runtime. This occurs when the DLL filename or instance handle is loaded in a local variable in a user-defined routine or macro file, and the DLL routine is called from a different file or different user-defined routine in which the variable does not exist. Define the variable containing the DLL name or instance handle as a Global macro variable, which makes it visible throughout the execution of the macro. |
|||||||||||||||||||||||||||||||||||
| Syntax |
|
|||||||||||||||||||||||||||||||||||
| Parameters |
|
|
DLLFree |
| Purpose | Remove a dynamic link library (DLL) from memory. | |||
| Note | Do not use this command unless you are familiar with Windows programming. Incorrect DLL calls can damage files and/or reset your computer. | |||
| Syntax |
|
|||
| Parameters |
|
|
DLLLoad |
| Purpose |
Load a dynamic link library (DLL) into memory. You should respond to error values with code similar to the following (see ModuleInstance parameter):
|
|||
| Note |
Do not use this command unless you are familiar with Windows programming. Incorrect DLL calls can damage files and/or reset your computer. |
|||
| Return Value |
A DLL handle if the DLL successfully loads, or an error value. For example, 31 means a General Failure occurred; 1157 means the DLL was not found. See your Windows documentation for more information. |
|||
| Syntax |
|
|||
| Parameters |
|
|
DoesDialogExist |
| Purpose | Look for a dialog in the current macro, then look through the Use file list for the current macro. See Use. | |||
| Examples | Appendix A: 8099 | |||
| Return Value | True if the dialog is found, False if not. | |||
| Syntax |
|
|||
| Parameters |
|
|
DoesDirectoryExist |
| Purpose | Return True if a directory exists, False if not. | |||
| Examples | Appendix A: 8078 | |||
| Return Value | True/False. | |||
| Syntax |
|
|||
| Parameters |
|
|
DoesFileExist |
| Purpose | Return True if a file exists, False if not. | |||
| Examples | Appendix A: 8078 | |||
| Return Value | True/False. | |||
| Syntax |
|
|||
| Parameters |
|
|
DoesRegionExist |
| Purpose | Return whether a named region exists. | |||
| Examples | Appendix A: 8078 | |||
| Return Value | True if the named region exists, False if not. | |||
| Syntax |
|
|||
| Parameters |
|
|
DWord |
| Purpose | Pass a value as a DWord (DLL call in-line parameter function). DWord or double word is an unsigned long integer. See DLLCall. | ||
| Syntax |
|