Call macro code associated with a Label, Procedure, or Function; it can pass one or more values to a Procedure or Function.
A Return statement in a Label, Procedure, or Function directs macro execution to the statement that follows the call of the Label.
Parameters 1
<Label> label A Label, Procedure, or Function name that begins with a letter and consists of one or more letters or numbers.
Syntax 2
({[<Parameter>any]})
Description 2
Call macro code associated with a Label, Procedure, or Function; it can pass one or more values to a Procedure or Function.
A Return statement in a Label, Procedure, or Function directs macro execution to the statement that follows the Label's caller.
The format for calling Label is:
Call(LabelSub)
...other statements...
Label(LabelSub)
...statement block...
Return
The syntax for calling and passing a value to a Procedure or Function is:
Call <Label> label ({<Parameter> any})
The formats for callng Procedures and Functions are:
Call ProcSub({<Parameter>})
...other statements...
Procedure ProcSub({<Parameter>})
...statementblock...
EndProc
Call FuncSub({<Parameter>})
...other statements...
Function FuncSub({<Parameter>})
...statementblock...
Return(<Value>)
EndFunc
Parameters 2
<Label> label A Label, Procedure, or Function name that begins with a letter and consists of one or more letters or numbers.
Call
Example
Syntax
(<Label> label)
Description
Call macro code associated with a Label, Procedure, or Function; it can pass one or more values to a Procedure or Function.
A Return statement in a Label, Procedure, or Function directs macro execution to the statement that follows the call of the Label.
Parameters
<Label> label A Label, Procedure, or Function name that begins with a letter and consists of one or more letters or numbers.
The format for calling Label is:
Call(LabelSub)
...other statements...
Label(LabelSub)
...statement block...
Return
The syntax for calling and passing a value to a Procedure or Function is:
Call <Label> label ({<Parameter> any})
The formats for calling Procedures and Functions are:
Call ProcSub({<Parameter>})
...other statements...
Procedure ProcSub({<Parameter>})
...statementblock...
EndProc
Call FuncSub({<Parameter>})
...other statements...
Function FuncSub({<Parameter>})
...statementblock...
Return(<Value>)
EndFunc
Call <Label> label
Syntax
({[<Parameter>any]})
Description
Call macro code associated with a Label, Procedure, or Function; it can pass one or more values to a Procedure or Function.
A Return statement in a Label, Procedure, or Function directs macro execution to the statement that follows the Label's caller.
The format for calling Label is:
Call(LabelSub)
...other statements...
Label(LabelSub)
...statement block...
Return
The syntax for calling and passing a value to a Procedure or Function is:
Call <Label> label ({<Parameter> any})
The formats for callng Procedures and Functions are:
Call ProcSub({<Parameter>})
...other statements...
Procedure ProcSub({<Parameter>})
...statementblock...
EndProc
Call FuncSub({<Parameter>})
...other statements...
Function FuncSub({<Parameter>})
...statementblock...
Return(<Value>)
EndFunc
Parameters
<Label> label A Label, Procedure, or Function name that begins with a letter and consists of one or more letters or numbers.
Callback Data Description
When a macro executes a callback routine, global return and parameter array variables that are accessible to the callback routine are automatically created by the macro system. 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 has the same name as the callback label. For example, parameters would be passed to 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.
Entries for Mouse callback (type 0 - CBTYPE_MOUSE)
This type of callback is no longer supported.
Entries for Key and Keystring callback (type 1 - CBTYPE_KEY)
This type of callback is no longer supported.
Entries for Product token (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] Callback array contains 7 elements plus 1 for each token parameter (count in [6])
[1] Callback type 2 = 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 a match. Received only if LabelType is Any! or NonMatch!.
4 = Quit filter - The callback is not called.
[3] Name of application that sent this token
[4] Macro id of the macro that sent this token (if sent by a macro)
[5] Product token id
[6] Number of parameters for this token
[7] Token flags
[8] Value of first parameter
[9] Value of second parameter
[10]... Value of ..., etc
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) and from CoachSetDialogFilter, else not used):
undefined = Send the event to the application
0 = Send the event to the application
1 = Do not send the event to the application
[0] Callback array contains 11 elements
[1] Callback type 3 = CBTYPE_DIALOG
[2] Dialog name
[3] Control name = (if [5] = WM_COMMAND (273), WM_HSCROLL (276), WM_VSCROLL (277), WPMSG_SETNSLB_POPUP (4104), OR TCN_SELCHANGING (-552)
"" = Other messages have no control name
[4] Dialog window handle[5].
[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 message 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 described above.
[3] "" = No control name
[6] Window handle of the control that will receive focus
[7] 0 = Sent from WM_INITDIALOG of the dialog callback procedure.
1 = Sent from DialogLoad if dialog did not exist.
2 = Sent from DialogLoad if dialog already existed.
1272 = MX_POST_INITDIALOG (only sent from DialogShow, not sent from CoachSetDialogFilter)
This message is sent when the dialog is first displayed, 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, 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 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 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 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 (sent from Dialog Show and CoachSetDialogFilter commands)
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 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 message is sent when the dialog is sized.
This message is for notification only, and cannot be altered or prevented.
RTNCallback return value not used
[0..2], [4..5], [7], [10..11] are 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 message is 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.
RTNCallback return value (used only from CoachSetDialogFilter command):
undefined = Send the event to the application
0 = Send the event to the application
1 = Do not 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.
RTNCallback return value not used
[0..2], [4..7] are as described above
[3] Control name of ScrollBar control.
[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 (sent from DialogShow, and not from CoachSetDialogFilter)
277 = WM_VSCROLL (sent from DialogShow, and not 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 name search listbox
[7] Window handle of the ScrollBar control
[10] Position of thumb in ScrollBar control (if [11] = 4 or 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 arrow 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, an not 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] Control name of name search listbox
[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 number, or:
"" if from a menu item
"OKBttn" if from the predefined OK button
"CancelBttn" if 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:
0 = (not used)
Windows ListBox:
1 = LBN_SELCHANGE - Item selection changed (not sent from CoachSetDialogFilter)
2 = LBN_DBLCLK - Item was double clicked
WP ListBox:
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)
Windows ComboBox:
1 = CBN_SELCHANGE -Item selection changed (not sent from CoachSetDialogFilter)
2 = CBN_DBLCLK - Item was double clicked
WP ComboBox:
1 = WCBN_SELCHANGE -Item selection changed (not sent from CoachSetDialogFilter)
2 = WCBN_DBLCLK - Item was double clicked
Color control:
5123 = HLSN_NEWVALUEDONE - A new color was selected (not sent from CoachSetDialogFilter)
Counter control:
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)
Push Button:
0 = BN_CLICKED - Button was clicked
5 = BN_DBLCLK - Button was double clicked (not sent from DialogShow)
Radio Button:
0 = BN_CLICKED - Button was clicked
5 = BN_DBLCLK - Button was double clicked (not sent from DialogShow)
Checkbox:
0 = BN_CLICKED - Button was clicked
5 = BN_DBLCLK - Button was double clicked (not sent from DialogShow)
Edit Box:
(none)
FileNameEntry:
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)
Date control:
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)
Bitmap:
(none)
HotSpot:
0 = BMPN_CLICKED - Bitmap was clicked
1 = BMPN_DOUBLECLICKED - Bitmap was double clicked
Popup Menu Button:
500 = WPN_MENUCLOSE - Popup menu was closed (not sent from CoachSetDialogFilter)
[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
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] Callback array contains 4 elements
[1] Callback type 4 = 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
CallbackResume
Example
Description
Resume macro execution paused by CallbackWait. The macro continues to the next command after CallbackWait.
See the example under CallbackWait.
CallbackWait
Example
Syntax
()
Description
Replace the loop statement after DialogShow, pausing the macro to allow the callback to be executed. Use this command with CallbackResume.
CallbackWait and CallbackResume are easier to use and more efficient than loops.
Determine how a macro responds to a Cancel condition.
Create a Cancel condition by pressing Esc, or with Assert(CancelCondition!).
Return Value
Off! Previous Cancel state was Off!
On! Previous Cancel state was On!
Parameters
State: enumeration (optional) Specify the Cancel state. Cancel state is On! when a macro begins. If missing, the current state is returned without changing it.
Off! Ignore a Cancel condition.
On! Stop a macro unless preceded by OnCancel, which directs macro execution to a specified Label.
A conditional statement that tests for matching expressions. If a match is found, a Label is called.
Case compares <Test> to a set of <Cases> (values). If the first comparison is true (if <Test> and <Case> match), the Label following <Case> is called. If the comparison is false, the next <Case> is evaluated and so forth. If no comparison is true, DefaultLabel is called.
Parameters
Test: any The control expression. Variables are assigned values by commands such as GetString, GetNumber, or Menu.
Case: any An expression (variable, constant, character) with a value that is usually assigned before the macro is compiled. It is possible to assign the value at run-time.
Label: label Label to call if <Case> matches <Test>.
DefaultLabel: label (optional) The Label to execute if no <Case> matches <Test>. If not specified, the statement immediately following Case is executed.
A conditional statement that tests for matching expressions. If a match is found, a Label is called.
Case Call compares <Test> to a set of <Cases> (values). If the first comparison is true (if <Test> and <Case> match), the Label following <Case> is executed. If the comparison is false, the next <Case> is evaluated and so forth. If no comparison is true, <DefaultLabel> is executed.
Case is different from Case Call, in that a Return statement after Label directs macro execution to the statement that follows Case Call.
Parameters
Test: any The control expression. Variables are assigned values by commands such as GetString, GetNumber, or Menu.
Case: any An expression (variable, constant, character) with a value that is usually assigned before the macro is compiled. It is possible to assign the value at run-time.
Label: label Label to call if <Case> matches <Test>.
DefaultLabel: label (optional) The Label to execute if no <Case> matches <Test>. If not specified, the statement immediately following Case Call is executed.
CaseOf
Example
Syntax
({<Selector> any})
Description
Identify the code to execute when a CaseOf <Selector> matches the control expression in a Switch statement. Parentheses around Selector are optional. See Switch.
numeric := Ceiling
Syntax
(Value: numeric)
Description
Get the smallest integer greater than or equal to a specified value (the ceiling of a number).
Example
vInt := Ceiling (15.4)
Result: vInt = 16
Return Value
Integer.
Parameters
Value: numeric Return the ceiling of this value.
Chain
Example
Syntax
(MacroFilename: string; {[Parameter: any]})
Description
Call (start) another macro when the parent macro ends.
Corel PerfectScript automatically compiles uncompiled Chain macros. Macro execution stops if the macro will not compile. A Chain macro does not return to its caller (see Run).
Although Chain can occur anywhere in a macro, the Chain macro does not execute until the current macro ends. If the current macro contains more than one Chain command, only the macro file in the last Chain command is executed when the current macro ends.
You can cancel Chain (so the macro is not executed) with a Quit statement. For example,
Chain(EnvPaths + "Test4.wcm")
...other statements...
Switch(Test)
CaseOF 1: Chain(EnvPaths + "Test1.wcm")
CaseOF 2: Chain(EnvPaths + "Test2.wcm")
CaseOF 3: Chain(EnvPaths + "Test3.wcm")
CaseOF 4: Call(DoSomethingElse)
Default: Quit
EndSwitch
Explanation: If <Test> equals 1, 2, or 3, the corresponding macro plays when the parent macro ends. If <Test> equals 4, the DoSomethingElse subroutine is called and Test4.wcm plays when the parent macro ends. If <Test> does not equal 1, 2, 3, or 4, the macro quits and a Chain statement does not execute.
Parameters
MacroFilename: string The path and filename of a compiled macro.
Parameter: any (optional) Enclose multiple parameters in braces ({ }), separated by a semicolon. For example: Chain ("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.
numeric := CharLen
Example
Syntax
(String: string)
Description
Return the number of characters in a string, including codes.
The string can be a variable, constant, character string, or result of an expression. See StrLen for examples.
Return Value
The number of characters, including codes, in a string.
Parameters
String: string A variable, constant, character string, or result of an expression.
This command computes a checksum for a data value.
Return Value
The checksum is computed on the data value, and returned.
Parameters
Data:
any The data to compute the checksum on. Any type of data may be passed, including strings, numerics, raw binary data, arrays, etc... If an array is passed, the cumulative checksum of the values of all the array elements is computed.
Options:
enumeration The checksum type to compute. Different types of checksums return checksums that are less prone to error than others. If missing, CheckSum32! Is used.
CheckSum16! Compute a 16 bit checksum. This is the 16 bit checksum used internally by the PerfectFit shared code. The checksum in the loword of the return value.
CheckSum32! Compute a 32 bit checksum. This is the 32 bit checksum used interally by the PerfectFit shared code.
CRC_16! Compute a 16 bit checksum based on the CRC 16 polynomial. The checksum in the loword of the return value.
CCITT! Compute a 32 bit checksum based on the CCITT polynomial.
AUTODIN_II! Compute a checksum based on the AUTODIN_II polynomial.
Seed:
numeric A checksum from a previous piece of data that is used as a starting point for the checksum. This allows long streams of data to be computed, by passing the checksum from the previous piece of data into the Seed parameter of a subsequent piece. On the first piece of data, ommit this parameter, or specify as a 0. If missing, an initial seed is used that depends on the value of the Options parameter above.
boolean := CloseFile
Example
Syntax
([FileID: numeric])
Description
Close one file or all files.
Close file(s) when they are no longer needed, or system resources will be lost. All open files are closed automatically when the macro ends. See OpenFile.
Return Value
True if successful, False if not.
Parameters
FileID: numeric (optional) If not specified, all open files are closed.
enumeration := Condition
Syntax
(Condition: enumeration or numeric; [State: enumeration])
Description
Determine how a macro responds to a Cancel, Error, NotFound, or user-defined condition.
Example
If Cancel is On! to start, the following two lines return the following results.
vCnd1 := Condition (CancelCondition!; Off!)
Result := vCnd1 = On! (condition was On!, now is Off!)
vCnd2 := Condition (CancelCondition!; On!)
Result := vCnd2 = Off! (condition was Off!, now is On!)
Return Value
Off! Previous condition state was Off!
On! Previous condition state was On!
Parameters
Condition: enumeration or numeric Specify a condition to change. See OnCondition6297 for a description of how to specify a user-defined condition number.
CancelCondition! See the Cancel command.
ErrorCondition! See the Error command.
ExitCondition! See the ExitHandlerState command.
NotFoundCondition! See the NotFound command.
UserDefinedCondition! See the OnCondition command.
VarErrChkCondition! See the VarErrChk command.
State: enumeration (optional) Set the state of the specified condition. When a macro starts, all conditions are On!. If missing, the current state is returned without changing it.
Off! Ignore the specified condition.
On! Stop a macro unless preceded by OnCondition, which directs macro execution to a specified Label.
Constant
Syntax
({<Name> variable := <Value> any})
Description
Define a constant variable (an identifier whose value cannot change at run-time).
Constants make macros easier to read. For example,
Constant (Start := 0; Stop := 1)
defines two constants. Start is replaced by 0 wherever it occurs in the macro, and Stop by 1.
Constants are compile-time only commands that are constant from the point of declaration to the end of the macro. All constants have a single value (array constants are not accepted), and cannot appear on the left side of subsequent assignment statements (or a compile-time error occurs).
Separate multiple definitions with a semicolon. Parentheses are optional.
Examples
Constant (Inch := 2.54C; Diameter := Inch)
Constant Radius := 10I
Constant (Tel := "222-5555")
Constant Team := "Dana, Steve, Alice, Barry, Jenny, Dave"
numeric := Constants
Syntax
(Constant: enumeration)
Description
Get various mathematical and physical constants.
Return Value
A constant.
Parameters
Constant: enumeration The math constant to return.
e! Napierian base of natural logarithms.
pi! Ratio of the circumference of a circle to its diameter.
EulersConstant! Euler's constant
GoldenRatio! Approximately (1+(square root of 5))/2.
Continue
Example
Execute the code in the next CaseOf statement without evaluating its expression. See Switch.
If Value is a number and Type is a measurement, or if Value is a measurement and Type is a number, a measurement conversion is also applied to the magnitude of the value to convert between the measurement and the type specified by DefaultUnitsType. You can prevent this by specifying None! for DefaultUnitsType.
If both Value and Type are measurements, or if both are numbers, DefaultUnitsType is not used.
Type: enumeration Convert Value to this data type.
Boolean!
String! WP string.
WPString!
AnsiString!
OemString!
Number! Convert Value to a float or an integer. Value is converted to an integer if the result has no fractional part and is in the range of an integer.
Float!
Integer!
Measurement! Convert Value to the measurement type specified by the current default units type (see DefaultUnits).
Centimeters!
Inches!
Millimeters!
Points!
WPUnits!
RawBinary!
DateTime! Convert Value to a DateTime value, stored as a number by the Date and Time commands. See Date and Time commands for more information.
DefaultUnitsType: enumeration (optional) Default units to use when converting between measurements and numbers. If both Value and Type are measurements, or if both are numbers, this parameter is not used. If missing, DefaultUnits! is used.
None! Do no number-to-measurement conversion. This causes no conversion of the magnitude of the numeric value. It changes only the type of the value. See the None! value of the DefaultUnits command.
DefaultUnits! Assume that numbers are in the units specified by the current default units type.
Centimeters! Assume that numbers are in units of centimeters.
Inches! Assume that numbers are in units of inches.
Millimeters! Assume that numbers are in units of millimeters.
Points! Assume that numbers are in units of points.
WPUnits! Assume that numbers are in units of WPUnits.
Instance that identifies an OLE object. After an OLE object variable is assigned an object instance, commands can be called, and values obtained and set for the object variable. When the object and variable are no longer needed, use the Discard command to destroy the object instance.
Parameters
ClassName: string Class name of the OLE object to create, also called the ProgID. This must be the name of a registered OLE automation object. You can located the name of the OLE component in the Windows Registry under the HKEY_CLASSES_ROOT key.