Chapter 4

Macros

Corel® Quattro® Pro 8 Product Commands
C - D


{CALC}

{CALC} is equivalent to the Calc key, F9, which recalculates the active notebook, or converts the formula on the input line into its result when editing a cell.


{CAPOFF} and {CAPON}

{CAPOFF} and {CAPON} are equivalent to Caps Lock off and Caps Lock on, respectively.


{ChartExpert}

{ChartExpert} is the command equivalent for Insert | Chart. The macro has no arguments. {ChartExpert} displays the first Chart Expert dialog box.


{CHOOSE}

{CHOOSE} displays a pick list of open windows. Your choice becomes the active window.


{CLEAR}

{CLEAR} is the equivalent of Ctrl+Backspace, which erases any previous entry in a prompt line or on the input line in Edit mode. This command is useful when loading or retrieving files.


{ClearComments}

Syntax (Quattro Pro)

{ClearComments <PageOnly?(0|1)>}

Syntax (PerfectScript)

ClearComments(PageOnly?: 0|1)

Deletes the comment in the active cell. PageOnly? flat refers to Group Mode. If Group mode is off, enter 0; if Group mode is on, and the active sheet belongs to a group, enter 1 to operate on only the active sheet or 0 to act on all sheets in the group. Equivalent to right-clicking on the current cell, and choosing Delete Comment.


{ClearContents}

Syntax (Quattro Pro)

{ClearContents <PageOnly?(0|1)>}

Syntax (PerfectScript)

ClearContents ([PageOnly?: Enumeration {Yes!; No!}])

Parameters

PageOnly?

If Group mode is off, enter 0; if Group mode is on, and the active sheet belongs to a group, enter 1 to operate on only the active sheet or 0 to act on all sheets in the group.

{ClearContents} is the command equivalent for Edit | Clear | Values. It erases the contents of the selected cells but leaves cell property settings intact.


{ClearFormats}

Syntax (Quattro Pro)

{ClearFormats <PageOnly?(0|1)>}

Syntax (PerfectScript)

ClearFormats ([PageOnly?: Enumeration {Yes!; No!}])

Parameters

PageOnly?

If Group mode is off, enter 0; if Group mode is on, and the active sheet belongs to a group, enter 1 to operate on only the active sheet or 0 to act on all sheets in the group.

{ClearFormats} is the command equivalent for Edit | Clear | Formats. It resets the properties of cells but retains the values.


{CLOSE}

{CLOSE} ends access to a file previously opened using {OPEN}. This lets another file be opened (only one can be open at a time). {CLOSE} completes the process of writing information to a file, including an update of the disk directory. This step is crucial to the integrity of any file. If your computer is turned off before a file is closed, that file’s contents may become corrupted or lost.

{CLOSE} fails in the event of a disk error, such as when a disk is removed from the disk drive before the file is closed. In this case, {ONERROR} is useful in intercepting the error. If {CLOSE} succeeds, macro execution continues in the cell below the cell containing the {CLOSE} command, ignoring any other commands in that cell. If {CLOSE} fails, macro execution continues in the same cell as the {CLOSE} command.

Example

The following macro opens a new file in drive A called AFILE, writes the text line Hello, world! to the file, and closes the file.

\F {OPEN “A:\AFILE”,W}

{WRITELN “Hello, world!”}

{CLOSE}


{COLUMNWIDTH}

Syntax (Quattro Pro)

{COLUMNWIDTH Block, FirstPane?, Set/Reset/Auto, Size}

Syntax (PerfectScript)

ColumnWidth (Block: String; FirstPane?: Enumeration {Yes!; No!}; Mode: Enumeration {Set!; Reset!; Auto!}; Size: Numeric)

Parameters

Block

Cells containing columns to resize.

FirstPane?

1 to resize columns in left or top window pane; 0 to resize columns in right or bottom window pane.

Set/Reset/Auto

0 to set the column width; 1 to reset the column width; 2 to automatically size the column(s).

Size

New width (in twips) if Set/... = 0; not needed if Set/... = 1; resetting size; extra characters (optional) if Set/... = 2.

{COLUMNWIDTH} provides three ways to change the width of a column or columns (it is equivalent to the cell property Column Width). The columns to change are specified by Block. FirstPane? is used when the active window is split into panes (using View | Split Windows). To resize the columns in the left or top pane, set FirstPane? to 1; to resize the columns in the right or bottom pane, set FirstPane? to 0.

The argument Set/Resize/Auto specifies how to change the width. To set a column width, use this syntax: {COLUMNWIDTH Block, FirstPane?, 0, NewSize}.

