Chapter 11
Corel® PerfectScript® 8 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.
Nest
Purpose
Call (start) a nested macro. This command is included for DOS compatibility. The Windows equivalent is Run.
A nested macro starts immediately when called. When a nested macro ends, the first statement following Nest is executed.
PerfectScript automatically compiles uncompiled Nest macros. Macro execution stops if the macro will not compile.
Example
Appendix A: 8010
Syntax
Nest (MacroFileName: string; {[Parameter: any]})
Parameters
MacroFileName
string The path and name of a compiled macro.
{Parameter}
any (optional) Enclose multiple parameters in braces ({}), separated by a semicolon. For example: Nest ("macro"; {"a"; "b"; "c"}). Parameter values are passed to a special array variable named MacroArgs[ ].
If missing, MacroArgs[ ] is not defined in the new macro.
NetAddConnection
Purpose
Connect to a network resource.
Return Value
zero value that represents an error code if not.
Example
NetAddConnection ("wpc35\dev1:win32sh"; "I:")
Syntax
numeric := NetAddConnection (RemoteName: string; [LocalName: string]; [Provider: string]; [Type: enumeration]; [Password: string]; [UserName: string]; [Options: enumeration])
Parameters
RemoteName
string The name of a network resource (refer to your network provider’s naming conventions).
LocalName
string (optional) The name of a network resource on a local system (not case sensitive). For example, F: or LP
connection to the network resource is made without redirecting a local device.
Provider
string (optional) Specify a network provider to connect to. If missing or "", the operating system parses RemoteName to try to determine the correct provider. Only use this parameter when a network provider must be specified. Otherwise, Windows should determine which provider the network name maps to. If this parameter is present, Windows will only try to connect to the named provider.
Type
enumeration (optional) Default: Disk!
Disk!
Printer!
Password
string (optional) The password to use when making the connection. If not present, the default password associated with UserName is used. If this parameter is missing or "", no password is used.
UserName
string (optional) The username to use when making a connection. If not present, the default UserName is used (user context provides the default user name). Use this parameter when the user wants to connect to a network resource and they have been assigned a user name or account. UserName may be specific to a network provider, and can be used in a security context.
Options
enumeration (optional) Default: DontAutoRestore!
DontAutoRestore!
Do not remember the connection to restore it automatically every time you log in.
AutoRestore!
Remember the connection and restore it automatically every time you log in.
NetCancelConnection
Purpose
Terminate a connection to a network resource.
Return Value
True if successful, False if not.
Example
NetCancelConnection ("I:")
Syntax
boolean := NetCancelConnection (ResourceName: string; [Options: enumeration]; [Force: boolean])
Parameters
ResourceName
string Specifiy a remote network resource or a redirected local device. See NetAddConnection.
Options
enumeration (optional) Default: DontAutoRestore!
DontAutoRestore!
No information about the connection is stored.
AutoRestore!
Windows will not restore the connection in subsequent attempts to log on.
Force
boolean (optional) True disconnects even though there are open files or jobs on the connection. If missing or False, disconnect fails if there are open files or jobs on the connection.
NetConnectionDlg
Purpose
Open a dialog box for connecting to network resources.
Return Value
The status code returned by the dialog.
Syntax
numeric := NetConnectionDlg ([Type: enumeration])
Parameters
Type
enumeration (optional) Default: Disk!
Disk!
NetDisconnectDlg
Purpose
Open a dialog box for disconnecting from network resources.
Return Value
The status code returned by the dialog.
Syntax
numeric := NetDisconnectDlg ([Type: enumeration])
Parameters
Type
enumeration (optional) Default: Disk!
Disk!
Printer!
NetGetConnection
Purpose
Return the name of a network resource associated with a local device.
Return Value
string Empty when an error occurs.
Example
vNetResource := NetGetConnection ("M:")
Syntax
string := NetGetConnection (LocalName: string)
Parameter
LocalName
string The name of a local device.
NetGetUniversalName
Purpose
Get the UNC name of a local file.
Return Value
UNC name of a local file.
Syntax
string := NetGetUniversalName (LocalPath: string)
Parameter
LocalPath
string Local name of the file.
NetGetUser
Purpose
Get a user network ID.
Return Value
User network ID.
Syntax
string := NetGetUser ()
NewDefault
Purpose
Specify a macro’s new default application. NewDefault accepts the prefix of an OLE object, as well as a product mnemonic.
The compiler verifies that each product command is valid for the default application. Invalid product commands produce a syntax error during compilation. This is a compile-time only statement, and makes the specified object prefix or product mnemonic the current default prefix for unknown commands.
Product commands to the default application do not require a product prefix. A product command to a non-default application, without a product prefix, creates a compile-time syntax error.
Example
Appendix A: 8027
Syntax
NewDefault (<ProductPrefix> identifier)
Parameters
<ProductPrefix>
identifier A unique identifier that matches the ProductPrefix parameter of an Application statement.
Next
Purpose
Advance a loop iteration before the end of the loop.
Use Next inside a conditional statement such as If or Switch in a loop to advance a loop iteration when a specified condition is met. Statements after Next are ignored.
Example
Appendix A: 8031
Syntax
Next
NOT
Purpose
Operator. Precedence level 1. Invert the result of a relational expression. See Logical Operators and Logical Expressions in Chapter 4: Expressions.
Return Value
True if the inverted value is true, False if not.
Syntax
boolean := NOT boolean
NotFound
Purpose
Determine how a macro responds to a Not Found condition.
A Not Found condition is generally the result of a failed search. Create a Not Found condition with Assert(NotFoundCondition!).
Example
Appendix A: 8021
Return Value
Off!
Previous condition was Off!
On!
Previous condition was On!
Syntax
enumeration := NotFound ([State: enumeration])
Parameters
State
enumeration (optional) Specify the Not Found state. The default is NotFound(On!). If missing, the current state is returned without changing it.
Off!
Ignore a Not Found condition.
On!
Stop a macro unless preceded by OnNotFound, which directs macro execution to a specified Label.
NthRoot
Purpose
Get the Nth root of a value.
Return Value
Nth root of a value.
Syntax
numeric := NthRoot (Value: numeric; Root: numeric)
Parameters
Value
numeric The value (return the Nth root of).
Root
numeric The root to return.
NToC
Purpose
Convert a number to its character equivalent.
Example
Appendix A: 8028
Return Value
The character equivalent of an ANSI decimal value.
Syntax
string := NToC (Character: numeric)
Parameters
Character
numeric The ANSI decimal value.
NToC
Purpose
Convert a number from a Corel WordPerfect character set to its character equivalent.
Example
Appendix A: 8028
Return Value
The character equivalent of a number in a Corel WordPerfect character set.
Syntax
string := NToC (CharacterOrCharSet: numeric; Character: numeric)
Parameters
CharacterOrCharSet
numeric (optional) The number of a Corel WordPerfect character set. If this parameter is not used, the default is 0 (ASCII set).
Character
numeric The number of a character in a Corel WordPerfect character set.
NumStr
Purpose
Convert a number to a character string of numbers.
Return Value
A character string of numbers.
vText := NumStr(999; 0) // vText = "999"
vText := NumStr(3+7; 0) // vText = "10"
Syntax
string := NumStr (Value: any; [RightDigits: numeric]; [LeftDigits: numeric])
Parameters
Value
numeric A number or expression that results in a number.
RightDigits
numeric (optional) The number of digits to the right of the decimal returned as a character string. The range is 0-16. The default is 6. If the value of this parameter is greater than the number of decimal places, NumStr rounds up the entire expression. The decimal point returned by NumStr is defined by the sDecimal setting in the [intl] section of the Windows WIN.INI file.
LeftDigits
numeric (optional) This parameter is currently ignored. Default: Use as many digits as needed.
Object
Purpose
Defines an OLE object variable prefix.
After a prefix variable is defined, the prefix is used to identify all object method (command) calls and properties (values). Before methods and properties can be accessed, an object instance must be assigned to this variable by the CreateObject or GetObject commands.
Syntax
Object (ObjectVariable: variable; [ObjectType: string]; [Options: enumeration]
Parameters
ObjectVariable
variable Name of the object variable that is used in a macro.
ObjectType
string (optional) OLE object class name for this object. If missing, this is a generic object.
Options
enumeration (optional) Options for defining this object. If missing, no options are used.
ObjectInfo
Purpose
Return information about an OLE object.
Return Value
Specified item. If the variable specified is not an object variable, False is returned.
Syntax
any := ObjectInfo (ObjectVariable: any; [InfoItem: enumeration])
Parameters
ObjectVariable
any Get information about this OLE object.
InfoItem
enumeration (optional) Information item to obtain. If missing, IsObject! is used.
IsObject!
boolean Return whether the specified variable is an OLE object variable.
IsConnected!
boolean Return whether the OLE object is connected to the OLE server.
ClassName!
string Return the class name associated with this OLE object.
OemString
Purpose
Pass a value as an OEM string (DLL call in- line parameter function). See DLLCall.
Syntax
string := OemString (<Value> string)
OnCancel
Purpose
Specify a Label or routine (function or procedure) to execute when a Cancel condition occurs.
A macro with more than one OnCancel executes the last OnCancel before a Cancel condition occurs. A Cancel condition stops a macro unless preceded by OnCancel.
Example
Appendix A: 8002
Return Value
The previous Label set to execute by the OnCancel command. If there is no label, "" is returned.
Syntax
label := OnCancel ([Label: label])
Parameters
Label
label (optional) A Label to execute when a Cancel condition occurs. If a label is not specified, the macro halts when a Cancel condition occurs. For example: OnCancel().
OnCancel Call
Purpose
Specify a Label-Return statement or routine (function or procedure) to execute when a Cancel condition occurs.
Return directs macro execution to the first statement after the Cancel condition.
A macro with more than one OnCancel Call executes the last OnCancel Call before a Cancel condition occurs. A Cancel condition stops a macro unless preceded by OnCancel Call.
Example
Appendix A: 8035
Return Value
The previous Label set to execute by the OnCancel Call command. If there is no label, "" is returned.
Syntax
label := OnCancel Call ([Label: label])
Parameters
Label
label (optional) A Label to call when a Cancel condition occurs.
OnCondition
Purpose
Specify a Label or routine (function or procedure) to execute when a Cancel, Error, NotFound, or user-defined condition occurs.
A macro with more than one OnCondition executes the last Condition command before a Cancel, Error, NotFound, or user-defined condition occurs. One of these conditions stops a macro unless preceded by OnCondition.
Note
A user-defined condition number must be greater than or equal to 100. It is expressed as UserDefinedCondition! + numeric, or as a numeric. For example, UserDefinedCondition! + Assert to cause the user-defined condition.
Return Value
The previous Label set to execute by the OnCondition command. If there is no label, "" is returned.
Syntax
label := OnCondition (Conditon: enumeration or numeric; [Label: label])
Parameters
Condition
enumeration or numeric Associate a condition with label. Use one of the enumerations below, or any numeric value greater than or equal to 100 (user-defined condition). See Note above.
CancelCondition!
ErrorCondition!
ExitCondition!
Equivalent to OnExit(label).
NotFoundCondition!
UserDefinedCondition!
Adds 100 to a user- defined condition value (see Note above). For example, OnCondition (UserDefinedCondtion! + 1; Label101), sends macro execution to a label named Label101 on Assert (101).
Label
label (optional) A Label to execute when the specified condition occurs. If a Label is not specified, the macro halts on the associated condition. For example: label := OnCondition (CancelCondition!).
OnCondition Call
Purpose
Specify a Label-Return statement or routine (function or procedure) to execute when a specified condition occurs. See Condition.
Return directs macro execution to the first statement after the specified condition.
A macro with more than one OnCondition Call executes the last Condition command before a Cancel, Error, NotFound, or user-defined condition occurs. One of these conditions stops a macro unless preceded by OnCondition Call.
Note
A user-defined condition number must be greater than or equal to 100. It is expressed as UserDefinedCondition! + numeric, or as a numeric. For example, UserDefinedCondition! + Assert to cause the user-defined condition.
Return Value
The previous Label set to execute by the OnCancel Call command. If there is no label, "" is returned.
Syntax
label := OnCondition Call (Conditon: enumeration or numeric; [Label: label])
Parameters
Condition
enumeration or numeric Associate a condition with label. Use one of the enumerations below, or any numeric value greater than or equal to 100 (user-defined condition). See Note above.
CancelCondition!
ErrorCondition!
ExitCondition!
Equivalent to OnExit(label).
NotFoundCondition!
UserDefinedCondition!
Adds 100 to a user- defined condition value (see Note above). For example, OnCondition Call (UserDefinedCondtion! + 1; Label101), sends macro execution to a label named Label101 on Assert (101).
Label
label (optional) A Label to execute when the specified condition occurs. If a Label is not specified, the macro halts on the associated condition. For example: label := OnCondition Call (ErrorCondition!).
OnDDEAdvise Call
Purpose
Establish a link with an application and test for changes in the value of the DDERequest ItemName parameter.
Return Value
One of the following enumerations:
Success!
AdvActTimeout!
Busy!
DataAckTimeout!
DllNotInitialized!
DllUsage!
ExeAckTimeout!
InvalidParameter!
LowMemory!
MemoryError!
NotProcessed!
NoConvEstablished!
PokeAckTimeout!
PostMsgFailed!
Reentrancy!
ServerDied!
SysError!
UnAdvAckTimeout!
UnfoundQueueId!
Refer to a Microsoft SDK (DdeGetLastError function) for detailed information on each enumeration.
Syntax
enumeration := OnDDEAdvise Call (ConversationID: numeric; ItemName: string; Label: label)
Parameters
ConversationID
numeric The value of the DDERequest ConversationID parameter.
ItemName
string The value of the DDERequest ItemName parameter.
Label
label The Label to call when the value of ItemName changes.
OnError
Purpose
Specify a Label or routine (function or procedure) to execute when an Error condition occurs.
A macro with more than one OnError statement executes the last OnError before an Error condition occurs. An Error condition stops a macro unless preceded by OnError.
Example
Appendix A: 8002
Return Value
The previous Label set to execute by the OnError command. If there is no label, "" is returned.
Syntax
label := OnError ([Label: label])
Parameters
Label
label (optional) A Label to execute when an Error condition occurs. If a label is not specified, the macro halts when an Error condition occurs. For example: OnError().
OnError Call
Purpose
Specify a Label-Return statement or routine (function or procedure) to execute when an Error condition occurs.
Return directs macro execution to the first statement after the Error condition.
A macro with more than one OnError Call statement executes the last OnError Call before an Error condition occurs. An Error condition stops a macro unless preceded by OnError Call.
Example
Appendix A: 8030
Return Value
The previous Label set to execute by the OnError Call command. If there is no label, "" is returned.
Syntax
label := OnError Call ([Label: label])
Parameters
Label
label (optional) A Label to call when an Error condition occurs.
OnExit
Purpose
Specifies a label or routine (function or procedure) to execute when an Exit condition occurs.
A macro calls this label when it encounters one of the following exit conditions: Quit command, Return command from the main body of a macro, all macro statements have been executed (macro ends), Exitcondition! asserted (see Assert command).
Return Value
Previous exit handler label. If one does not exist, an empty string ("") is returned.
Syntax
label = OnExit ([Label: label])
Parameters
Label
label (optional) Exit handler label. If missing, the exit handler is cleared.
OnNotFound
Purpose
Specify a Label or routine (function or procedure) to execute when a Not Found condition occurs.
A macro with more than one OnNotFound statement executes the last OnNotFound before a Not Found condition occurs. A Not Found condition stops a macro unless preceded by OnNotFound.
Example
Appendix A: 8002
Return Value
The previous Label set to execute by the OnNotFound command. If there is no label, "" is returned.
Syntax
label := OnNotFound ([Label: label])
Parameters
Label
label (optional) A Label to execute when a Not Found condition occurs. If a label is not specified, the macro halts when a Not Found condition occurs. For example: OnNotFound().
OnNotFound Call
Purpose
Specify a Label-Return statement or routine (function or procedure) to call when a Not Found condition occurs.
Return directs macro execution to the first statement after the Not Found condition.
A macro with more than one OnNotFound Call statement calls the last OnNotFound Call before a Not Found condition occurs. A Not Found condition stops a macro unless preceded by OnNotFound Call.
Example
Appendix A: 8031
Return Value
The previous Label set to execute by the OnNotFound Call command. If there is no label, "" is returned.
Syntax
label := OnNotFound Call ([Label: label])
Parameters
Label
label (optional) A Label to call when a Not Found condition occurs.
OpenFile
Purpose
Open a file for reading and writing text data.
Close the file when it is no longer needed, or system resources will be lost. The file is closed automatically when the macro ends. See CloseFile.
Example
Appendix A: 8088
Return Value
The file ID, or a negative number if an error occurs. The following file I/O (input/output) commands require a file ID:
CloseFile
FileIsEOF
FilePosition
FileRead
FileTruncate
FileWrite
Syntax
numeric := OpenFile (Name: string; [AccessMode: enumeration]; [ShareMode: enumeration]; [DataType: enumeration])
Parameters
Name
string Include the full path. If the path is not included, the file is searched for in the following directories: the shared PerfectFit directory, current, Windows system, Windows, DOS PATH, network (mapped).
AccessMode
enumeration (optional) Default: Read!
Read!
ReadWrite!
Write!
Override existing data if the position marker is not at the end of the file (see FilePosition).
WriteNew!
Delete existing data and create a new file.
Append!
Exists!
Open and close the file to test if the file exists.
If file does not exist: Read! and ReadWrite! cause macro to fail; Write!, WriteNew!, and Append! create a new file.
ShareMode
enumeration (optional) Default: None!
None!
Compatibility!
Allow one or more macros to open a file any number of times.
Exclusive!
Deny read and write access to more than one macro.
DenyNone!
Does not deny other macros read and write access.
DenyRead!
Deny other macros read access.
DenyWrite!
Deny other macros write access.
DataType
enumeration (optional) Default: AnsiText!
AnsiText!
OEMText!
WPText!
Read or write WP character strings. It does not create a Corel WordPerfect document.
OR
Purpose
Operator. Precedence level 9. Combine two relationship expressions. See Logical Operators and Logical Expressions in Chapter 4: Expressions.
Return Value
True if at least one expression is true, False if not.
Syntax
boolean := boolean OR boolean
Pause
Purpose
Pause a macro, returning computer control to the user.
To resume macro execution, press Enter, or choose Tools, Macro, Pause. To stop a macro, choose Tools, Macro, Play. When Pause follows a Prompt statement, choose OK to resume macro execution or Cancel to create a Cancel condition.
Example
Appendix A: 8032
Syntax
Pause
Persist
Purpose
Declare PerfectFit variables and arrays, and assign them to the persistent variable table.
Persist variables are available to any PerfectFit application while PerfectFit is running.
Example
Appendix A: 8022
Syntax
Persist ({<VariableName> variable := <Value> any})
Parameters
<VariableName>
variable One or more user-defined variables separated by a semicolon. Variables must begin with a letter and can include any other combination of letters or numbers. Separate multiple variables with a semicolon. Parentheses are optional. For example,
Persist <VariableName>; <VariableName>
Persist (<VariableName>; <VariableName>)
are both valid statements. The next example declares persist arrays with 5 elements and 15 elements:
Persist FirstArray[5]; NextArray[15]
The last example simultaneously declares a variable and assigns a value:
Persist x := 2
or...
Persist x
x := 2
If you create two variables with the same name (for example, Global x and Persist x), the following statement
Persist x := 5
specifies which variable x is assigned the value 5.
<Value>
any (optional) Value assigned to <Variable> at time of declaration. For example, Persist vTest = 20. vTest equals 20 at run time. If missing, the value of <Variable> is undefined.
PersistAll
Purpose
Assign a macro’s variables and arrays to the Persist variable table.
Persist variables are available to any PerfectFit application while PerfectFit is running.
Example
Appendix A: 8033
Return Value
Off!
Previous state was Off!
On!
Previous state was On!
Only variables assigned values after PersistAll or declared Persist are Persist variables. Variables assigned values before PersistAll, and variables declared Local or Global, are not Persist variables. In the following example, only var6 and var7 are Persist variables:
Application(A1; "WordPerfect"; Default; "US")
Local var1; var2
var3 = 0
Global var4
Persist var7
var7 = "Persist Variable"
PersistAll
Local var5
var4 = 2
var6 = "Persist Variable"
Syntax
enumeration := PersistAll (State: enumeration)
Parameters
State
enumeration (optional) If missing, the current state is returned without changing it.
Off!
On!
pi
Purpose
Get ‘pi’ (3.14.... ratio of the circumference of a circle to its diameter).
Return Value
Result of pi.
Syntax
numeric := pi
Procedure
Purpose
Identify a macro subroutine that can receive one or more values from a calling statement (see Calling Statements in Chapter 5: Conditional, Loop, and Calling Statements).
Procedures contain one or more statements that execute when the procedure is called. Unlike Label subroutines, procedures do not execute unless called. A calling statement consists of the procedure’s name, and can have one or more parameters that contain values passed to the procedure. Return, EndProc, or EndProcedure direct macro execution to the statement that follows the procedure’s caller.
Example
Appendix A: 8004
Address Mode
To change the value of a variable passed to a procedure, precede the calling statement parameter and its corresponding procedure parameter with an ampersand (&). In the following example, the value of x is 5 after calling Test:
x := 5
Test(x) // calling statement
Procedure Test(z)
z := z + 5
EndProc
In the next example, the value of x is 10 after calling Test:
x := 5
Test(&x) // calling statement
Procedure Test(&z)
z := z + 5
EndProc
The ampersand before variable x means the variable’s address (location in memory) is passed to the procedure, not the variable’s value. Changes made at the address of x are made to the contents of x.
The general form of a Procedure statement is:
Procedure <Name> (<Parameter>; <Parameter>)
...statement block...
EndProc
The syntax accepts EndProc or EndProcedure.
Syntax
Procedure <Name>label ({[<Parameter>any]})
Parameters
<Name>
label The name of the procedure. It begins with a letter and consists of one or more letters or numbers.
{<Parameter>}
any (optional) Receive a value from a calling statement (see Calling Statements in Chapter 5: Conditional, Loop, and Calling Statements). If an ampersand precedes the calling statement variable, an ampersand must precede the corresponding procedure variable (see Address Mode above). Multiple variables are separated by a semicolon.
Procedure Prototype
Purpose
Verify the syntax of a Procedure statement (see Procedure).
If the syntax of a procedure contained in a Use macro file is incorrect and the procedure is called from the main macro, you get a run-time error but not a compile-time error (see Compiler Errors in Chapter 3: Creating Macros). Use Procedure Prototype at the start of a main macro so that syntax errors will appear as compile-time errors instead of run- time errors.
Example
Appendix A: 8004
Syntax
Procedure Prototype <Name> label ({[<Parameter> any]})
Parameters
<Name>
label The name of the procedure. It begins with a letter and consists of one or more letters or numbers.
<Parameter>
any (optional) Receive a value from a calling statement (see Calling Statements in Chapter 5: Conditional, Loop, and Calling Statements). If an ampersand precedes the calling statement variable, an ampersand must precede the corresponding procedure variable (see Address Mode under Procedure). Multiple variables are separated by a semicolon.
Product
Purpose
Get the product of a list of values.
Return Value
Product of a list of values.
Syntax
numeric := Product ({Value: numeric})
Parameters
Value
numeric The list of values. Separate multiple values with a semicolon.
Prompt
Purpose
Display a message box with OK and Cancel button controls.
Pause following Prompt displays a Prompt message box until the user selects OK or Cancel. OK removes the prompt and resumes macro execution. Cancel removes the prompt and creates a Cancel condition (see OnCancel).
If Prompt is not followed by Pause, the message box is displayed until an EndPrompt occurs or the macro ends. You can display only one message box at a time. Calling a second message box replaces the first.
The general form of a Prompt statement is:
Prompt (Title; Prompt; Style; HorizontalPosition; VerticalPosition)
Pause
A Prompt statement can have another form:
Prompt (Title; Prompt; Style; HorizontalPosition; VerticalPosition)
...other statements...
EndPrompt
Example
Appendix A: 8032
Syntax
Prompt (Title: string; [Prompt: string]; [Style: enumeration]; [HorizontalPosition: numeric]; [VerticalPosition: numeric])
Parameters
Title
string The text displayed in the title bar.
Prompt
string (optional) The text displayed in the prompt box. If missing, the title is displayed as the prompt and "PerfectScript" as the title.
Style
enumeration (optional) The icon to display to the left of Prompt. The default value is no icon. Type | between enumerations to combine styles (not all combinations are possible). The values are:
NoIcon!
QuestionMark!
InformationIcon!
ExclamationPoint!
WarningIcon!
Same as ExclamationPoint!
ErrorIcon!
Same as StopSign!.
Asterisk!
Same as InformationIcon!
StopSign!
ApplicationIcon!
Standard application icon.
WindowsLogo!
NoPause!
Specifies default action (Prompt does not pause).
Pause!
Prompt command pauses until a button is pressed (same as following Prompt
command with a Pause command).
Beep!
NoButtons!
Show the prompt without OK and Cancel buttons. Use the EndPrompt command to remove the prompt (not the Pause command).
Buttons!
Show the default buttons.
Example
Prompt ("No Button Example"; "Please Wait"; StopSign!
| NoButtons! | Beeps!)
...other statements...
EndPrompt()
Explanation: The prompt displays a stop sign icon, no buttons, and beeps. It waits until other statements have executed before disappearing.
HorizontalPosition
numeric (optional) The number of pixels from the left side of the main window to the left side of the message box. If you omit this parameter, the prompt is centered horizontally in the main window.
VerticalPosition
numeric (optional) The number of pixels from the top of the main window to the top of the message box. If you omit this parameter, the prompt is centered vertically in the main window.
Quit
Purpose
End a macro.
Note
Chain does not execute if a macro ends because of Quit.
Example
Appendix A: 8005
Syntax
Quit