Chapter 4

Corel® Quattro® Pro 8 Product Commands
R - S
{RANDOM}
{RANDOM} generates cells of random values drawn from a selected distribution. It is equivalent to the Random Number analysis tool. {RANDOM} has a different format for the following distribution types:
Uniform value has an equal probability of being selected.
Normal the qualities of a symmetrical, bell-shaped curve.
Bernoulli two possible outcomes, failure or success, represented by 0 and 1
Binomial the distribution of successful outcomes in a given number of independent Bernoulli trials.
Poisson distribution of values in any interval depends on the length of the interval and the constant Lambda, the expected number of occurrences in an interval
Patterned pattern of repeated values and sequences.
Discrete value in designated cells has a specified probability of being selected (the cumulative probabilities equal 1).
{RANDOM} - Uniform Distribution
Syntax (Quattro Pro)
{RANDOM OutBlock, Columns, Rows, 1, Seed, LowerBound, UpperBound}
Syntax (PerfectScript)
RANDOM (OutBlock: String; Columns: Numeric; Rows: Numeric; Type: Enumeration {Uniform!; Normal!; Bernoulli!; Binomial!; Poisson!; Patterned!; Discrete!}; Seed: Numeric; Parameter1: Any; [Parameter2: Numeric]; [Parameter3: Numeric]; [Parameter4: Numeric]; [Parameter5: Numeric])
Parameters
OutBlock
Upper left cell of the output cells.
Columns
A value indicating the number of random number sets to generate; default is the number of columns in OutBlock.
Rows
A value indicating the number of rows of random numbers to generate for each column.
1
Indicates uniform distribution.
Seed
Starting number for the random number generation algorithm.
LowerBound
A value indicating the lower bound on the set of numbers to generate.
UpperBound
A value indicating the upper bound on the set of numbers to generate.
When the Distribution argument equals 1, {RANDOM} generates random values drawn from a uniform distribution.
{RANDOM} - Normal Distribution
Syntax (Quattro Pro)
{RANDOM OutBlock, Columns, Rows, 2, Seed, Mean, SDev}
Syntax (PerfectScript)
RANDOM (OutBlock: String; Columns: Numeric; Rows: Numeric; Type: Enumeration {Uniform!; Normal!; Bernoulli!; Binomial!; Poisson!; Patterned!; Discrete!}; Seed: Numeric; Parameter1: Any; [Parameter2: Numeric]; [Parameter3: Numeric]; [Parameter4: Numeric]; [Parameter5: Numeric])
Parameters
OutBlock
Upper left cell of the output cells.
Columns
A value indicating the number of random number sets to generate; default is the number of columns in OutBlock.
Rows
A value indicating the number of rows of random numbers to generate for each column.
2
Indicates normal distribution.
Seed
Starting number for the random number generation algorithm.
Mean
A value indicating the mean of the set of numbers to generate.
SDev
A value indicating the standard deviation of the set of numbers to generate.
When the Distribution argument equals 2, {RANDOM} generates random values drawn from a normal distribution.
{RANDOM} - Bernoulli Distribution
Syntax (Quattro Pro)
{RANDOM OutBlock, Columns, Rows, 3, Seed, Prob}
Syntax (PerfectScript)
RANDOM (OutBlock: String; Columns: Numeric; Rows: Numeric; Type: Enumeration {Uniform!; Normal!; Bernoulli!; Binomial!; Poisson!; Patterned!; Discrete!}; Seed: Numeric; Parameter1: Any; [Parameter2: Numeric]; [Parameter3: Numeric]; [Parameter4: Numeric]; [Parameter5: Numeric])
Parameters
OutBlock
Upper left cell of the output cells.
Columns
A value indicating the number of random number sets to generate; default is the number of columns in OutBlock.
Rows
A value indicating the number of rows of random numbers to generate for each column.
3
Indicates Bernoulli distribution.
Seed
Starting number for the random number generation algorithm.
Prob
A value indicating the probability of success on each trial run; must be greater than or equal to 0 and less than or equal to 1.
When the Distribution argument equals 3, {RANDOM} generates random values drawn from a Bernoulli distribution.
{RANDOM} - Binomial Distribution
Syntax (Quattro Pro)
{RANDOM OutBlock, Columns, Rows, 4, Seed, Prob, Trials}
Syntax (PerfectScript)
RANDOM (OutBlock: String; Columns: Numeric; Rows: Numeric; Type: Enumeration {Uniform!; Normal!; Bernoulli!; Binomial!; Poisson!; Patterned!; Discrete!}; Seed: Numeric; Parameter1: Any; [Parameter2: Numeric]; [Parameter3: Numeric]; [Parameter4: Numeric]; [Parameter5: Numeric])
Parameters
OutBlock
Upper left cell of the output cells.
Columns
A value indicating the number of random number sets to generate; default is the number of columns in OutBlock.
Rows
A value indicating the number of rows of random numbers to generate for each column.
4
Indicates binomial distribution.
Seed
Starting number for the random number generation algorithm.
Prob
A value indicating the probability of success on each trial run; must be greater than or equal to 0 and less than or equal to 1.
Trials
A value indicating the number of trials.
When the Distribution argument equals 4, {RANDOM} generates random values drawn from a binomial distribution.
{RANDOM} - Poisson Distribution
Syntax (Quattro Pro)
{RANDOM OutBlock, Columns, Rows, 5, Seed, Lambda}
Syntax (PerfectScript)
RANDOM (OutBlock: String; Columns: Numeric; Rows: Numeric; Type: Enumeration {Uniform!; Normal!; Bernoulli!; Binomial!; Poisson!; Patterned!; Discrete!}; Seed: Numeric; Parameter1: Any; [Parameter2: Numeric]; [Parameter3: Numeric]; [Parameter4: Numeric]; [Parameter5: Numeric])
Parameters
OutBlock
Upper left cell of the output cells.
Columns
A value indicating the number of random number sets to generate; default is the number of columns in OutBlock.
Rows
A value indicating the number of rows of random numbers to generate for each column.
5
Indicates Poisson distribution.
Seed
Starting number for the random number generation algorithm.
Lambda
A parameter to the Poisson distribution representing the expected number of events in each unit.
When the Distribution argument equals 5, {RANDOM} generates random values drawn from a Poisson distribution.
{RANDOM} - Patterned Distribution
Syntax (Quattro Pro)
{RANDOM OutBlock, Columns, Rows, 6, Seed, LowerBound, UpperBound, Step, RepeatNumber, RepeatSequence}
Syntax (PerfectScript)
RANDOM (OutBlock: String; Columns: Numeric; Rows: Numeric; Type: Enumeration {Uniform!; Normal!; Bernoulli!; Binomial!; Poisson!; Patterned!; Discrete!}; Seed: Numeric; Parameter1: Any; [Parameter2: Numeric]; [Parameter3: Numeric]; [Parameter4: Numeric]; [Parameter5: Numeric])
Parameters
OutBlock
Upper left cell of the output cells.
Columns
A value indicating the number of random number sets to generate; default is the number of columns in OutBlock.
Rows
A value indicating the number of rows of random numbers to generate for each column.
6
Indicates patterned distribution.
Seed
Starting number for the random number generation algorithm.
LowerBound
A value indicating the lower bound on the set of numbers to generate.
UpperBound
A value indicating the upper bound on the set of numbers to generate.
Step
Increment value between LowerBound and UpperBound.
RepeatNumber
A value indicating the number of times to repeat each value.
RepeatSequence
A value indicating the number of times to repeat each sequence of values.
When the Distribution argument equals 6, {RANDOM} generates random values drawn from a patterned distribution.
{RANDOM} - Discrete Distribution
Syntax (Quattro Pro)
{RANDOM OutBlock, Columns, Rows, 7, Seed, InBlock}
Syntax (PerfectScript)
RANDOM (OutBlock: String; Columns: Numeric; Rows: Numeric; Type: Enumeration {Uniform!; Normal!; Bernoulli!; Binomial!; Poisson!; Patterned!; Discrete!}; Seed: Numeric; Parameter1: Any; [Parameter2: Numeric]; [Parameter3: Numeric]; [Parameter4: Numeric]; [Parameter5: Numeric])
Parameters
OutBlock
Upper left cell of the output cells.
Columns
A value indicating the number of random number sets to generate; default is the number of columns in OutBlock.
Rows
A value indicating the number of rows of random numbers to generate for each column.
7
Indicates discrete distribution.
Seed
Starting number for the random number generation algorithm.
InBlock
One or more numeric cell values representing the input cells, which contain a range of values and their probabilities, each in a separate column.
When the Distribution argument equals 7, {RANDOM} generates random values drawn from a discrete distribution.
{RANKPERC}
Syntax (Quattro Pro)
{RANKPERC InBlock,OutBlock,<Grouped>,<Labels(0|1)>}
Syntax (PerfectScript)
RANKPERC (InBlock: String; OutBlock: String; [Grouped: String]; [Labels?: Enumeration {Yes!; No!}])
Parameters
InBlock
Input cells containing one or more columns or rows of numeric values.
OutBlock
Upper left cell of the output cells.
Grouped
“C” to group results by column or “R” to group results by row; the default is “C”.
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.
{RANKPERC} returns the ordinal and percent rank of each value in InBlock. {RANKPERC} is equivalent to the Rank and Percentile analysis tool.
{READ}
Syntax (Quattro Pro)
{READ #Bytes,Location}
Parameters
#Bytes
Number of bytes of characters to read from a file.
Location
Cell in which to store the characters read.
{READ} reads #Bytes bytes of characters from a file previously opened using {OPEN} (starting at the current position of the file pointer), and stores them as a label in Location. The file is left unchanged, and the file pointer moves to the position following the last character read. (See {GETPOS} for a discussion of the file pointer.)
{READ} is similar to {READLN}, except for two differences. While {READLN} reads one line of characters (terminated by a carriage-return/linefeed pair), {READ} reads the precise number of characters specified. This lets you read, for example, fields within a record rather than an entire record. The second difference is that while {READLN} strips out the carriage-return/linefeed pair at the end of a line, {READ} manipulates these as if they were no different from other characters. If you use {READ} to read a file created by {WRITELN}, you will see two graphics characters at the end of each string read. These are the carriage return and linefeed characters. {READ} is best used only in conjunction with {WRITE}, or when you know the text file structure in detail.
If {READ} succeeds, macro execution continues in the cell below the cell containing the {READ} command; if {READ} fails, macro execution continues in the same cell.
Example
This macro opens a text file containing a phone directory database, and reads a name and phone number from the third record. The macro that created this text file is shown in the description of {WRITE}:
\L {OPEN “A:PHONEDIR.PRN”,R}
{SETPOS rec_length*(rec_number-1)}
{READ name_length,name}
{READ phone_length,phone}
{CLOSE}
rec_number 3
rec_length 28
name_length 14
phone_length 12
name Hall, Sue Ann
phone 617-555-5678
{READLN}
Syntax (Quattro Pro)
{READLN Location}
Parameters
Location
Cell in which to store the characters read.
{READLN} is like {READ}, but instead of using a number of bytes to determine the amount of text to read, {READLN} reads forward from the current file pointer location up to and including the carriage-return/linefeed at the end of the line. Unlike {READ}, it does not read the carriage return/linefeed into the cell. (See {GETPOS} for a discussion of the file pointer.)
Use {READ} to read lines from a record-structured file, where the lines are of uniform length. {READLN} can read the contents of a file one row at a time, making formatting of the data easier than {READ}.
Like the other file-access macros, if {READLN} fails, the macro continues execution in the current cell. If it is successful, the macro skips to the row below, and execution continues there. {ONERROR} can be used to trap disk and file errors, such as a disk drive door being left open.
Example
The following macro opens the text file TEST.TXT, reads in a line, and calculates the length of the line by subtracting the starting position from the ending position, then subtracting 1 from the result. This adjustment is necessary because the carriage-return and linefeed characters found at the end of each line in a typical text file are stripped away by Corel Quattro Pro when the text is read into cells. The macro that created the file TEST.TXT is shown in the description of {WRITELN}.
\M {OPEN “A:TEST.TXT”,R}
{GETPOS start}
{READLN input}
{GETPOS end}
{CLOSE}
{LET num_char,+(end-start)-1}
start 0
end 22
num_char 21
input This is a short line.
{RECALC}
Syntax (Quattro Pro)
{RECALC Location,<Condition>,<Iteration#>}
Syntax (PerfectScript)
Recalc (Block: String; [Condition: Any]; [Iteration: Numeric])
Parameters
Location
Cells to recalculate.
Condition
Condition to be met before recalculation is halted (optional).
Iteration#
Maximum number of times to recalculate Location trying to meet Condition (optional).
{RECALC} causes Corel Quattro Pro to recalculate a specified portion of the notebook in a row-by-row order. This is different from normal recalculation, where Corel Quattro Pro recalculates the entire notebook in natural order; that is, before a formula calculates, each cell it references is recalculated first.
With the optional Condition argument, you can tell Corel Quattro Pro to recalculate formulas in cells repeatedly until the specified condition is met. You can also supply Iteration# to specify the maximum number of times to recalculate formulas trying to satisfy Condition. To use Iteration#, Condition must also be supplied.
{RECALC} is useful for rapid recalculation of specified parts of a notebook, particularly when the notebook is so large that global recalculations would significantly slow your work.
{RECALC} overrides the recalculation method specified for the notebook, enforcing row-by-row recalculation. If all the formulas reference only cells above, or to the left in the same row, the notebook will be correctly calculated. If there are references to cells to the left and below, you must use {RECALCCOL}. If there are references to cells below or to the right in the same row as your formula, you must use {CALC} to recalculate the entire notebook.
{RECALC} displays the results of recalculation.
Tip
If there are formulas within the cells being recalculated that depend on formulas outside of the cells, they might not evaluate correctly. Make sure Location encompasses all the cells referenced by formulas within the cells.
{RECALCCOL}
Syntax (Quattro Pro)
{RECALCCOL Location,<Condition>,<Iteration#>}
Syntax (PerfectScript)
RecalcCol (Block: String; [Condition: Any]; [Iteration: Numeric])
Parameters
Location
Cells to recalculate.
Condition
Condition to be met before recalculation is halted (optional).
Iteration#
Maximum number of times to recalculate Location trying to meet Condition (optional).
{RECALCCOL} recalculates the specified portion of a notebook in column-by-column order. It is similar to {RECALC} which recalculates row by row. See {RECALC} for information on when {RECALCCOL} is appropriate and when you need to use {CALC} instead.
{REGRESS}
Syntax (Quattro Pro)
{REGRESS InBlockY, InBlockX, YIntZero(0|1), Labels(0|1), Confidence, SumOutBlock, Residuals(0|1), StdResiduals(0|1), <ResidualOutBLock>, <ProbOutBlock>}
Syntax (PerfectScript)
REGRESS (InBlockY: String; InBlockX: String; YIntZero?: Enumeration {Yes!; No!}; Labels?: Enumeration {Yes!; No!}; Confidence: Numeric; SumOutBlock: String; Residuals?: Enumeration {Yes!; No!}; StdResiduals?: Enumeration {Yes!; No!}; [ResidualOutBlock: String]; [ProbOutBlock: String])
Parameters
InBlockY
Input cells containing a single column of y values (the dependent variables).
InBlockX
Input cells containing one or more columns of x values (the independent variables).
YIntZero
1 if the y-intercept is 0 (the line of regression passes through the origin); 0 if the y-intercept is not 0.
Labels
1 if labels are located in the first column or row of the InBlockY and InBlockX; 0 if the input selections do not contain labels.
Confidence
A value indicating the confidence level to apply to the regression.
SumOutBlock
Upper left cell of the output cells for the summary table (allow at least seven columns).
Residuals
1 or 0; if 1, includes residuals in the output table.
StdResiduals
1 or 0; if 1, includes standardized residuals in the output table.
ResidualOutBlock
Upper left cell of the output cells for the residuals table (allow at least four columns).
ProbOutBlock
Upper left cell of the output cells for the probabilities table (allow at least two columns).
{REGRESS} performs multiple linear regression analysis. {REGRESS} is equivalent to the Advanced Regression analysis tool.
{Regression.Option}
|
Command equivalent |
Equivalent to Tools | Numeric Tools | ... |
|
{Regression.Dependent Block} |
...Regression | Dependent |
|
{Regression.Go} |
...Regression | OK |
|
{Regression.Independent Block} |
...Regression | Independent |
|
{Regression.Output Block} |
...Regression | Output |
|
{Regression.Reset} |
...Regression | Reset |
|
{Regression.Y_Intercept Compute|Zero} |
...Regression | Y Intercept |
{Regression.Option} is the command equivalent for Tools | Numeric Tools | Regression. It performs a regression analysis to show the relationship between a set of independent variables and a dependent variable.
{Regression.Dependent} indicates the dependent-variable cells. {Regression.Independent} defines the independent variables. In {Regression.Independent}, Block can be noncontiguous with one variable to a column. The dependent and independent selections must all have the same number of rows.
{Regression.Output} indicates where to store the table of regression results. {Regression.Y_Intercept} specifies whether to compute the Y-intercept, or set it to zero. You can use {Regression.Reset} to clear all settings. Use {Regression.Go} after the other command equivalents to perform the regression analysis. If data changes within the independent or dependent data selections, use {Regression.Go} again to calculate a new regression table.
You can use {Regression?} or {Regression!} to display the Linear Regression dialog box. {Regression?} lets the user manipulate the dialog box, whereas {Regression!} relies on the macro to manipulate it.
Example
The following macro sets these data selections: Independent, B2..D16; Dependent, F2..F16. The last statement performs the regression analysis and stores the results in the cells with upper-left cell H2.
{Regression.Independent A:B2..A:D16}
{Regression.Dependent A:F2..A:F16}
{Regression.Output A:H2}
{Regression.Go}
{REQUEST}
Syntax (Quattro Pro)
{REQUEST DDEChannel,DataToReceive,DestBlock}
Syntax (PerfectScript)
Request (DDEChannel: Numeric; DataToReceive: String; DestBlock: String)
Parameters
DDEChannel
DDE channel number of the application to receive data from.
DataToReceive
Information to receive from the application.
DestBlock
Cells to store the data received into.
{REQUEST} gets information specified by DataToReceive from applications that support Dynamic Data Exchange (DDE). This information is stored in DestBlock. DataToReceive is a string representing the location of the data to receive in the other application. In Corel Quattro Pro, this could be cells such as A2..A7 or a property such as “(Application.Display)”. If requesting a property, the property must be enclosed in parentheses. You must use {INITIATE} to open a channel of communication and obtain the value DDEChannel before using {REQUEST}.
If your conversation is not within a specific topic (in other words, you opened the channel using the command {INITIATE AppName,"System",DDEChannel}), you can use the following strings in DataToReceive, depending on the application:
Arguments for DataToReceive
|
String |
Purpose |
|
“SysItems” |
A listing of all strings you can use with DataToReceive. You can use this command first to view other choices offered by AppName. |
|
“Topics” |
A listing of all topics open. For example, a list of open documents under Word for Windows. |
|
“Status” |
The current status of the application. For example, READY in Excel or EDIT in Corel Quattro Pro when a cell is being edited. |
|
“Formats” |
A list of all Clipboard formats supported by the application or DDE link. |
|
“Selection” |
A list of all items currently selected in the application. For example, in Excel cells A3..A47 could be selected. |
Examples
This macro gets the major and minor version numbers of GroupWise, which is already running.
dde_channel 0
get_vernumber {INITIATE “GroupWise”,"Command",dde_channel}
{REQUEST dde_channel,"GetOfficeData(ID;MajorVersion!)",G1}
{REQUEST dde_channel,"GetOfficeData(ID;MinorVersion!)",G2}
{TERMINATE dde_channel}
This macro gets information from the fields Task and Completed in ObjectVision file TASKLIST.OVD and stores the data in the active notebook.
dde_channel 10
command [@NEXT(“TASKS”)]
exec_result 0
vision_task Print out third quarter report
task_complete Yes
_get_vision_task {INITIATE “VISION”,"TASKLIST.OVD",dde_channel}
{REQUEST dde_channel,"Task",vision_task}
{REQUEST dde_channel “Completed”,task_complete}
{EXECUTE dde_channel,+command,exec_result}
{RESIZE}
Syntax (Quattro Pro)
{RESIZE x,y,NewWidth,NewHeight,<VertFlip?>,<HorizFlip?>}
Syntax (PerfectScript)
Resize (x: Numeric; y: Numeric; NewWidth: Numeric; NewHeight: Numeric; [VertFlip?: Enumeration {Yes!; No!}]; [HorizFlip?: Enumeration {Yes!; No!}])
Parameters
x and y
Xy coordinates of the new upper left corner, in pixels.
NewWidth
The new width, in pixels, of the object or group.
NewHeight
The new height, in pixels, of the object or group.
VertFlip?
1 if the object or group is flipped vertically from its previous position.
HorizFlip?
1 if the object or group is flipped horizontally from its previous position.
{RESIZE} resizes all selected objects in the active window (dialog or chart window).
{ResizeToSame}
{ResizeToSame} is equivalent to Format | Resize To Same, which lets you resize selected objects in the dialog window to the same size as the first object selected.
{RESTART}
{RESTART} changes the current subroutine to the starting routine (or the main routine) by removing all preceding For loops and subroutine calls.
{RESTART} is typically used for error handling. If an application is already nested to near the maximum number of levels and a severe error occurs that requires the macro to end, {RESTART} ensures that additional subroutine calls can be made. If you use the {RESTART} command often, you may want to use {BRANCH} to run subroutines.
{RestrictInput.Option}
|
Command equivalent |
Equivalent to... |
|
{RestrictInput.Enter Block} |
No equivalent menu command |
|
{RestrictInput.Exit} |
Any operation that ends INPUT mode |
{RestrictInput.Enter} enters INPUT mode and stays under macro control until {PAUSEMACRO} is used or {RestrictInput.Exit}, which exits INPUT mode.
{RestrictInput.Option} confines selector movement to specific cells of unprotected cells.
You can use {RestrictInput?} or {RestrictInput!} to display the Restrict Input dialog box. {RestrictInput?} lets the user manipulate the dialog box, whereas {RestrictInput!} relies on the macro to manipulate it.
{RETURN}
{RETURN} ends the executing subroutine and returns control to the macro that called it. If the macro executing is not a subroutine, execution stops.
A {RETURN} command at the end of a subroutine is optional, since a macro automatically returns from a subroutine when it reaches a blank cell or a cell containing a value. {RETURN} is usually used with {IF} to return to the main macro if a certain condition is met.
See {Subroutine} for an example of using {RETURN}.
{RIGHT} and {R}
Syntax (Quattro Pro)
{RIGHT <Number>}
Parameters
Number
Any positive integer (optional).
{RIGHT} and {R} are equivalent to the Right Arrow key. The optional argument Number moves the selector the corresponding number of columns to the right. You can also use cell references or cell names as arguments.
Example
{RIGHT}{RIGHT} moves right two columns.
{R 6} moves right six columns.
{RIGHT D9} moves right the number of columns specified in cell D9.
{RIGHT count} moves right the number of columns specified in the first cell of the selection named count.
{ROWCOLSHOW}
Syntax (Quattro Pro)
{ROWCOLSHOW Block,Show?,Row or Col,FirstPane?}
Syntax (PerfectScript)
RowColShow (Block: String; Show?: Enumeration {Yes!; No!}; Row?: Enumeration {Yes!; No!}; FirstPane?: Enumeration {Yes!; No!})
Parameters
Block
Cells containing rows or columns to hide or show.
Show?
1 to reveal rows or columns; 0 to hide rows or columns.
Row or Col
1 to reveal or hide a row; 0 to reveal or hide a column.
FirstPane?
1 to affect rows or columns in left or top window pane; 0 to affect them in the right or bottom window pane.
{ROWCOLSHOW} lets you hide or reveal rows and columns (it is equivalent to the cell property Reveal/Hide). Show? specifies whether to reveal (1) or hide (0). Row or Col specifies whether to affect rows (1) or columns (0). Block contains the rows or columns to affect. FirstPane? is used when the active window is split into panes (using View | Split Window). To affect the columns or rows in the left or top pane, set FirstPane? to 1; to affect rows or columns in the right or bottom pane, set FirstPane? to 0.
Examples
{ROWCOLSHOW A:A..B,1,0,1} reveals columns A and B on sheet A.
{ROWCOLSHOW A:1..7,0,1,1} hides rows 1 through 7 on sheet A.
{ROWCOLSHOW A:1..7,1,1,0} reveals rows 1 through 7 on sheet A. If the window is split, the rows are revealed in the right or bottom pane.
{ROWHEIGHT}
Syntax (Quattro Pro)
{ROWHEIGHT Block,FirstPane?,Set/Reset,Size}
Syntax (PerfectScript)
RowHeight (Block: String; FirstPane?: Enumeration {Yes!; No!}; Reset?: Enumeration {Yes!; No!}; Size: Numeric)
Parameters
Block
Cells containing rows to resize.
FirstPane?
1 to resize rows in left or top window pane; 0 to resize rows in right or bottom window pane.
Set/Reset
0 to set the row height; 1 to reset the row height.
Size
New height (in twips) if setting size; not needed if resetting size.
{ROWHEIGHT} provides two ways to change the height of a row or rows (it is equivalent to the cell property Row Height). The rows to change are specified by Block. FirstPane? is used when the active window is split into panes (using View | Split Window). To resize the rows in the left or top pane, set FirstPane? to 1; to resize the rows in the right or bottom pane, set FirstPane? to 0.
Set/Reset specifies how to change the height. To set a row height, use this syntax: {ROWHEIGHT Block, FirstPane?, 0, Size}
Size is the new row height, in twips. The maximum height is ten inches (14,400 twips).
To reset a row to the default height (determined by font sizes in the row), use this syntax: {ROWHEIGHT Block, FirstPane?, 1}
Examples
{ROWHEIGHT A:1..A:2,1,0,1440} sets the height of rows 1 and 2 (on sheet A) to one inch (1,440 twips).
{ROWHEIGHT A:1..A:2,0,0,2160} sets the height of rows 1 and 2 (on sheet A) to one and a half inches (2,160 twips). If the window is split, the top or left pane is affected.
{ROWHEIGHT A:5,1,1} resets the height of row 5 (on sheet A) to the default height.
{SAMPLE}
Syntax (Quattro Pro)
{SAMPLE InBlock,OutBlock,Type,Rate}
Syntax (PerfectScript)
SAMPLE (InBlock: String; OutBlock: String; Type: String; Rate: Numeric)
Parameters
InBlock
One or more numeric or cell values representing the input cells.
OutBlock
Upper left cell of the output cells.
Type
“P” to specify periodic sample; “R” to specify random sampling.
Rate
A value indicating a sampling rate; if Type = “P”, Rate indicates the periodic interval used for sampling; if Type = “R”, Rate indicates the number of samples.
{SAMPLE} returns a periodic or random sample from values in InBlock. {SAMPLE} is equivalent to the Sampling analysis tool.
{Scenario.Option}
|
Command equivalent |
Equivalent to Tools | Scenario | Edit... |
|
{Scenario.AddCells <Block>} |
...| Add |
|
{Scenario.Capture ScenarioName} |
...| Capture |
|
{Scenario.CaptureArea Area,Block} |
...| Modify | Capture Area |
|
{Scenario.Close} |
Closes a Scenario Manager session; no equivalent command |
|
{Scenario.DeleteGroup GroupName} |
...| Modify | Delete |
|
{Scenario.Find} |
...| Find |
|
{Scenario.Highlight Highlight?(0|1), ChangeCellColor(0-15), ResultCellColor(0-15)} |
...| Highlight |
|
{Scenario.NewGroup GroupName} |
...| Modify | New |
|
{Scenario.Open} |
Initializes a Scenario Manager session; no equivalent command |
|
{Scenario.Remove ScenarioName} |
...| Delete |
|
{Scenario.RemoveCells <Block>} |
...| Remove |
|
{Scenario.RenameGroup OldGroupName,NewGroupName} |
...| Modify | Rename |
|
{Scenario.Report AllGroups(0|1), LeftLabels(0|1), TopLabels(0|1), <Block>} |
...| Report |
|
{Scenario.Show ScenarioName} |
...| Scenarios list |
|
{Scenario.Update_On_Block Update?(0|1)} |
...| Modify | Options |
|
{Scenario.UseGroup GroupName} |
...| Group Management |
{Scenario.Option} is the command equivalent for Tools | Scenario | New. It lets you change values in a model, saving the conditions and results for different scenarios. {Scenario.Open} must be used prior to using other {Scenario.Option} commands; use {Scenario.Close} when you are finished using the Scenario Manager. For {Scenario.AddCells} and {Scenario.RemoveCells}, Block defaults to the currently selected cells. For {Scenario.Report}, Block defaults to the first empty sheet in the notebook.
You can use {Scenario?} or {Scenario!} to display the Scenario Manager dialog box. {Scenario?} lets the user manipulate the dialog box, whereas {Scenario!} relies on the macro to manipulate it.
Example
The following macro captures the base scenario and two additional scenarios for a car loan.
{Scenario.Open}
{Scenario.Capture Base Scenario}
{Scenario.Update}
{SelectBlock A:F4}
{PutCell “.096"}
{SelectBlock A:C5}
{PutCell “60"}
{Scenario.Find}
{Scenario.Highlight 1,7,9}
{Scenario.Capture APR96-60}
{Scenario.Update}
{SelectBlock A:F4}
{PutCell “.085"}
{SelectBlock A:C5}
{PutCell “48"}
{Scenario.Find}
{Scenario.Highlight 1,7,9}
{Scenario.Capture APR85-48}
{Scenario.Update}
{Scenario.Report 0,1,0}
{FileSaveAs “C:\COREL\SUITE8\DATA\CARS.WB3"}
{Scenario.Close}
{ScenarioExpert}
{ScenarioExpert} is the command equivalent for Tools | Scenario | New. The macro has no arguments. {ScenarioExpert} displays the first Scenario Expert dialog box.
{SCROLLOFF} and {SCROLLON}
{SCROLLOFF} and {SCROLLON} are equivalent to Scroll Lock off and Scroll Lock on, respectively.
{Search.Option}
|
Command equivalent |
Equivalent to Edit | Find And Replace... |
|
{Search.Block Block} |
...| Cells |
|
{Search.Case Any|Exact} |
...| Case Sensitive |
|
{Search.Direction Column|Row} |
...| Columns First |
|
{Search.Find String} |
...| Find |
|
{Search.Look_In Condition | Formula | Value} |
...| Look In |
|
{Search.Match Part|Whole} |
...| Match Whole |
|
{Search.Next} |
...| Next |
|
{Search.Previous} |
...| Previous |
|
{Search.Replace} |
...| Replace button |
|
{Search.ReplaceAll} |
...| Replace All |
|
{Search.ReplaceBy String} |
...| Replace edit field |
|
{Search.Reset} |
...| Reset |
{Search.Option} is equivalent to Edit | Find And Replace, which searches for strings in the active sheet. Use {Search.ReplaceBy} to specify the replacement string; {Search.Replace} replaces the string.
You can use {Search?} or {Search!} to display the Find And Replace dialog box. {Search?} lets the user manipulate the dialog box, whereas {Search!} relies on the macro to manipulate it.
Example
The following macro searches the active sheet for 1993 in formulas and replaces it with 1994.
{Search.Reset}
{Search.Block “”}
{Search.Look_In Formula}
{Search.Match Part}
{Search.Find “1993"}
{Search.ReplaceBy “1994"}
{Search.ReplaceAll}
{SelectAll}
{SelectAll} is the command equivalent for Edit | Select All.
{SELECTBLOCK}
Syntax (Quattro Pro)
{SELECTBLOCK Block, <ActiveCell>}
Syntax (PerfectScript)
SelectBlock (Block: String; [ActiveCell: String])
Parameters
Block
Coordinates of the cell(s) to select.
ActiveCell
Address of the cell within the cells to make active.
{SELECTBLOCK} lets you select a contiguous or noncontiguous selection within the active notebook. The noncontiguous selections must be enclosed in parentheses.
Examples
{SELECTBLOCK A4..B23} selects the cells A4..B23 in the active notebook window.
{SELECTBLOCK (A:A1..A:B12,B:B13..B:C34)} selects the noncontiguous selections A:A1..A:B12, B:B13..B:C34.
{SELECTFLOAT}
Syntax (Quattro Pro)
{SELECTFLOAT ObjectID1<,ObjectID2,...>}
Syntax (PerfectScript)
SelectFloat (ObjectID: String; {[MoreObjectID: String]})
Parameters
ObjectIDx
Name of the notebook object(s) to select.
With {SELECTFLOAT} you can select floating objects in the active notebook window using their names. (To find the name of an object, view it and study its Object Name property.) Use {SELECTOBJECT} to select objects in a chart or dialog window.
Example
{SELECTFLOAT “Button1"} selects the macro button in the the active notebook window with the object name Button1.
{SELECTOBJECT}
Syntax (Quattro Pro)
{SELECTOBJECT ObjectID1<,ObjectID2,...>}
Syntax (PerfectScript)
SelectObject ([ObjectID: String]; {[MoreObjectID: String]})
Parameters
ObjectIDx
Identification number or name of the object(s) to select.
With {SELECTOBJECT} you can select objects in the active window using their ID numbers or names. (To find the ID number of an object, view it and study its Object ID property. Its name is stored in its Name property.) Since {SELECTOBJECT} is context-sensitive, you can select controls in a dialog window, drawings in a chart window, or icons in the Objects sheet.
Example
{SELECTOBJECT 2,5,7} selects the objects in the active window with the IDs 2, 5, and 7.
{Series.Option}
|
Command equivalent |
Equivalent to Chart | Series... |
|
{Series.Data_Range SeriesNumber | “XAxisLabelSeries” | “LegendSeries”, Block <,CreateIfNotExist? (0|1)>} |
...| Number or X-Axis or Legend |
|
{Series.Delete SeriesNumber <,AndAllSeriesFollowing?>} |
...| Delete |
|
{Series.Go} |
...| OK |
|
{Series.Insert SeriesNumber, Block} |
...| Add |
|
{Series.Label_Range SeriesNumber, Block <,CreateIfNotExist? (0|1)>} |
[series Object Inspector] | Label Series |
|
{Series.Legend SeriesNumber, LegendText} |
[series Object Inspector] | Legend |
|
{Series.Reverse_Series 1|0} |
...| Reverse Series |
|
{Series.Swap_Row_Col 1|0} |
...| Row/Column Swap |
{Series.Option} is equivalent to Chart | Series and options in a series Object Inspector, which creates or deletes chart series.
When you manipulate a series using command equivalents, the changes are not made until the command {Series.Go} is used. In all the commands, SeriesNumber is the number of the series to affect (1 for the first series, 2 for the second, and so on).
{Series.Data_Range} changes the values of an existing series. Block is the new cells that the series should take values from. If you are not sure whether the series exists, set CreateIfNotExist? to 1. Then the series will be created if it does not already exist. You can also use {Series.Data_Range} to set the x-axis series (use “XAxisLabelSeries”) or set the legend series (use “LegendSeries”).
{Series.Delete} removes an existing series. Set AndAllSeriesFollowing? to 1 if you also want to remove all series following SeriesNumber.
{Series.Insert} creates a new series. The series is inserted at the position specified by SeriesNumber. Block refers to the cells containing the new series’ data.
{Series.Label_Range} sets up the labels for each value in a series. Block refers to the cells containing the labels. If you are not sure whether the series exists, set CreateIfNotExist? to 1. Then the series will be created if it does not already exist.
{Series.Legend} sets the legend text for a series (LegendText is the new text).
You can use {Series?} or {Series!} to display the Chart Series dialog box. {Series?} lets the user manipulate the dialog box, whereas {Series!} relies on the macro to manipulate it.
Tip
You can add series to a floating chart using {ADDSERIES}.
Example
The following macro creates a chart named Profit99 with two series. The series values are in A:A1..A27 and A:C1..C27. The series labels are in A:B1..B27 and A:D1..D27. The x-axis is stored in A:E1..E27.
{GraphNew Profit99}
{GraphEdit Profit99}
{Series.Data_Range 1,A:A1..A27,1}
{Series.Data_Range 2,A:C1..C27,1}
{Series.Label_Range 1,A:B1..B27}
{Series.Label_Range 2,A:D1..D27}
{Series.Data_Range “XAxisLabelSeries”,A:E1..E27}
{Series.Go}
The following macro inserts a new series between the two series in the last example.
{GraphEdit Profit99}
{Series.Insert 2,A:G1..G27}
{Series.Go}
{SeriesManager.Option}
|
Command equivalent |
Equivalent to |
|
{SeriesManager.Define Name, Formula, FormulaText, SeedText} |
Edit | Fill | Define QuickFill | Create (Formula series) |
|
{SeriesManager.Define Name, List, Repeating?(0|1), Value1 <,Value2, Value3,...>} |
Data | Fill | Define QuickFill | Create (List series) |
|
{SeriesManager.Go Name, Rows | Columns | Tabs, Block} |
Equivalent to using the SpeedFill button on the Main Toolbar |
|
{SeriesManager.Remove Name} |
Edit | Fill | Define QuickFill | Delete |
|
{SeriesManager.Rename OldName, NewName} |
Edit | Fill | Define QuickFill | Rename |
{SeriesManager.Option} is the command equivalent for Data | Fill | Define QuickFill |. Use {SeriesManager.Define Name, Formula,...} to create a formula series and {SeriesManager.Define Name, List,...} to create a list series.
You can use {SeriesManager?} or {SeriesManager!} to display the Define Fill Series dialog box. {SeriesManager?} lets the user manipulate the dialog box, whereas {SeriesManager!} relies on the macro to manipulate it.
Examples
The following macro creates a SpeedFill series named “First of Month” that consists of the first day of each month in 1995, then fills a column starting at A:A2 with the dates.
{SeriesManager.Define “First of Month”, List, No, “01/01/95", ”02/01/95", “03/01/95", ”04/01/95", “05/01/85", ”06/01/95", “07/01/95", ”08/01/95", “09/01/95", ”10/01/05", “11/01/95", ”12/01/95"}
{SpeedFill}
{SeriesManager.Go “First of Month”,Columns, A:A2}
{SETGRAPHATTR}
Syntax (Quattro Pro)
{SETGRAPHATTR FillColor,BkgColor,FillStyle,BorderColor,BoxType}
Syntax (PerfectScript)
SetGraphAttr (FillColor: String; BkgColor: String; FillStyle: String; BorderColor: String; BoxType: String)
Parameters
FillColor
New fill color of the selected object(s).
BkgColor
New background color of the selected object(s).
FillStyle
New fill style of the selected object(s).
BorderColor
New border color of the selected object(s).
BoxType
New border style of the selected object(s).
{SETGRAPHATTR} lets you quickly set the properties of all selected objects in the active chart window. If one of the arguments specified in the {SETGRAPHATTR} command is not appropriate for an object, that argument is ignored.
Each color (FillColor, BkgColor, and BorderColor) is in quotes, and specified in RGB format. For FillStyle, use any of the strings for that option in the appropriate Object Inspector.
BoxType specifies the new border style for the object; use any Border Style property string included in a chart Object Inspector.
{SETLCID}
Syntax (Quattro Pro)
{SETLCID <LocaleID>}
Syntax (PerfectScript)
SetLCID ([LocalID: Numeric])
Parameters
LocaleID
Value for a locale ID.
{SETLCID} sets the locale ID to the default locale ID or to one specified by LocaleID. The locale ID is a fixed number which specifies language, separator character, and a variety of other international settings; use {SETLCID} to ensure that the automation controller is using the default ID or the ID of a specific target object.
For more details on using {SETLCID} and other OLE automation macro commands, see OLE Automation.
{SETMENUBAR}
Syntax (Quattro Pro)
{SETMENUBAR <SystemDefinition>}
Syntax (PerfectScript)
SetMenuBar ([SystemDefinition: String])
Parameters
SystemDefinition
Cells containing a menu system definition.
{SETMENUBAR} lets you specify which menu system displays on the menu bar. SystemDefinition refers to cells containing the new menu system definition.
You can use {SETMENUBAR} without an argument to restore the default Corel Quattro Pro menu system.
Examples
{SETMENUBAR “A3..C324"} makes the system defined in A3..C324 the active menu system.
{SETOBJECTPROPERTY}
Syntax (Quattro Pro)
{SETOBJECTPROPERTY Object.Property,Value}
Syntax (PerfectScript)
SetObjectProperty (ObjectProperty: String; Value: String)
Parameters
Object
Object to alter property of.
Property
Property to alter.
Value
New property setting (or another instance of Object.Property to copy the new setting from).
{SETOBJECTPROPERTY} can change the property settings of many Corel Quattro Pro objects. Selectable objects such as blocks and annotations can also be changed using {SETPROPERTY}. {SETOBJECTPROPERTY} can affect:
Dialog controls. Use this syntax to specify a control to manipulate in a dialog window: [Notebook]DialogName:ObjectID.Property. [Notebook] is optional. For example, the following macro sets the Fill Color property of the control Rectangle1 in the dialog ColorPick to red:
{SETOBJECTPROPERTY “ColorPick:Rectangle1.Fill_Color”, “255,0,0"}
Chart objects. Use the same syntax as for dialog controls, but substitute the name of the chart in place of DialogName. For example, the following macro changes the size of a rectangle named ColorPick in the chart 1QTR92:
{SETOBJECTPROPERTY “1QTR92:ColorPick.Dimension”, “0,0,25,25"}
Menu items. Use the syntax MenuPath.Property. See the description of {ADDMENU} for the syntax of MenuPath.
For example, the following macro disables File | Save in the active menu system:
{SETOBJECTPROPERTY “/File/Save.Disabled”, “Yes”}
Value is the new setting for the property. You can also substitute another instance of Object.Property for this argument to copy property settings between objects. For example, this macro copies the text color of the active cells to the text color of A23:
{SETOBJECTPROPERTY “A23.Text_Color”,"Active_Block.Text_Color"}
See Property Reference for a list of properties you can use.
{SETPOS}
Syntax (Quattro Pro)
{SETPOS FilePosition}
Parameters
FilePosition
The number of bytes into a file to set the file pointer to.
{SETPOS} moves the file pointer of a file previously opened using {OPEN} to the value FilePosition. (See {GETPOS} for a discussion of the file pointer.) FilePosition refers to the offset, in number of bytes, where you want to position the file pointer. Therefore, the first position in the file is numbered 0, not 1.
If no file is open when {SETPOS} is encountered (or some other problem occurs), macro execution begins with the next command in the same cell as {SETPOS}. If {SETPOS} succeeds, the rest of that cell’s commands are ignored, and execution continues in the next row of the macro.
For an example using {SETPOS}, see {READ}.
{SETPROPERTY}
Syntax (Quattro Pro)
{SETPROPERTY Property,Setting}
Syntax (PerfectScript)
SetProperty (Property: String; Value: String)
Parameters
Property
String representing the property to change.
Setting
String representing the setting to apply to the property.
{SETPROPERTY} alters the properties of the active object (use {SELECTBLOCK}, {SELECTFLOAT}, or {SELECTOBJECT} to select objects).
To find Property, view the object and use the name of the control that sets the property. If the control name is more than one word, connect the words with underscores (_). See Property Reference for a list of properties you can use.
Examples
{SETPROPERTY “Text_Color”, “3"} sets the selected cells’ Text Color property to the fourth color on the notebook palette (the first color is 0).
The following macro selects the macro button named PushButton1 and renames it Button1.
name_float {SELECTFLOAT “PushButton1"}
{SETPROPERTY “Object_Name”,"Button1"}
{SHIFT}
Syntax (Quattro Pro)
{SHIFT+Key <Number>}
Parameters
Key
Keyboard macro command (PGUP, DOWN, and so on).
Number
Number of times to repeat the operation (optional).
{SHIFT} emulates holding down the Shift key while pressing a keystroke. It is handy for selecting cells, portions of a text box, or parts of a formula being edited.
You can combine {ALT}, {CTRL}, and {SHIFT}. For example, {CTRL+SHIFT+S} is equivalent to pressing Ctrl+Shift+S, which displays a list of styles to apply to the selected cells.
Examples
{SHIFT+DOWN 5} emulates pressing the Shift key while moving down five cells.
{EDIT}{END}{SHIFT+LEFT 3} edits the active cell, and selects the last three characters of the cell contents.
{Slide.Option}
|
Command equivalent |
Action |
|
{Slide.Effect Effect} |
Specifies the transition effect to use when displaying the next slide in a slide show; no equivalent command |
|
{Slide.Goto SlideName} |
Takes the active slide show directly to the slide SlideName; no equivalent command |
|
{Slide.Next} |
Advances the active slide show to the next slide; no equivalent command |
|
{Slide.Previous} |
Returns the active slide show to the previous slide; no equivalent command |
|
{Slide.Run SlideShowName} |
Tools | Slide Show | Play |
|
{Slide.Speed 0-15} |
Specifies the transition speed to use when displaying the next slide in a slide show; no equivalent command |
|
{Slide.Time Time} |
Specifies the time in seconds to display the next slide in a slide show; no equivalent command |
{Slide.Option} lets you build, edit, and present graphic slide show sequences. Effect, Speed, and Time are the same options offered in the Slide Effect property in the Light Table window. {Slide.Effect}, {Slide.Speed}, {Slide.Time}, {Slide.Goto}, {Slide.Next}, and {Slide.Previous} can be in the spreadsheet macro which started the slide show, in a spreadsheet macro run from a chart button, or attached directly to a QuickButton or custom dialog box button.
{SlideShowExpert}
{SlideShowExpert} is the command equivalent for Tools | Slide Show | New. The macro has no arguments. {SlideShowExpert} displays the first Slide Show Expert dialog box.
{SolveFor.Option}
|
Command equivalent |
Equivalent to Tools | Numeric Tools | Solve For... |
|
{SolveFor.Accuracy Value} |
...| Accuracy |
|
{SolveFor.Variable_Cell Cell} |
...| Variable Cell |
|
{SolveFor.Formula_Cell Cell} |
...| Formula Cell |
|
{SolveFor.Go} |
...| OK |
|
{SolveFor.Max_Iters Value} |
...| Max Iterations |
|
{SolveFor.Reset} |
Clears all Solve For settings; no equivalent menu command |
|
{SolveFor.Target_Value Value} |
...| Target Value |
{SolveFor.Option} is the command equivalent for Tools | Numeric Tools | Solve For. It solves goal-seeking problems with one variable.
{SolveFor.Formula_Cell} indicates the location of the formula to evaluate. {SolveFor.Target_Value} is the goal to reach, either a number or a cell containing a number. {SolveFor.Variable_Cell} indicates the formula variable (a referenced cell) that can change to reach the target value.
{SolveFor.Max_Iters} and {SolveFor.Accuracy} control how many calculation passes to make and how closely the solution must match the target value. Use {SolveFor.Go} after the other commands. {SolveFor.Reset} clears previous settings.
You can use {SolveFor?} or {SolveFor!} to display the Solve For dialog box. {SolveFor?} lets the user manipulate the dialog box, whereas {SolveFor!} relies on the macro to manipulate it.
{Sort.Option}
|
Command equivalent |
Equivalent to Tools | Sort... |
|
{Sort.BlankCellsFirst 0|1} Sort_BlankCellsFirst(BlankFirst?: 0|1) |
Determines whether to filter blank cells to the top or not during a sort. Equivalent to Tools | Sort | Options | Sort blank cells first. |
|
{Sort.Block Block} |
...| Cells |
|
{Sort.Data “Labels First”|"Numbers First"} |
Determines whether to sort Labels or Numbers first. Equivalent to Tools | Sort | Options | Sort Numbers Last. |
|
Sort_Data(Order?: Labels First!|Numbers First!) |
...| Data |
|
{Sort.Go} |
...| OK |
|
{Sort.Heading 0|1} Sort_Heading(Apply?: 0|1) |
Determines whether the first row (or column, depending on sorting based on rows or columns) is used as column headings, or is part of the sort block. Equivalent to Tools | Sort | Selection contains a heading. |
|
{Sort.Key_1-5 Block} |
...| Column | 1st - 5th |
|
{Sort.Labels “Character Code”|"Dictionary"} |
Determines whether text sorts in alphabetical order or according to character number (uppercase before lowercase, and so on). Not recordable. Retained for backward compatibility. |
|
{Sort.Order_1-5 Ascending|Descending} |
...| Ascending | 1st - 5th |
|
{Sort.PreviousSorts N} Sort_PreviousSorts(PreviousSorts?: N) |
Stores up to the last five sorts performed in current file. Equivalent to Tools | Sort | Previous Sorts. |
|
{Sort.Reset} |
...| Reset |
{Sort.Option} is equivalent to Tools | Sort, which sorts the entries in cells. To perform the sort, use {Sort.Go} after the other sort command equivalents.
You can use {Sort?} or {Sort!} to display the Data Sort dialog box. {Sort?} lets the user manipulate the dialog box, whereas {Sort!} relies on the macro to manipulate it.
Example
The following macro sorts the cells A3..C40 using two sort keys (columns A and C). The sort is in ascending order, and values in a column are placed in a group before labels in the column. The labels are sorted in dictionary order.
{Sort.Reset}
{Sort.Block A:A3..C40}
{Sort.Type Top to bottom}
{Sort.Heading 0}
{Sort.Key_1 A25}
{Sort.Key_2 C23}
{Sort.Order_1 Ascending}
{Sort.Order_2 Ascending}
{Sort.BlankCellsFirst No}
{Sort.Data Numbers First}
{Sort.PreviousSorts -1}
{Sort.Labels Dictionary}
{Sort.Go}
{Sort.Type “Left to Right” | “Top to Bottom”}
Sort_Type(Type?: Left to Right|Top to Bottom)
Determines to sort row-wise or column-wise. Equivalent to Tools | Sort | Options | Sort.
{SPEEDFILL}
{SPEEDFILL} is equivalent to the QuickFill button on the Toolbar. It fills the selected cells with sequential data, based on entries in the upper-left portion of the cells.
To create or modify a series used with QuickFill, use {SeriesManager.Option}.
{SpeedFormat}
Syntax (Quattro Pro)
{SpeedFormat FmtName, NumFmt?(0|1), Font?(0|1), Shading?(0|1), TextColor?(0|1), Align?(0|1), LineDraw?(0|1), AutoWidth?(0|1), ColHead?(0|1), ColTotal?(0|1), RowHead?(0|1), RowTotal?(0|1), <SubTotals?(0|1)>}
Syntax (PerfectScript)
SpeedFormat (FmtName: String; NumFmt?: Enumeration {Yes!; No!}; Font?: Enumeration {Yes!; No!}; Shading?: Enumeration {Yes!; No!}; TextColor?: Enumeration {Yes!; No!}; Align?: Enumeration {Yes!; No!}; LineDraw?: Enumeration {Yes!; No!}; AutoWidth?: Enumeration {Yes!; No!}; ColHead?: Enumeration {Yes!; No!}; ColTotal?: Enumeration {Yes!; No!}; RowHead?: Enumeration {Yes!; No!}; RowTotal?: Enumeration {Yes!; No!}; [SubTotals?: Enumeration {Yes!; No!}])
Parameters
FmtName
Name of the format to apply.
NumFmt?
1 to apply the numeric format; 0 otherwise.
Font?
1 to apply the font; 0 otherwise.
Shading?
1 to apply the shading; 0 otherwise.
TextColor?
1 to apply the text color; 0 otherwise.
Align?
1 to apply the alignment; 0 otherwise.
LineDraw?
1 to apply the line drawing; 0 otherwise.
AutoWidth?
1 to automatically size the columns; 0 otherwise.
ColHead
1 to apply the column heading format; 0 otherwise.
ColTotal?
1 to apply the column total format; 0 otherwise.
RowHead?
1 to apply the row heading format; 0 otherwise.
RowTotal?
1 to apply the row total format; 0 otherwise.
SubTotals?
1 to apply the subtotal format; 0 otherwise.
{SpeedFormat} applies the format FmtName to the selected cells; it is equivalent to Format | SpeedFormat or clicking the SpeedFormat button on the Toolbar. The arguments NumFmt? through SubTotals? each specify a part of the format to apply; use 1 to apply the part or 0 to omit the part.
You can use {SpeedFormat?} or {SpeedFormat!} to display the SpeedFormat dialog box. {SpeedFormat?} lets the user manipulate the dialog box, whereas {SpeedFormat!} relies on the macro to manipulate it.
Tip
To add or remove formats, use {SpeedFormat.Option}.
{SpeedFormat.Option}
|
Command Equivalent |
Equivalent to Format | SpeedFormat... |
|
{SpeedFormat.Add Name, ExampleBlock} |
...| Add |
|
{SpeedFormat.Remove Name} |
...| Delete |
{SpeedFormat.Option} adds formats to the SpeedFormat dialog box, or removes them. {SPEEDFORMAT.Add} lets you specify a name for the new format and the example cells that define the format. {SpeedFormat.Remove} deletes a specified format.
Examples
The following macro adds a format named “Strauss” to the SpeedFormat dialog box. The format is based on the example cells A:C10..H25.
{SpeedFormat.Add “Strauss”,A:C10..H25}
{SPEEDSUM}
Syntax (Quattro Pro)
{SPEEDSUM Block}
Syntax (PerfectScript)
SpeedSum ([Block: String])
Parameters
Block
Coordinates of the cells to sum, including blank cells for results.
{SPEEDSUM} is equivalent to selecting cells and choosing the QuickSum button from the Toolbar. Block includes rows and/or columns to sum, plus adjacent empty cells to hold the results; the default Block is the current selection.
{STEP}
{STEP} is equivalent to the Debug key, Shift+F2.
{STEPOFF}
{STEPOFF} exits Debug mode, which runs the macro in slow-motion for debugging. The macro then runs at normal speed.
See {STEPON} for more information.
{STEPON}
{STEPON} activates Debug mode, which runs macros one step at a time for debugging. When Corel Quattro Pro encounters a {STEPON} command, it pauses and waits for the user to press any key or click the mouse before it runs the next macro command and pauses again. Debug mode continues until {STEPOFF} is encountered or the macro ends.
{STEPON} is like using the Debug key (Shift+F2) to enter Debug mode, but you can embed it within a macro. The Debug key must be used before a macro begins executing.
Example
This example uses {STEPON} and {STEPOFF} to debug the last routine of a macro. Notice that the empty pairs of braces, placed at the beginning and end of the routine, make it easy to add {STEPON} and {STEPOFF} commands when there is a problem, because you can delete them when you want to debug, and insert them when you do not.
_clean_up {; Save notebook to disk and say goodbye}
{}{STEPON}
{FileSave}
{BRANCH _quit_msg}
_quit_msg {}{STEPOFF}
{QUIT}
{Subroutine}
Syntax (Quattro Pro)
{Subroutine <ArgumentList>}
Parameters
Subroutine
Name of the subroutine being called (which can be a cell name or a cell address).
ArgumentList
List of one or more arguments to be passed to the specified subroutine (optional).
{Subroutine} calls the subroutine of the specified name, passing along any arguments given in ArgumentList. (Those arguments are then defined within the subroutine using the {DEFINE} command.)
Any macro can be a subroutine. The macro commands in the subroutine run until {RETURN}, a blank cell, or a value is encountered. Then Corel Quattro Pro returns control to the calling routine, continuing execution with the macro command in the next cell. If the subroutine ends with {QUIT}, both the subroutine and the calling macro(s) end.
Example
The following example invokes a subroutine that forces the user to verify printing twice before it begins.
_print {GETLABEL “Do you want to print this (Y/N)?”,ans_cell}
{IF @UPPER(ans_cell)="Y"}{_chk_twice}
{HOME}
_chk_twice {; Double-check the print request}
{GETLABEL “Are you certain (Y/N)?”,ans_cell}
{IF @UPPER(ans_cell)="N"} {RETURN}
{GETLABEL “Ready to print now (Y/N)?”,ans_cell}
{IF @UPPER(ans_cell)="Y"}{Print.DoPrint}
{RETURN}
ans_cell Y