NewSize is the new column width, in twips (a twip is 1/1440th of an inch). The maximum width is 20 inches (28,800 twips).

To reset a column to the default width (set by Default Width in the sheet Object Inspector) use this syntax: {COLUMNWIDTH Block, FirstPane?, 1}.

To automatically size a column based on what is entered in it, use this syntax: {COLUMNWIDTH Block, FirstPane?, 2, ExtraCharacters}

ExtraCharacters is the number of characters to add on to the calculated width. If this argument is omitted, the default is used (1 character).

Examples

{COLUMNWIDTH A:A..B,1,0,1440} sets the width of columns A and B (on sheet A) to one inch (1,440 twips).

{COLUMNWIDTH A:A..B,0,0,2160} sets the width of columns A and B (on sheet A) to one and a half inches (2,160 twips). If the window is split, the columns are resized in the left or top pane.

{COLUMNWIDTH A:C,1,1} resets the width of column C (on sheet A) to the default width.

{COLUMNWIDTH A:C,1,2,3} automatically sizes column C (on sheet A) and adds three characters to the calculated width.


{Comment.Edit}

Syntax (Quattro Pro)

{Comment.Edit <CommentText>}

Syntax (PerfectScript)

Comment_Edit(Value?: CommentText)

Creates/updates a comment in the active cell.  Equivalent to Insert | Comment, or right-clicking on a cell, and choosing Insert Comment (or Edit Comment, if you are editing an existing comment).


{Comment.EditURL}

Syntax (Quattro Pro)

{Comment.EditURL <URLText>}

Syntax (PerfectScript)

Comment_EditURL(Value?: URLText)

Inserts/updates a URL hyperlink.  Equivalent to Insert | Hyperlink.


{ComposeFormula}

{Compose Formula} is the command equivalent of clicking the Formula Composer button on the Notebook toolbar. The macro has no arguments. {ComposeFormula} displays the Formula Composer dialog box.


{Consolidate.Option}

Command equivalent

Equivalent to Tools | Consolidate | Edit...

{Consolidate.Add_Source_Block <Block>}

...| Add

{Consolidate.Destination <Block>}

...| Destination Cells

{Consolidate.Function SummaryFunction}

...| Operation

{Consolidate.Go}

...| Consolidate

{Consolidate.Options OutputWithFormulas?(0|1), LabelsInTopRow?(0|1), LabelsInLeftCol?(0|1)}

...| Options

{Consolidate.Remove Name}

...| Delete

{Consolidate.Remove_Source_Block <Block>}

...| Remove

{Consolidate.Reset}

No equivalent; clears Source Cells and Destination Cells, and resets Options to default values in the Consolidation dialog box.

{Consolidate.Save Name}

...| Save As

{Consolidate.Use Name}

...| Consolidations

{Consolidate.Option} is the command equivalent for Tools | Consolidate | New. It combines data from multiple selections into one using your choice of operators. Block defaults to the current selection if the argument is not supplied.

You can use {Consolidate?} or {Consolidate!} to display the Consolidation dialog box. {Consolidate?} lets the user manipulate the dialog box, whereas {Consolidate!} relies on the macro to manipulate it.

Example

The following macro adds the values in the source cellss B2..B4, C2..C3, and D2..D4, and returns values in the destination cells F2..F4.

{Consolidate.Add_Source_Block A:B2..B4}

{Consolidate.Add_Source_Block A:C2..C3}

{Consolidate.Add_Source_Block A:D2..D4}

{Consolidate.Function SUM}

{Consolidate.Destination A:F2..F4}

{Consolidate.Options 1,0,0}

{Consolidate.Go}

{Consolidate.Save CONSOL1}


{ConsolidateExpert}

{ConsolidateExpert} is the command equivalent for Tools | Consolidate | New. The macro has no arguments. {ConsolidateExpert} displays the first Consolidate Expert dialog box.


{CONTENTS}

Syntax (Quattro Pro)

