Chapter 4

Corel® Quattro® Pro 8 Product Commands
T - Z
{TAB}
Syntax (Quattro Pro)
{TAB <Number>}
Parameters
Number
Any positive integer or the address of a cell containing a positive integer (optional).
{TAB}, like {BIGRIGHT}, is equivalent to the Tab key, which moves one cell to the right.
Tip
When the Compatible Keys option of Tools | Settings | General is checked, {TAB} selects the leftmost cell of the screen that is to the right of the current one.
The optional argument Number specifies how many times to repeat the operation; for example, {TAB 2} is equivalent to pressing Tab twice.
{TabControl.Option}
|
Command Equivalent |
Equivalent to Properties | Page List... |
|
{TabControl.Add_Page TabControlName, Position} |
Add |
|
{TabControl.Delete_Page TabControlName, TabButtonName} |
Delete |
|
{TabControl.Insert_Page TabControlName, Position} |
Insert |
|
{TabControl.Move_Page TabControlName, TabButtonName,Up|Down} |
Move |
|
{TabControl.SelectPage TabControlName, TabButtonName} |
Select a named sheet |
{TabControl.Option} is equivalent to Properties | Page List, which lets you add, remove, and rearrange tabs in the current tab control.
{TABLE}
{TABLE} is equivalent to the Table key, F8, which repeats the last Tools | Numeric Tools | What-If operation.
{TableLink.Option}
|
Command equivalent |
Equivalent to Insert | External Data | Table Link... |
|
{TableLink.Block Block} |
... | Cells |
|
{TableLink.Name TableName} |
... | Table |
|
{TableLink.Go} |
... | OK |
{TableLink.Option} is the command equivalent Insert | External Data | Table Link. It establishes a link to an external database table and displays the table in a Corel Quattro Pro notebook.
You can use {TableLink?} or {TableLink!} to display the Table Link dialog box. {TableLink?} lets the user manipulate the dialog box, whereas {TableLink!} relies on the macro to manipulate it.
{TableQuery.Option}
|
Command equivalent |
Equivalent to Insert | External Data | Table Query... |
|
{TableQuery.Destination Block} |
...| Destination |
|
{TableQuery.FileQuery Yes|No} |
...| Query in File |
|
{TableQuery.Go} |
...| OK |
|
{TableQuery.QueryBlock Block} |
...| QBE Selection |
|
{TableQuery.QueryFile Filename} |
...| QBE File |
{TableQuery.Option} is equivalent to Insert | External Data | Table Query, which lets you search external databases for records. The query is not performed until {TableQuery.Go} is used.
You can use {TableQuery?} or {TableQuery!} to display the Table Query dialog box. {TableQuery?} lets the user manipulate the dialog box, whereas {TableQuery!} relies on the macro to manipulate it.
Examples
The following macro searches the external table TASKLIST.DB using the query file TASKLIST.QBE. The results of the search are stored in A:A2.
{TableQuery.FileQuery Yes}
{TableQuery.QueryFile TASKLIST.QBE}
{TableQuery.Destination A:A2}
{TableQuery.Go}
The next macro searches the same database, but uses the query defined in the named cell task_query.
{TableQuery.FileQuery No}
{TableQuery.QueryBlock task_query}
{TableQuery.Destination A:A2}
{TableQuery.Go}
{TableView}
{TableView} is equivalent to Insert | External Data | Database Desktop, which launches the Database Desktop.
{TemplateTB.Option}
|
Command Equivalent |
Description |
|
{TemplateTB.Add Name, Path} |
Adds a new Template Toolbar |
|
{TemplateTB.Show Name} |
Shows a Template Toolbar |
|
{TemplateTB.Hide Name} |
Hides a Template Toolbar |
|
{TemplateTB.Remove Name} |
Removes a Template Toolbar |
|
{TemplateTB.Reset Name} |
Resets a Template Toolbar to its default setup |
|
{TemplateTB.Docking_Position Name, Top | Left | Right | Bottom | Floating} |
Sets the docking position of a Template Toolbar |
|
{TemplateTB.Rename Name, NewName} |
Renames a Template Toolbar |
|
{TemplateTB.Context Name, Desktop (Yes | No), Notebook (Yes | No), Chart (Yes | No), Dialog (Yes | No), Objects Page (Yes | No), Slide Show (Yes | No)} |
Sets the contexts in Corel Quattro Pro in which a Template Toolbar appears |
{TemplateTB.Option} is similar to {Toolbar.Option} except that it controls the Template Toolbar.
{TERMINATE}
Syntax (Quattro Pro)
{TERMINATE DDEChannel}
Parameters
DDEChannel
Channel number of the DDE conversation to terminate.
{TERMINATE} closes down a DDE conversation opened with {INITIATE}.
For an example using {TERMINATE}, see {EXECUTE}.
{Toolbar.Option}
|
Command equivalent |
Equivalent to View | Toolbars... |
|
{Toolbar.Add Name, Path} |
Add |
|
{Toolbar.Context Name, Desktop(1|0), Notebook(1|0), Chart(1|0), Dialog(1|0), Objects Page(1|0), Slide Show(1|0)} |
Options | Visible in Context |
|
{Toolbar.Docking_Position Name, Top | Left | Right | Bottom | Floating, Order} |
Options | Docking Position |
|
{Toolbar.Hide Name} |
Hide |
|
{Toolbar.Remove Name} |
Remove |
|
{Toolbar.Rename Name, NewName} |
Options | Name |
|
{Toolbar.Reset Name} |
Reset |
|
{Toolbar.Show Name} |
Show |
{Toolbar.Option} is the command equivalent for View | Toolbars.
{Toolbar.Docking_Position Order} is a numeric number used to position the selected toolbar in relation to other visible toolbars at the specified docking position:
-1
displays the specified toolbar at the end of toolbars at the specified docking position
0
displays the specified toolbar at the beginning of toolbars at the specified docking position
1
displays the specified toolbar 1 position in from the beginning of toolbars at the specified docking position
n
displays the specified toolbar n positions in from the beginning of toolbars at the specified docking position.
To record such macros as adding, positioning, and removing toolbars, right-click anywhere on a visible toolbar while recording a macro.
{TTESTM}
Syntax (Quattro Pro)
{TTESTM InBlock1,InBlock2,OutBlock,<Labels>,<Alpha>,<Difference>}
Parameters
InBlock1
One or more numeric cell values representing the first input cells.
InBlock2
One or more numeric cell values representing the second input cells.
OutBlock
Upper left cell of the output cells.
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.
Alpha
Significance level of the test; the default is 0.05.
Difference
Value indicating the hypothetical difference in the means between InBlock1 and InBlock2; the default is 0.
{TTESTM} performs a Student’s t-Test using two indepependent (rather than paired) samples with equal variances. {TTESTM} is equivalent to the t-Test analysis tool.
{UNDO}
{UNDO} “takes back” the last command given and restores the previous state for most commands.
{UngroupObjects}
{UngroupObjects} is the command equivalent for Format | Ungroup. It separates the selected group of chart annotation objects so each can be moved or modified without affecting the others.
{UP} and {U}
Syntax (Quattro Pro)
{UP <Number>} or {U <Number>}
Parameters
Number
Any positive integer (optional).
{UP} and {U} are equivalent to the Up Arrow key. The optional argument Number moves the selector up the corresponding number of rows. You can use cell references or cell names as arguments.
Example
{UP}{UP}{UP} moves the selector up three rows.
{UP 4} moves the selector up four rows.
{UP C13} moves the selector up the number of rows specified in cell C13.
{UP temp} moves the selector up the number of rows specified in the first cell of the selection named temp.
{VLINE}
Syntax (Quattro Pro)
{VLINE Distance}
Syntax (PerfectScript)
VLine (Distance: Numeric)
Parameters
Distance
Number of rows to scroll the active notebook vertically.
{VLINE} scrolls the active notebook vertically by Distance rows. If the number is positive, it scrolls down; if negative, it scrolls up. {VLINE} does not move the selector; only the view of the notebook is altered. Use {DOWN} or {UP} to move the selector vertically.
Examples
{VLINE 11} scrolls the display 11 rows down.
{VLINE -4} scrolls the display 4 columns up.
{VPAGE}
Syntax (Quattro Pro)
{VPAGE Distance}
Syntax (PerfectScript)
VPage (Distance: Numeric)
Parameters
Distance
Number of screens to scroll the active notebook vertically.
{VPAGE} scrolls the active notebook vertically by Distance screens. If the number is positive, it scrolls down; if negative, it scrolls up. {VPAGE} does not move the selector; only the view of the notebook is altered. Use the commands {PGDN} or {PGUP} to move the selector vertically.
{WAIT}
Syntax (Quattro Pro)
{WAIT DateTimeNumber}
Parameters
DateTimeNumber
The date and time at which macro execution can resume.
{WAIT} pauses macro execution until the time corresponding to DateTimeNumber arrives. DateTimeNumber is a standard date/time serial number (both date and time portions must be included). If the current date is already later than the date specified in DateTimeNumber, macro execution continues immediately.
While execution is suspended, the macro is inactive, a WAIT indicator displays on the status line, and normal notebook operation can be restored only by pressing Ctrl+Break.
Examples
The following macro beeps, displays a “Go home” message, and suspends all execution until 8:00 a.m. the next day:
{BEEP 3}
{PUTCELL “Time to go home!”}
{DOWN}
{WAIT @TODAY+1+@TIMEVALUE(“8:00 AM”)}
This macro waits for one day:
{WAIT @NOW+1}
This macro uses {WAIT} to alert the user by sounding five short beeps, spaced two seconds apart:
\H {FOR counter,1,5,1,_loop_here}
_loop_here {BEEP 3}
{WAIT @NOW+@TIME(0,0,2)}
counter 6
{WhatIf.Option}
|
Command equivalent |
Equivalent to Tools | Numeric Tools | What-If... |
|
{WhatIf.Block Block} |
...| Data Table |
|
{WhatIf.Input_Cell_1 Cell} |
...| Input Cell (Column Input Cell) |
|
{WhatIf.Input_Cell_2 Cell} |
...| Row Input Cell |
|
{WhatIf.One_Way} |
...| One Free Variable, ... | Generate |
|
{WhatIf.Reset} |
...| Reset |
|
{WhatIf.Two_Way} |
...| Two Free Variables, ...| Generate |
{WhatIf.Option} is the command equivalent for Tools | Numeric Tools | What-If. It builds one- or two-variable “what-if” tables that display a range of results for different conditions.
If you are creating a one-variable table, use these command equivalents: {WhatIf.Input_Cell_1}, {WhatIf.Block}, {WhatIf.One_Way}. For two-variable tables, use {WhatIf.Input_Cell_2} after indicating the first input cell; use {WhatIf.Two_Way} instead of {WhatIf.One_Way}.
You can use {WhatIf?} or {WhatIf!} to display the What-If dialog box. {WhatIf?} lets the user manipulate the dialog box, whereas {WhatIf!} relies on the macro to manipulate it.
Example
The following macro defines A4..H18 as the “what-if” cells, B1 as Input Cell 1, B2 as Input Cell 2, and builds a two-variable table.
{Whatif.Block A:A4..A:H18}
{Whatif.Input_cell_1 A:B1}
{Whatif.Input_cell_2 A:B2}
{Whatif.Two_Way}
{WhatIfExpert}
{WhatIfExpert} is the command equivalent for Tools | Numeric Tools | What-If. The macro has no arguments. {WhatIfExpert} displays the first What-If Expert dialog box.
{WINDOW}
Syntax (Quattro Pro)
{WINDOW<Number>}
Parameters
Number
Number of an open notebook window (1-9).
{WINDOW} switches to the specified open notebook window (1-9). This command is for compatibility with Corel Quattro Pro for DOS; use {ACTIVATE} to activate windows when developing macros for Corel Quattro Pro for Windows.
The argument Number is optional; {WINDOW} without an argument is equivalent to the Pane key, F6.
{WindowArrIcon}
{WindowArrIcon} is equivalent to Window | Arrange Icons, which lines up minimized windows on the Corel Quattro Pro desktop or icons on the Objects sheet.
{WindowCascade}
{WindowCascade} is equivalent to Window | Cascade, which rearranges all open windows on the Corel Quattro Pro desktop.
{WindowClose}
{WindowClose} is equivalent to Close in a Control menu, which closes the active window (if the active window is not saved, a prompt appears to confirm the operation).
{WindowHide}
{WindowHide} is equivalent to Window | Hide, which conceals the active notebook window.
{WindowMaximize}
{WindowMaximize} is equivalent to Maximize in a Control menu, which enlarges the active window so it fills the screen.
{WindowMinimize}
{WindowMinimize} is equivalent to Minimize in a Control menu, which shrinks the active window to an icon on the Corel Quattro Pro desktop.
{WindowMove}
Syntax (Quattro Pro)
{WindowMove UpperLeftX, UpperLeftY}
Syntax (PerfectScript)
WindowMove (UpperLeftX: Numeric; UpperLeftY: Numeric)
Parameters
UpperLeftX
Distance between the left side of the Corel Quattro Pro window and the left side of active window, in pixels.
UpperLeftY
Distance between the bottom of the input line and the top of active window, in pixels.
{WindowMove} is equivalent to Move in a Control menu, which lets you move the active window. UpperLeftX and UpperLeftY are the new coordinates of the upper-left corner of the window.
{WindowNewView}
{WindowNewView} is the command equivalent for Window | New View. It displays a duplicate copy of the active notebook in a new window.
{WindowNext}
{WindowNext} is equivalent to choosing Next in a Control menu or pressing Ctrl+F6. It makes the next window active.
{WindowPanes}
Syntax (Quattro Pro)
{WindowPanes Horizontal|Vertical|Clear, Synch?(0|1), <Width>, <Height>}
Syntax (PerfectScript)
WindowPanes (Mode: Enumeration {Clear!; Horizontal!; Vertical!}; Synch?: Enumeration {Yes!; No!}; [Width: Numeric]; [Height: Numeric])
Parameters
Synch?
Whether the panes are synchronized: yes (1) or no (0).
Width
Width of the left pane or height of the upper pane (optional).
Height
Width of the right pane or height of the lower pane (optional).
{WindowPanes} is the command equivalent for View | Split Windows. It splits a notebook window into two horizontal or vertical panes; use Clear to restore a single pane.
Width and Height indicate the ratio relationship between the panes.
You can use {WindowPanes?} or {WindowPanes!} to display the Split Window dialog box. {WindowPanes?} lets the user manipulate the dialog box, whereas {WindowPanes!} relies on the macro to manipulate it.
Example
{WindowPanes Vertical,0,2,1} splits the notebook window into two vertical panes, not synchronized. The first pane is twice as wide as the second.
{WindowQPW.Option}
|
Command equivalent |
Equivalent to the Corel Quattro Pro Control menu | ... |
|
{WindowQPW.Maximize} |
... | Maximize |
|
{WindowQPW.Minimize} |
... | Minimize |
|
{WindowQPW.Restore} |
... | Restore |
{WindowQPW.Option} is the command equivalent for the Maximize, Minimize, and Restore commands on the Corel Quattro Pro Control menu.
{WindowRestore}
{WindowRestore} is equivalent to Restore on the Control Menu. It restores minimized windows to their original size.
{WindowShow}
Syntax (Quattro Pro)
{WindowShow Name}
Syntax (PerfectScript)
WindowShow (Name: String)
Parameters
Name
Name of the hidden window to show.
{WindowShow} is the command equivalent for Window | Show. It shows hidden window Name and makes it active.
You can use {WindowShow?} or {WindowShow!} to display the Show Window dialog box. {WindowShow?} lets the user manipulate the dialog box, whereas {WindowShow!} relies on the macro to manipulate it.
{WindowSize}
Syntax (Quattro Pro)
{WindowSize X,Y}
Syntax (PerfectScript)
WindowSize (X: Numeric; Y: Numeric)
Parameters
X
New window width, in pixels.
Y
New window height, in pixels.
{WindowSize} is equivalent to Size in the Control menu. It sizes the active window to the specified width and height.
{WINDOWSOFF}
{WINDOWSOFF} disables normal screen updating during macro execution when Corel Quattro Pro’s Macro Suppress-Redraw property is set to None. It can significantly speed up execution for most macros because it saves Corel Quattro Pro the time normally needed to redraw the screen each time a cell changes. Corel Quattro Pro cancels it once the macro stops executing, so the user is not “locked out” of the screen. To cancel its effect within the same macro, use {WINDOWSON}.
Use {WINDOWSOFF} with {PANELOFF} to completely disable normal screen updating.
Tip
After a {WINDOWSOFF} command, avoid letting users point to cells in response to an Edit command. The selector may be in a different cell than the “frozen” display indicates. If users must point to cells, precede it with a {WINDOWSON} command.
Example
The following macro uses {WINDOWSOFF} and {WINDOWSON} to turn off screen updating while Corel Quattro Pro sorts a list of vendors with the cell name vendor_name, thereby speeding up the sort operation.
sort_blk vendor_name
key_nm vendor_name
\W {QGOTO}sort_message~
{WINDOWSOFF}
{_sort vendor_name}
{WINDOWSON}
_sort {DEFINE sort_blk}
{Sort.Block @@(sort_blk)}
{BlockCopy sort_blk,key_nm}
{Sort.Key_1 @@(key_nm)}
{Sort.Order_1 “Ascending”}
{Sort.Go}
sort_message SORT IS IN PROGRESS
vendor_name General Cement Co.
Alveoli Mfg., Inc.
Sandab Development
Consolidated Dust
{WINDOWSON}
{WINDOWSON} reenables normal screen updating during macro execution, canceling the effects of a previous {WINDOWSOFF}. However, the screen will not be updated until {CALC} is encountered or the macro ends. If {WINDOWSON} is called when screen updating is already in effect, the command is ignored.
See {WINDOWSOFF} for an example using {WINDOWSON}.
{WindowTile}
{WindowTile} is the command equivalent for Window | Tile Side By Side. It displays all open windows without overlapping them.
{WindowTile.TopToBottom}
Syntax (Quattro Pro)
{WindowTile.TopToBottom}
Syntax (PerfectScript)
WindowTile_TopToBottom()
Tiles multiple files horizontally. Equivalent to Window | Tile Top To Bottom.
{WindowTitles}
Syntax (Quattro Pro)
{WindowTitles Horizontal | Vertical | Both | Clear}
{WindowTitles Horizontal|Vertical|Both|Clear} is the command equivalent for View | Locked Titles. It locks specific rows and/or columns of a spreadsheet sheet onscreen as titles. When you scroll, the titles remain fixed onscreen while the rows below (or columns to the right) scroll as usual. “Horizontal” locks rows above the active cell, “Vertical” locks columns to the left of the active cell, and “Both” locks both rows and columns. Use “Clear” to unlock the titles.
You can use {WindowTitles?} or {WindowTitles!} to display the Locked Titles dialog box. {WindowTitles?} lets the user manipulate the dialog box, whereas {WindowTitles!} relies on the macro to manipulate it.
You can use {WindowTitles.Title} with @COMMAND, @PROPERTY, and @CURVALUE. For example, use @COMMAND{“WindowTitles.Title”} to determine whether locked titles are in use and display their type (Horizontal, Vertical, Both, or Clear). You can also use this command in macros to check for locked titles.
\A {Calc} {If TitlesOn} {WindowTitles Clear} {Quit}
{WindowTitles Both}
TitlesOn @COMMAND(“WindowTitles.Title”) = “Both”
{WorkSpace.Option}
|
Command equivalent |
Equivalent to File | Workspace... |
|
{Workspace.Restore Filename} |
...| Restore |
|
{Workspace.Save Filename} |
...| Save |
{Workspace.Save} saves all open notebooks as a group with the specified Filename (Corel Quattro Pro’s default file extension for workspaces is .WBS). {Workspace.Restore} opens the specified file.
{WRITE}
Syntax (Quattro Pro)
{WRITE String<,String2,String3,...>}
Parameters
String
String of characters to be written into the open file.
{WRITE} copies String to a file opened with the {OPEN} command, starting at the location of the file pointer. The file pointer is advanced to the position following the last character written, and the file’s size increases if necessary. See {GETPOS} for a discussion of the file pointer.
{WRITE} does not place the carriage return and linefeed characters at the ends of lines. To include these characters, use {WRITELN}.
String can be a quoted string or text formula. If using more than one String, separate them with commas. For example, to write the label Dear Ms. followed by the contents of B6 into the file, use the following:
{WRITE “Dear Ms. ”,+B6}
You can use an unlimited number of String arguments with {WRITE}.
If no file is open, or if there is insufficient room on the disk to increase the file’s size, {WRITE} fails. Macro execution then continues with the first command after {WRITE} (in the same cell). If {WRITE} is successful, the rest of that cell’s commands are ignored, and execution continues on the next row below.
If you try to reference a cell that does not contain a label, an error message displays.
Tip
After you finish accessing a file with {WRITE}, it must be closed with {CLOSE}. Otherwise, the file could become corrupted if the computer is turned off or otherwise interrupted.
Example
The following example creates a text file with fixed-length fields that will serve as a phone list database. After the macro runs, the file will look like this:
Golden, David 415-555-7774;Hack, Edmund 201-555-3511;Hall, Sue Ann 617-555-5678
See the description of {READ} to see how to read a file like this.
\K {OPEN “A:PHONEDIR.PRN”,W}
{WRITE “Golden, David ”}
{WRITE “415-555-7774;”}
{WRITE “Hack, Edmund ”}
{WRITE “201-555-3511;”}
{WRITE “Hall, Sue Ann ”}
{WRITE “617-555-5678"}
{CLOSE}
{WRITELN}
Syntax (Quattro Pro)
{WRITELN String<,String2,String3,...>}
Parameters
String
String of characters to be written into the open file as a single line.
{WRITELN} copies String(s) to a file opened with {OPEN}, starting at the location of the file pointer, and ends the string(s) with the carriage-return and linefeed characters. The file pointer advances to the position following the last character written, and the file’s size increases if necessary. (See {GETPOS} for a discussion of the file pointer.)
To enter a blank line in the file, use {WRITELN “”}. To enter characters without carriage-return/linefeed characters, use {WRITE}.
String can be a quoted string or a text formula. If using more than one String, separate them with commas. For example, to write the label Dear Ms. followed by the contents of B6 into the file you would use
{WRITELN “Dear Ms. ”,+B6}
A carriage return and linefeed character are placed at the end of all strings combined, not after each. You can use an unlimited number of String arguments with {WRITELN}.
If no file is open, or if there is insufficient room on the disk to increase file’s size, {WRITELN} fails. Macro execution then continues with the first command after {WRITELN} in the same cell. If {WRITELN} succeeds, the rest of that cell’s commands are ignored, and execution continues on the next row below.
Tip
After you finish accessing a file with {WRITELN}, you must close the file with {CLOSE}. Otherwise, the file could become corrupted if the computer is turned off or otherwise interrupted.
Example
The following example shows how {WRITELN} is used to write a line of text to the file TEST.TXT. This line is terminated by the CR (carriage-return) and LF (linefeed) characters.
\Z {OPEN “A:TEST.TXT”,W}
{WRITELN “This is a short line.”}
{CLOSE}
{ZOOM}
{ZOOM} maximizes and restores the active window.
This command is for compatibility with Corel Quattro Pro for DOS; use {WindowMaximize} and {WindowRestore} when developing macros for Corel Quattro Pro for Windows.
Tip
To change the zoom factor for a notebook or sheet, use {Notebook.Zoom_Factor} or {Page.Zoom_Factor}, respectively.
{ZTESTM}
Syntax (Quattro Pro)
{ZTESTM InBlock1, InBlock2, OutBlock, <Labels(0|1)>, <Alpha>, <Difference>, <Variance1>, <Variance2>}
Parameters
InBlock1
One or more numeric cell values representing the first input cells.
InBlock2
One or more numeric cell values representing the second input cells.
OutBlock
Upper left cell of the output cells.
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.
Alpha
Significance level of the test; the default is 0.05.
Difference
A value indicating the hypothetical difference in the means between InBlock1 and InBlock2; the default is 0.
Variance1
A value indicating the variance of data set one; the default is 0.
Variance2
A value indicating the variance of data set two; the default is 0.
{ZTESTM} performs a two-sample z-Test for means, assuming known variances for each sample. {ZTESTM} is equivalent to the z-Test analysis tool.