{CONTENTS Dest, Source, <Width#>, <Format#>}

Syntax (PerfectScript)

Contents (DestCell: String; SourceCell: String; [Width: Numeric]; [Format: Numeric])

Parameters

Dest

Cell you want data written to.

Source

Cell you want data copied from.

Width#

Optional column width (1 to 1023).

Format#

Optional format code.

{CONTENTS} copies the contents of Source into Dest, but unlike {LET} or other copy commands, if Source contains a value entry, it translates the copied value into a label and stores it in Dest. It also lets you specify a different numeric format and column width using the Width# and Format# arguments.

Width# can be any number from 1 to 1023. Corel Quattro Pro will not alter the width of the destination column but will treat the resulting string as if it came from a column with the specified width. For example, if a value is displayed as ***** in the source column because the column is not wide enough, specifying a wider Width# will let the value be copied as it would be displayed within that width, not as *****. Width# is optional, but must be provided if Format# is used. If you do not specify Width#, the width of the source column is assumed. Use the maximum width if you want all values to come across properly. You can use @TRIM with a {LET} command to remove any leading spaces from the label.

Format# can be any number from 0 to 127. Each number in this range corresponds to a specific numeric format and decimal precision. Format# affects the Dest entry only, not the Source value. See Numeric Format Codes below for a list of special codes used to indicate numeric formats with Format#.

Examples

The following examples assume cell C18 contains the value 48,988 in comma format with a column width of 12.

{CONTENTS A18,C18}

Places the 12-character label ‘      48,988 in cell A18 (six spaces are inserted at the beginning).

{CONTENTS E10,C18,3}

Places the 3-character label ‘*** in cell E10. (Only asterisks are copied because the value does not fit within three spaces.)

{CONTENTS A5,C18,15,34}

Places the 15-character label ‘     $48,988.00 in cell A5 (five spaces are inserted at the beginning).

Numeric Format Codes

Code

Description

0-15

Fixed (0-15 decimals)

16-31

Scientific (0-15 decimals)

32-47

Currency (0-15 decimals)

48-63

% (percent; 0-15 decimals)

64-79

, (comma; 0-15 decimals)

112

+/- (bar chart)

113

General

114

Date [1] (DD-MMM-YYYY)

115

Date [2] (DD-MMM)

116

Date [3] (MMM-YYYY)

117

Text

118

Hidden

119

Time [1] (HH:MM:SS AM/PM)

120

Time [2] (HH:MM AM/PM)

121

Date [4] (Long International)

122

Date [5] (Short International)

123

Time [3] (Long International)

124

Time [4] (Short International)

127

Default (set with Normal style)


{Controls.Option}

Command equivalent

Equivalent to...

{Controls.Order}

Format | Value Order | Set New

{Controls.OrderFrom}

Format | Value Order | Reorder From First

{Controls.OrderTab}

Format | Tab Order | Set New

{Controls.OrderTabFrom}

Format | Tab Order | Reorder From First

Syntax (PerfectScript)

Controls_Order ()

Controls_OrderFrom ()

Controls_OrderTab ()

Controls_OrderTabFrom ()

{Controls.Option} is equivalent to Format | Value Order and Format | Tab Order. It affects selected objects in the dialog window.


{CR} or ~

{CR} or ~ (tilde) are equivalent to the Enter key.


{CREATEOBJECT}

Syntax (Quattro Pro)

{CREATEOBJECT ObjectType, x1, y1, x2, y2<, x3, y3, ...>}

Syntax (PerfectScript)

CreateObject (ObjectName: String; x1: Numeric; y1: Numeric; x2: Numeric; y2: Numeric; {[x: Numeric]; [y: Numeric]})

Parameters

ObjectName

Type of object to create.

x1, y1

Xy coordinates for the starting point of the object; the upper left corner for rectangles and objects bounded by rectangles.

x2, y2

Xy coordinates for the end point or next point of the object; the width and height for rectangles and objects bounded by rectangles.

x3, y3

Xy coordinates for the next or last point of a polyline or polygon object.

With {CREATEOBJECT} you can add objects to the active window normally added using the Toolbar. {CREATEOBJECT} is context-sensitive, letting you create lines in a chart window or check boxes in a dialog window. Corel Quattro Pro interprets the coordinates specified after ObjectType differently based on the object type. The following table lists the possible chart object settings for ObjectType, and how each chart object uses the (x,y) coordinates.

Chart Objects {CREATEOBJECT} Can Generate

Object # of (x,y)’s Coordinates

Line 2 1st: Start point, 2nd: End point

Arrow (same as for Line)

Block 2 1st: Upper left corner, 2nd: Width and height of the objects (in relative coordinates)

Rect (Rectangle) 2 (same as for Block)

Ellipse 2 1st: Upper left corner of a rectangle bounding the ellipse; 2nd: Width and height of the bounding rectangle

Rounded_Rect (same as for Block)

Text (same as for Block)

Polyline Varies 1st: Start point, 2nd: End point of first segment and start of second segment; 3rd: End point of second segment and start of third segment, ... nth: End point

Polygon (same as for Polyline)

Freehand_Polyline (same as for Polyline)

Freehand_Polygon (same as for Polyline)

Block Objects

The Block object has additional arguments for {CREATEOBJECT}:

{CREATEOBJECT ObjectType, x1, y1, x2, y2, “Block”, “RowBorders?(Yes|No), ColBorders?(Yes|No), HorzGridLines?(Yes|No), VertGridLines?(Yes|No), AspectRatio?(Yes|No)”}

Block sets the notebook cells to use. The remaining arguments specify whether to show borders and grid lines and whether to maintain the cells’ aspect ratio.

Dialog Controls {CREATEOBJECT} Can Generate

You can create these dialog controls listed in the order they appear on the Dialog Toolbar: Button, CheckBox, RadioButton, BitmapButton, Label, EditField, SpinCtrl, Rectangle, GroupBox, RangeBox, ComboBox, PickList, FileCtrl, ColCtrl, ScrollBar, HScrollBar, TimeCtrl. When creating a control, x1 and y1 specify the upper-left corner of the control; x2 and y2 specify the width and height of the control, in pixels.

ObjectType is enclosed in quotes. The x and y coordinates for each point follow, separated by commas.

Example

{CREATEOBJECT “Rect”,86,11,94,74}

Creates a rectangle with upper-left corner = (86,11), width = 94, and height =74 (pixels).

{CREATEOBJECT “Block”, 363, 260, 1278, 1139, “A:B2..D9", ”No,No,Yes,Yes,Yes"}

Creates notebook cells in a chart window with upper-left corner = (363, 260), width = 1278, and height = 1139; the other arguments specify the notebook cells, turn off row and column borders, show grid lines, and maintain the cells’ aspect ratio.

{CREATEOBJECT “Line”,260,238,356,228}

Creates a line that starts at (260,238) and ends at (356,228).

{CREATEOBJECT “Polyline”,2,2,23,59,11,26}

Creates a polyline that starts at (2,2), draws a line to (23,59), and then draws a line from that point to (11,26).


{CrossTab}

Equivalent to Tools | Data Tools | Cross Tabs.

Syntax (Quattro Pro)

{CrossTab “Input Cells”;"Output cells";"<3D Page Name>";"Row 1,<Row 2>,<Row 3>";"Column 1,<Column 2>,<Column 3>";"Data 1: Data Option,<Data 2: Data Option>";"<Row 1: Option>,<Row 2: Option>,<Row 3: Option>,<Column 1: Option>,<Column 2: Option>,<Column 3: Option>"}

Syntax (PerfectScript)

CrossTab (SrcBlock: String; DstBlock: String; PageName: String; RowData: String; ColData: String; {[DataTotal: String]})

Parameters

Data Option

SUM, AVERAGE, COUNT, % of COLUMN, % of ROW, % of GRAND, or STRING.

Row and Column Options

SUM, AVERAGE, COUNT, % of COLUMN, % of ROW, % of GRAND, INCREASE, % INCREASE, or STRING.

All items surrounded by <> are optional. All quotes in this macro command must be included in order for the macro to function.

All Column, Row and Data items are to be replaced with the field number containing the data to be used. Field numbers start at  0 and go to however many columns are passed into Cross Tabs. Columns are numbered from left to right in the source range, 0 being the first column of the selection.

Example

{CrossTab “A:A1..H145";”B:A1";"";"0,1";"2,3,4";"6: SUM";"4: AVERAGE"}

Notice that if the 3D Sheet Name is not included, the macro must have the empty quotes or it will not function properly.


{CTRL}

Syntax (Quattro Pro)

{CTRL+Key <Number>}

Parameters

Key

Keyboard macro command (PGUP, DOWN, and so on).

Number

Number of times to repeat the operation (optional).

{CTRL} emulates holding down the Ctrl key while pressing a keystroke. For example, {CTRL+PGDN 5} emulates pressing Ctrl+PgDn five times to move down five notebook sheets. Keystrokes that would perform Windows task switching, such as Ctrl+Esc, are ignored.

You can combine {ALT}, {CTRL}, and {SHIFT}. For example, {CTRL+SHIFT+D} is equivalent to pressing Ctrl+Shift+D, the Date keys.


{DatabaseQuery}

Syntax (Quattro Pro)

{DatabaseQuery Type, Name, QueryString, Destination}

Parameters

Type

Type of database to query: “Paradox”, “ODBC”, or “BDE (Borland Database Engine)”.

Name

Name of the database. If the type is Paradox, the name must be a path. If the type is ODBC, the name is a Data Source Name (DSN) from the user’s ODBC configuration. If the name is BDE..., the name is an alias name from the user’s IDAPI/BDE configuration.

QueryString

An SQL Statement.

Destination

The destination block of cells where to send the result.

The {DatabaseQuery} macro sends the specified SQL statement to either ODBC or BDE and places the returned data in the specified block of cells.

{DatabaseQuery} is equivalent to Insert | External Data | Expert.


{DATE}

{DATE} is equivalent to pressing Ctrl+Shift+D, which lets users enter a date or time into the active cell.

Tip

You can enter a date in a cell without using Ctrl+Shift+D. Just type a date in one of Corel Quattro Pro’s date formats—for example, 6/1/95.

Examples

{DATE}8/6/90~ enters 8/6/90 in the active cell as a date.

{DATE}{?}~ pauses to let the user enter a date, then enters that date into the active cell.


{DbAlias}

Syntax (Quattro Pro)

{DbAlias WORK | PRIV, Path}

Syntax (PerfectScript)

DbAlias (type: Enumeration {PRIV!; WORK!}; Path: String)

Parameters

WORK | PRIV

WORK to specify a Working directory; PRIV to specify a Private directory.

Path

Path for the Working directory or the Private directory.

{DbAlias} is the command equivalent for Insert | External Data | Aliases which lets you specify a private directory to hold temporary files, or a working directory where external data tables are most likely to be found.


{DEFINE}

Syntax (Quattro Pro)

{DEFINE Location1<:Type1>, Location2<:Type2>,...}

Parameters

Location

Cell in which you want to store the argument being passed.

Type

String or value; string (or s) stores the value or formula as a label, and value (or v) stores the actual value or value resulting from a formula (optional).

When you pass control to a subroutine with the {Subroutine} command, you can also pass arguments for use by that subroutine. If you do, you must include a {DEFINE} command in the subroutine’s first line. This command defines the data type of *each argument passed and indicates which cells to store the arguments in. If no {DEFINE} command is included, the arguments are ignored.

{DEFINE} sequentially defines the arguments passed to the subroutine. The first location and type given are assigned to the first argument passed, the second location and type to the second argument, and so on.

You must specify a location for each argument. This tells Corel Quattro Pro where to copy them. If there are more locations given than arguments passed, or more arguments than locations, the macro ends immediately, and an error message displays.

Type is optional. It tells Corel Quattro Pro whether the argument is a value or string. If no data type is given, the argument is assumed to be a literal string (even if it is a valid cell name, cell address, or value). If you add :string (or :s) to the location, any argument passed is stored as a label. If you add :value (or :v), Corel Quattro Pro treats the coming argument as a number or value resulting from a numeric formula. It it is not a numeric value, Corel Quattro Pro treats it as a string (or string value from a formula).

Example

In the following example, the \F macro passes three arguments (principal, interest, and term) to the subroutine _calc_loan, which stores the arguments in named cells and defines them as values. It then uses the arguments to calculate the monthly payment on a loan, stores the result in a cell named amount, creates a label in a cell named payment displaying that amount as currency, returns control to the main macro.

The main macro (\F) displays the result in the active cell preceded by the string “The monthly payment will be ”.

\F {_calc_loan 79500,12%,30}

_calc_loan {DEFINE prin:value,int:value,term:value}

{LET amount,@PMT(prin,int/12,term*12)}

{CONTENTS payment,amount,9,34}{EditGoto txt_area}{RETURN}

prin 79500

int 0.12

term 30

amount 817.747

payment $817.75

txt_area +"The monthly payment will be “&@TRIM(payment)


{DEL} and {DELETE}

{DEL} and {DELETE} are equivalent to the Del key.


{DELETEMENU}

Syntax (Quattro Pro)

{DELETEMENU MenuPath}

Syntax (PerfectScript)

DeleteMenu (MenuPath: String)

Parameters

MenuPath

Menu in the tree to delete; type a forward slash (/) followed by the menu name; for example, to delete the Edit menu, type /Edit.

{DELETEMENU} removes the menu specified by MenuPath from the menu system. See the description of {ADDMENU} for the syntax of MenuPath. Use {DELETEMENUITEM} to remove an individual menu command.

Tip

You cannot delete menus between Edit and Tools on the menu bar. The area between these menu positions is reserved for context-sensitive menus that change depending on the active window. You can add menu items to menus between the Edit and Tools menus, but the new menu items will be swapped out of the menu when the context changes.

Changes made to the menu system using this command are not saved; they are lost when you exit Corel Quattro Pro. Each time you run a macro containing {DELETEMENU}, the menu changes appear again.

To restore the original menu bar, use the macro command {SETMENUBAR} without an argument

Example

{DELETEMENU “/File”} removes the File menu from the active menu system.


{DELETEMENUITEM}

Syntax (Quattro Pro)

{DELETEMENUITEM MenuPath}

Syntax (PerfectScript)

DeleteMenuItem (MenuPath: String)

Parameters

MenuPath

Menu item in the tree to delete; enter the sequence of menu commands separated by forward slashes (/); you can use <- and -> to specify an item menu at the top or bottom of a menu, respectively. For example, /File/<- specifies the first item on the File menu. You can also use numbers to identify menu commands. For example, /File/0 specifies the first item on the File menu (the ID numbers start at zero).

{DELETEMENUITEM} removes the menu command specified by MenuPath from the menu system. Use {DELETEMENU} to remove entire menus from the active menu system.

Tip

You can delete menu items from any menu, but if you change a context-sensitive menu (all menus between Edit and Tools on the menu bar), the change only applies to the menu in the active window. For example, suppose you use a macro to change the View menu when the notebook window is active. If you then open a chart window, the chart View menu appears—without the change. If you want the change to apply to that View menu as well, you must run the macro again.

Changes made to the menu system using this command are not saved; they are lost when you exit Corel Quattro Pro. Each time you run a macro containing {DELETEMENUITEM} the menu changes appear again.

To restore the original menu bar, use the macro command {SETMENUBAR} without an argument.

Examples

{DELETEMENUITEM “/Edit/Clear”} removes the Edit | Clear command.

{DELETEMENUITEM “/Edit/<-”} removes the first item on the Edit menu.


{DELVAR}

Syntax (Quattro Pro)

{DELVAR VarName1<,VarName2,...>}

Syntax (PerfectScript)

DelVar ([VarName1: String]; {[VarName: String]})

Parameters

VarName

A named variable.

{DELVAR} deletes unused named variables. Named variables are used to control OLE objects. OLE objects are released from control at the end of macro execution, but named variables remain until you exit Corel Quattro Pro. You can delete the unused named variables to free an object assigned to that name, and then control the object using another macro.

Examples

{DELVAR} deletes all named variables

{DELVAR calc} deletes a named variable calc

{DELVAR calc 0, calc 1, calc 3} deletes the named variables calc 0, calc 1, and calc 3.

For more details on using {DELVAR} and other OLE automation macro commands, see OLE Automation.


{DESCR}

Syntax (Quattro Pro)

{DESCR InBlock, OutBlock, Grouped, <Labels(0|1)>, <Summary(0|1)>, <Largest>, <Smallest>, <Confidence>}

Syntax (PerfectScript)

DESCR (InBlock: String; OutBlock: String; [Grouped: String]; [Labels?: Enumeration {Yes!; No!}]; [Summary?: Enumeration {Yes!; No!}]; [Largest: Numeric]; [Smallest: Numeric]; [Confidence: Numeric])

Parameters

InBlock

One or more numeric cell values representing the input cells.

OutBlock

Upper left cell of the output cells.

Grouped

“C” to group results by column or “R” to group results by row; “C” is the default.

Labels

1 if labels are located in the first column or row of the input cells; 0 if the input cells do not contain labels; the default is 0.

Summary

1 to display summary statistics; 0 to omit summary statistics; the default is 0.

Largest

A value n which, if present, makes {DESCR} report the nth largest data point; if omitted, the largest data point is not reported.

Smallest

A value n which, if present, makes {DESCR} report the nth smallest data point; if omitted, the smallest data point is not reported.

Confidence

Confidence level of the mean; the default is 0.95.

{DESCR} returns a table of descriptive statistics that characterize a sample. {DESCR} is equivalent to the Descriptive Statistics analysis tool.


{DialogView}

Syntax (Quattro Pro)

{DialogView Window}

Syntax (PerfectScript)

DialogView (Window: String)

Parameters

Window

Dialog window to make active.

{DialogView} lets you edit an existing dialog box.


{DialogWindow.Dimension.Option}

Syntax (Quattro Pro)

{DialogWindow.Dimension.Option}

{DialogWindow.Dimension “XPos, YPos, Width, Height”}

{DialogWindow.Dimension.Height Height}

{DialogWindow.Dimension.Width Width}

{DialogWindow.Dimension.X XPos}

{DialogWindow.Dimension.Y YPos}

Syntax (PerfectScript)

DialogWindow_Dimension_Height(Height: numeric)

DialogWindow_Dimension_Width(Width: numeric)

DialogWindow_Dimension_X(XPos: numeric)

DialogWindow_Dimension_Y(YPos: numeric)

{DialogWindow.Dimension.Option} is equivalent to the dialog window property Dimension, which lets you move and resize the active dialog window. Each argument is specified in pixels. XPos and YPos specify the distance in pixels from the left side of the Corel Quattro Pro window and bottom of the input line, respectively.

Example

The following macro command positions the active dialog window two pixels from the left edge of the Corel Quattro Pro window, five pixels below the input line, sets the width to 150 pixels, and sets the height to 250 pixels.

{DialogWindow.Dimension “2,5,150,250"}


{DialogWindow.Disabled}

Syntax (Quattro Pro)

{DialogWindow.Disabled Yes|No}

Syntax (PerfectScript)

DialogWindow_Disabled (Disable?: enumeration {Yes!;No!})

{DialogWindow.Disabled Yes|No} disables (Yes) or enables (No) the active dialog box or Toolbar. This command only works when the user is viewing a dialog box or Toolbar; it does not work when editing one.


{DialogWindow.Grid_Options}

Syntax (Quattro Pro)

{DialogWindow.Grid_Options GridSize, ShowGrid, SnapToGrid}

Syntax (PerfectScript)

DialogWindow_Grid_Options(Settings: string)

{DialogWindow.Grid_Options GridSize, ShowGrid, SnapToGrid} sets the grid size of the active dialog window. Use GridSize to specify the distance between grid points in pixels; ShowGrid specifies whether the grid is visible; SnapToGrid specifies whether objects snap to the grid.

Example

The following macro sets the distance between grid points to 10, shows the grid, and enables it.

{DialogWindow.Grid_Options “10,Yes,Yes”}


{DialogWindow.Name}

Syntax (Quattro Pro)

{DialogWindow.Name Name}

Syntax (PerfectScript)

DialogWindow_Name(Name: string)

{DialogWindow.Name} sets the name of the active dialog window. This name is used by macro commands, @functions, and link commands to identify the dialog box (or Toolbar).


{DialogWindow.Position_Adjust}

Syntax (Quattro Pro)

{DialogWindow.Position_Adjust Depend, LeftRel, TopRel, RightRel, BottomRel, CenterHor, CenterVer}

Syntax (PerfectScript)

DialogWindow_Position_Adjust(Settings: string)

{DialogWindow.Position_Adjust Depend, LeftRel, TopRel, RightRel, BottomRel, CenterHor, CenterVer} specifies how the active dialog box resizes when the Corel Quattro Pro window is resized. The arguments are equal to options in the Position Adjust dialog box.


{DialogWindow.Property}

{DialogWindow.Property} is equivalent to to right-clicking the title bar of a dialog window to set its properties.

{DialogWindow} commands affect the active dialog window. The next table lists the possible settings for Property. To display a property description with syntax, choose that property in the following list:

Dimension Dimension

Disabled Disabled

Grid_Options Grid

Name Name

Position_Adjust Position

Title Title

Value Value


{DialogWindow.Title}

Syntax (Quattro Pro)

{DialogWindow.Title String}

Syntax (PerfectScript)

DialogWindow_Title(Title: string)

{DialogWindow.Title String} specifies the title that appears on the dialog box when the user is viewing it (the title does not appear when editing the dialog box).


{DialogWindow.Value}

Syntax (Quattro Pro)

{DialogWindow.Value String}

{DialogWindow.Value String} sets the initial settings of the dialog box (or Toolbar). You can use it with @COMMAND to find the current settings of the dialog box. String is a comma separated list of settings. Each setting sets the initial value of one control. Control values appear in this list if their Process Value property is set to Yes. You can set the order of the settings while editing the dialog box.

Example

The following macro command sets the initial values of a dialog box with three controls. Each setting maps to one control.

{DialogWindow.Value “25000,5,1st of month”}


{DISPATCH}

Syntax (Quattro Pro)

{DISPATCH Location}

Parameters

Location

A single cell containing the address or cell name of another macro.

{DISPATCH} is similar to {BRANCH}, except it uses Location differently:

{DISPATCH} is useful when you want to branch to one of several alternative macros, depending on circumstances. You can also set up a macro that modifies the contents of Location, depending on user input or test conditions.

Example

The macro _continue in the following example uses {DISPATCH jump_cell} to create a form letter that changes depending on the result of a credit check.

Type the line to the right of \F with no hard returns until after the first {BRANCH _continue}, then press Enter to insert the text into one cell.

credit OK

\F {EditGoto text_area}

{IF credit="OK"}{LET jump_cell,"_ok_note"}{BRANCH _continue}

{LET jump_cell,"_bum_note"}{BRANCH _continue}

_continue {PUTCELL “Because of your current standing with P.K.”}

{DOWN}

{PUTCELL “Finance, we have decided to”}{DOWN}

{DISPATCH +jump_cell}

jump_cell _ok_note

_ok_note {PUTCELL “extend your credit limit.”}{DOWN 2}

{BRANCH _finish}

_bum_note {PUTCELL “CANCEL your account.”}{DOWN 2}

{BRANCH _finish}

_finish {PUTCELL “Please call our office for details.”}

{DOWN 2}

{PUTCELL “Sincerely,”}

{DOWN 3}

{PUTCELL “James Madison (Account Officer)”}

{DOWN}

text_area Because of your current standing with P.K.

Finance, we have decided to

extend your credit limit.

Please call our office for details.

Sincerely,

James Madison (Account Officer)


{DLL}

Syntax (Quattro Pro)

{DLL <DLLName.>FunctionName, Argument1, Argument2,...}

Syntax (PerfectScript)

DLL (DLLName_FunctionName: String; {[Argument: String]})

Parameters

DLLName

The name of a DLL file (if not already loaded).

FunctionName

The name of an @function contained in the DLL.

Argument1,Argument2...

Arguments to the @function.

{DLL} runs a macro or returns a value from an add-in @function contained in a dynamic-link library file. The @function can have up to 16 arguments.

Example

This statement calls the @function AMPLITUDE, included in the DLL Math, with two selections as arguments:

{DLL Math.AMPLITUDE,A1..A10,B1..B10}


{DLL.Load}

Syntax (Quattro Pro)

{DLL.Load DLLName}

Parameters

DLLName

The name of a DLL file to load.

{DLL.Load} loads a dynamic-link library (DLL) program. You can use {DLL.Load} to load a DLL containing add-in @functions or macros. When the DLL is loaded, you can reference add-in @functions contained in the DLL without typing the DLL name. Similarly, macros contained in the DLL become resident in memory.

You can use {DLL.Load} to define a startup macro in QPW.INI.

{DLL.Load MYDLL} loads a DLL program named MYDLL.


{DODIALOG}

Syntax (Quattro Pro)

{DODIALOG DialogName, OKExit?, <Arguments>, <MacUse?>}

Parameters

DialogName

Name of dialog box to display.

OKExit?

Cell to store how the dialog box closed (1 for OK, 0 for Cancel).

Arguments

Cells to store the initial settings for controls in the dialog box and their final settings (optional).

MacUse?

1 if the user should manipulate the dialog box, 0 if the macro manipulates it (optional; 1 is the default).

{DODIALOG} displays a dialog box for the user or the macro to manipulate. MacUse? specifies how the dialog box is manipulated; if 0, the macro manipulates the dialog box, if 1, the macro pauses so the user can manipulate the dialog box.

DialogName is the name of the dialog box to display. Arguments refers to the cells containing initial settings for controls in the dialog box. Each cell in Arguments corresponds to one control in the dialog box with a Process Value property set to Yes; the order of controls in the dialog box determines which cell maps to which control (the first cell maps to the first control, the second cell maps to the second, and so on).

If a dialog box is under macro control (MacUse? set to 0), you can make it revert to user control using {PAUSEMACRO}.

Once the dialog box closes (performing its function), Corel Quattro Pro writes the new control settings into their respective cells. OKExit? is a cell containing the result of the dialog box operation; 1 if OK was chosen, 0 if the dialog box was canceled.


{DOWN} and {D}

Syntax (Quattro Pro)

{DOWN <Number>} or {D <Number>}

Parameters

Number

Any positive integer (optional).

{DOWN} and {D} are equivalent to the Down key. The optional argument Number moves the selector down the corresponding number of rows. You can also use cell references or cell names as arguments.

Examples

{DOWN}{DOWN} moves the selector down two rows.

{DOWN 4} moves the selector down four rows.

{DOWN G13} moves down the number of rows specified in cell G13.

{DOWN count} moves down the number of rows specified in the first cell of the named area “count”.


{DraftViewGoto}

Syntax (Quattro Pro)

{DraftViewGoto}

Syntax (PerfectScript)

DraftViewGoto()

Switches from either the Objects Sheet or the sheet in Page View mode to Draft View. Equivalent to View | Draft.


{DUPLICATE}

Syntax (Quattro Pro)

{DUPLICATE xoffset, yoffset}

Syntax (PerfectScript)

Duplicate (xoffset: Numeric; yoffset: Numeric)

Parameters

xoffset

Offset from the left edge of UpperCell to the left edge of the floating object.

yoffset

Offset from the top edge of UpperCell to the top edge of the floating object.

{DUPLICATE} copies selected chart annotations or dialog box controls. If no object is selected, {DUPLICATE} does nothing.

xoffset and yoffset are measured in relative coordinates for objects in a chart window, and in pixels for dialog box objects.

Examples

The following macro activates a floating chart for editing, creates a rectangle in the chart, makes a copy of the rectangle, then deactivates editing.

{GraphEdit Chart1, 1}

{CreateObject Rect,147,176,416,427}

{Duplicate 269,338}

{GraphDeactivate}