Chapter 4

Macros

Corel® Quattro® Pro 8 Product Commands
H - M


{HELP}

{HELP} is equivalent to the Help key, F1. It displays a help topic.


HideErrorMessage ()

This PerfectScript token suppresses Quattro Pro error messages trapped with the PerfectScript OnError () token.


{HISTOGRAM}

Syntax (Quattro Pro)

{HISTOGRAM InBlock, OutBlock, <BinBlock>, <Pareto>, <Cum>}

Syntax (PerfectScript)

HISTOGRAM (InBlock: String; OutBlock: String; [BinBlock: String]; [Pareto?: Enumeration {Yes!; No!}]; [Cum?: Enumeration {Yes!; No!}])

Parameters

InBlock

Input cells containing one or more columns or rows of numeric values; the cells must not contain labels.

OutBlock

Upper left cell of the output cells.

BinBlock

Set of numbers defining the bin ranges; BinBlock numbers must be in ascending order; if BinBlock is omitted, bins are distributed evenly from the minimum to the maximum values in InBlock, with the number of bins equal to the square root of the number of values in InBlock.

Pareto

1 to arrange the output table in both descending frequency order and ascending BinBlock order; 0 to arrange the output table in ascending BinBlock order; the default is 0.

Cum

Flag indicating whether to generate a column in OutBlock showing cumulative percentages: yes (1) or no (0); the default is 0.

{HISTOGRAM} calculates the probability and cumulative distributions for a sample population, based on a series of bins. {HISTOGRAM} is equivalent to the Histogram analysis tool.


{HLINE}

Syntax (Quattro Pro)

{HLINE Distance}

Syntax (PerfectScript)

HLine (Distance: Numeric)

Parameters

Distance

Distance in columns to scroll the active notebook horizontally.

{HLINE} scrolls the active notebook horizontally by Distance columns. If the number is positive, it scrolls right; if negative, it scrolls left. {HLINE} does not move the selector; only the view of the notebook is altered, just as if the scroll bars were used. Use the commands {RIGHT} or {LEFT} to move the selector horizontally.

Examples

{HLINE 10} scrolls the display 10 columns to the right.

{HLINE -5} scrolls the display 5 columns to the left.


{HOME}

{HOME} is equivalent to the Home key.


{HPAGE}

Syntax (Quattro Pro)

{HPAGE Distance}

Syntax (PerfectScript)

HPage (Distance: Numeric)

Parameters

Distance

Distance in screens to scroll the active notebook horizontally.

{HPAGE} scrolls the active notebook horizontally by Distance screens. If the number is positive, it scrolls right; if negative, it scrolls left. {HPAGE} does not move the selector; only the view of the notebook is altered. Use {BIGRIGHT} or {BIGLEFT} to move the selector horizontally.


{IF}

Syntax (Quattro Pro)

{IF Condition}

Syntax (PerfectScript)

Look in the command browser under PerfectScript for the equivalent PerfectScript token.

Parameters

Condition

A logical expression (or the address of a cell containing a label, value, or expression).

{IF} operates like @IF. {IF} evaluates Condition; if it is numeric and nonzero, it is considered to be TRUE and macro execution continues in the same cell; if Condition is anything else, it is considered FALSE, and macro execution continues in the cell directly below the {IF} command. Unlike @IF, {IF} commands cannot be nested within each other.

Examples

The following example says, in English, “If the value stored in gpa is greater than 0.59, run the macro _pass_student; otherwise, run the macro _fail_student.”

\F {IF gpa>.59}{BRANCH _pass_student}

{BRANCH _fail_student}

If you do not want both the true and false clauses executing, be sure to include {BRANCH} or {QUIT} in the same cell as {IF}, as shown in both examples. The following example uses a string of {IF} commands to award a grade based on a test result:

\G {IF result>=.90}{BRANCH _give_a}

{IF result>=.80}{BRANCH _give_b}

{IF result>=.70}{BRANCH _give_c}

{IF result>=.56}{BRANCH _give_d}

{BRANCH _give_f}


{IFAUTOOBJ}

Syntax (Quattro Pro)

{IFAUTOOBJ ObjectExpression}

Syntax (PerfectScript)

IsAutoObj (Object: string)

Parameters

ObjectExpression

Object expression resulting from an OLE automation object.

{IFAUTOOBJ} is like {IF}, but instead evaulating a logical condition it expects the object expression resulting from an OLE automation object. If ObjectExpression is true, {IFAUTOOBJ} runs the macro in the same cell; otherwise, it skips to the next cell.

Examples

{ASSIGN OLE2App, GetObject(“DispCalc.Application”)}

{IFAUTOOBJ OLE2App}{BRANCH A10}

{ASSIGN OLE2App, CreateObject(“DispCalc.Application”)}

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


{IFKEY}

Syntax (Quattro Pro)

{IFKEY String}

Parameters

String

Any macro name for a key (such as PGUP, END, GRAPH, and so on) without braces, or a string that returns a key macro name without braces.

{IFKEY} is like {IF}, but runs the next macro command in the current cell if String is the name of a key macro command (such as {ESC} or {HOME}). Do not enclose the name stored in String in braces. For example, {IFKEY “HOME”} evaluates as true because HOME is the name of a macro command; {IFKEY “A”} evaluates as false because it is not the name of a macro command. String can be a string or a text formula.


{IMFORMAT}

Syntax (Quattro Pro)

{IMFORMAT Format}

Syntax (PerfectScript)

IMFORMAT (Format: Numeric)

Parameters

Format

Flag indicating what suffix and format to use for imaginary coefficient of complex number; the default is 1; 1 = x + yi, 2 = x + yj, 3 = x + iy, 4 = x + jy.

{IMFORMAT} specifies how complex numbers display in the active notebook, and returns a label showing the selected format.

Examples

{IMFORMAT 1} returns “x+iy”

{IMFORMAT 2} returns “x+jy”


{ImportGraphic}

Syntax (Quattro Pro)

{ImportGraphic Filename}

Syntax (PerfectScript)

ImportGraphic (Filename: String)

Parameters

Filename

Name of the bitmap or other graphics file to import.

{ImportGraphic} is the command equivalent for Insert | Graphics | Clipart. It imports graphics files into a chart window.

You can use {ImportGraphic?} or {ImportGraphic!} to display the Insert Image dialog box. {ImportGraphic?} lets the user manipulate the dialog box, whereas {ImportImage!} relies on the macro to manipulate it.


{INDICATE}

Syntax (Quattro Pro)

{INDICATE String}

Syntax (PerfectScript)

Indicate ([String: String])

Parameters

String

Any seven-character string.

{INDICATE} sets the mode indicator in the lower right corner of the screen to read whatever is given as String. If String is longer than seven characters, only the first seven are used. To restore the mode indicator to its normal setting, use {INDICATE} with no arguments. To hide the mode indicator, use {INDICATE “”}.

Example

{INDICATE “Save!”} changes the indicator to read Save!.

{INDICATE “ Go! ”} changes the indicator to read Go! with a space preceding and following it.

{INDICATE E14} changes the indicator to E14 because cell references are ignored.

{INDICATE} restores the normal mode indicator.


{INITIATE}

Syntax (Quattro Pro)

{INITIATE AppName,Topic,ChannelLoc}

Parameters

AppName

Name of the Windows application to communicate with.

Topic

Name of the file within the Windows application to communicate with.

ChannelLoc

Cell to contain the Channel ID number of the conversation if communication succeeds.

{INITIATE} requests a channel of communication with the application AppName. This application must support Dynamic Data Exchange (DDE). If the request succeeds, the identification number of the conversation (DDE communication) is stored in the cell ChannelLoc. Topic can be a Corel WordPerfect document, an Excel spreadsheet, an ObjectVision form, or other DDE server-application file. If there is no specific file to communicate with in the other application, you can set Topic to System.

AppName, Topic, or both can be an empty string (“”). The empty string works as a wildcard to display a list of possible conversations to choose from.

You can use {INITIATE} multiple times with the same application; if you do this, use a different ChannelLoc for each conversation. Once a channel opens, you can use {REQUEST}, {EXECUTE}, or {POKE} to communicate with the application.

When the DDE conversation is complete, use {TERMINATE} to end it. See {EXECUTE} for an example of {INITIATE}.


DDE commands

Syntax (PerfectScript)

Look in the command browser under PerfectScript for documentation on DDE tokens (DDEExecute, DDEExecuteExt, DDEInitiate, DDEPoke, DDERequest, DDETerminate, and DDETerminateAll).


{INS}, {INSERT}, {INSOFF}, and {INSON}

{INS} and {INSERT} toggle the Ins key on or off. {INSOFF} is equivalent to Ins off, and {INSON} to Ins on.


{InsertObject}

Syntax (Quattro Pro)

{InsertObject Filename, <DisplayAsIcon?(0|1)>, <Linked?(0|1)>}

Syntax (PerfectScript)

InsertObject (ObjectTypeOrFilename: String; [DisplayAsIcon?: Enumeration {Yes!; No!}]; [Linked?: Enumeration {Yes!; No!}])

Parameters

Filename

File that you want to link/embed as an object.

DisplayAsIcon

Whether to display the object as an icon; 0 to show the object as it looks in the server application; 1 to display the object as an icon.

Linked?

Whether to link to the file; 0 to not link; 1 to link; the default is 0.

{InsertObject ObjectType, <DisplayAsIcon?(0|1)>}

ObjectType

Type of object to insert (the name of an OLE server).

DisplayAsIcon

Whether to display the object as an icon; 0 to show the object as it looks in the server application; 1 to display the object as an icon.

{InsertObject} is equivalent to Insert | Object, which inserts an OLE object into the active notebook without using the Clipboard.

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

Example

This macro inserts a picture created in Paintbrush into the active notebook.

{InsertObject “Paintbrush Picture”}


{InsertPageBreak.Create}

Syntax (Quattro Pro)

{InsertPageBreak.Create Row#; Column#}

Syntax (PerfectScript)

InsertPageBreak_Create(Row: Row#; Column: Column#)

Row#

Row number.

Column#

Column number.

Inserts a page break above row# and to left of column#.  Equivalent to Insert | Page Break | Create.


{InsertPageBreak.Delete}

Syntax (Quattro Pro)

{InsertPageBreak.Delete Row#; Column#}

Syntax (PerfectScript)

InsertPageBreak_Delete(Row: Row#; Column: Column#)

Row#

Row number.

Column#

Column number.

Deletes the current page break above row# and to left of column#. Equivalent to Insert | Page Break | Delete.


{INSPECT}

{INSPECT} is equivalent to the Inspect key, F12. It displays an Object Inspector for the current object.


{Invert.Option}

Command equivalent

Equivalent to Tools | Numeric Tools | ...

{Invert.Destination Block}

...Invert | Destination

{Invert.Go}

...Invert | OK

{Invert.Source Block}

...Invert | Source

Syntax (PerfectScript)

Invert_Destination (Block: string)

Invert_Go ()

Invert_Source (Block: string)

{Invert.Option} is the command equivalent for Tools | Numeric Tools | Invert. It inverts a square matrix (indicated by {Invert.Source Block}) and stores the invert matrix in other cells (indicated by {Invert.Destination Block}). Use {Invert.Go} after the other two matrix-inversion command equivalents to complete the operation.

You can use this command equivalent with {Multiply.Option} to solve sets of linear equations.

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


{LEFT} and {L}

Syntax (Quattro Pro)

{LEFT <Number>} or {L <Number>}

Parameters

Number

Any positive integer (optional).

{LEFT} and {L} are equivalent to the Left Arrow key. The optional argument Number moves the selector the corresponding number of columns to the left. You can use cell references or cell names as arguments.

Examples

{L}{L}{L} moves the selector left three columns.

{LEFT 6} moves the selector six columns to the left.

{LEFT D9} moves to the left the number of columns specified in cell D9.

{LEFT count} moves to the left the number of columns specified in the first cell of the cells named count.


{LET}

Syntax (Quattro Pro)

{LET Location,Value<:Type>}

Syntax (PerfectScript)

Let (Cell: String; Value: Any)

Parameters

Location

Cell in which to store the specified value.

Value

Numeric or string value to be stored in Location.

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).

With {LET}, you can enter a value into Location without moving to it. {LET} enters the value or string you specify with Value in Location.

You can use the optional Type argument to specify whether to store Value as an actual number or as a string. If you specify a formula as a string, the formula is written into Location as a string, not the resulting value. For example, {LET A1,B3*23:string} stores the formula B3*23 as a label in cell A1. If you omit Type, Corel Quattro Pro tries to store the value as a numeric value; if unsuccessful, it stores the value as a string.

Location must be a cell address or cell name; you can use functions such as @CELLPOINTER as a Location in {LET} commands only if they return a cell address or cell name.

Tip

Value cannot be an @ARRAY formula. {LET} does not not enter array values. Use {PUTCELL} or {PUTCELL2} to enter array values.

You can use {LET} to invoke add-in @functions or macros contained in DLLs. Specify the add-in as Value, using this syntax for functions:

@dllname.functionname(functionargument1, functionargument2, ...)

For example, this statement calls the @function MEDIAN, included in DLL Stats, with a five-item list as an argument and stores the result in Location G6:

{LET G6,@Stats.MEDIAN(2,4,6,8,10)}

The macro syntax is identical:

@dllname.macroname(macroargument1, macroargument2, ...)

Examples

{LET(@CELLPOINTER(“address”)),99} makes the value of the active cell 99.

The examples below assume A1 contains the label ‘Dear, A2 contains the label ‘Sir, and A3 contains the value 25. The result is shown to the right of each {LET}.

\M {LET F1,25} 25

{LET F2,A3} 25

{LET F3,+A1&""&A2} Dear Sir

{LET F4,+A1&""&A2:value} Dear Sir

{LET F5,+A1&""&A2:string} +A1&""&A2

{LET F6,+A1&A3} ERR (because A3 is a value)


{Links.Option}

Command equivalent

Equivalent to Edit | Links | ...

{Links.Change OldName, NewName}

| Change Link

{Links.Delete LinkName|*} (* = all links)

| Delete Links

{Links.Open LinkName|*} (* = all links)

| Open Links

{Links.Refresh LinkName|*} (* = all links)

| Refresh Links

{Links.Option} is equivalent to commands on the Edit | Links menu, which refresh, change, or delete links in the active notebook.

LinkName is the name of the file being linked to. You can set LinkName to * to affect all links in the active notebook. If LinkName is omitted, the dialog box that normally performs the operation appears (and is under macro control; use {PAUSEMACRO} to pass control to the user).

Example

{Links.Refresh *} refreshes all links in the active notebook.

The following macro displays the Open Links dialog box and lets the user select the name of a linked notebook to open.

{Links.Open}

{PAUSEMACRO}


{LOOK}

Syntax (Quattro Pro)

{LOOK Location}

Parameters

Location

A cell in which to store a typed character.

When Corel Quattro Pro runs a macro, it does not respond to keystrokes the user enters (except Ctrl+Break). If the user presses keys during macro execution, those keystrokes are stored in the computer’s type-ahead buffer and are responded to when the macro pauses for input or ends.

{LOOK} checks this type-ahead buffer for stored keystrokes. If any are found, it places the first keystroke the user typed in Location as a macro command.

{LOOK} can be used while processing long macros to check for a keystroke that might signal the user wants to quit (see the next example).

{LOOK} does not remove the keystroke from the buffer. If a macro does nothing other than {LOOK}, the key still passes to Corel Quattro Pro when the macro ends. To remove pending keystrokes from the buffer, use {GET}.

Example

In the following example, the macro gives you 15 seconds to choose the next menu choice. If you do not, you must reenter the password. Important: Type the line to the right of _check_it with no hard returns until after {BRANCH _password}, then press Enter to insert it into one cell (the macro commands from {LOOK keystroke} to {BRANCH -password} are shown here on separate lines for readability).

\M {QGOTO}msg_area~

A. Add name{DOWN}

B. Edit name{DOWN}

C. Delete name{DOWN}

Enter choice: {RIGHT}

{}

{LET start_time,@NOW}

_check_it {LOOK keystroke}

{IF keystroke=""}

{IF @NOW>start_time + @TIME(0,0,15)}

{BRANCH _password}

{IF keystroke<>""}{BRANCH _take_action}

{BEEP 4}

{BRANCH _check_it}

_password {; get password from user}

{GETLABEL “Enter password : ”,pass}

_take_action {}

{BEEP 3}

start_time

keystroke

pass

msg_area


{MACROS}

Syntax (PerfectScript)

Macros ()

{MACROS} is equivalent to the Macros key, Shift+F3, which displays a menu of macro commands to type into the input line.


{MapExpert}

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


{MapNew}

Syntax (Quattro Pro)

{MapNew Name,<UseBlock>}

Syntax (PerfectScript)

MapCreate (MapName: string; [SpeedMode?: enumeration {Yes!; No!}])

Parameters

Name

Name of the new map.

UseBlock

1 to create the map using data in the current cells.

{MapNew} is the command equivalent for Insert | Graphics | Map.


{MARK}

{MARK} is equivalent to the Select key, Shift+F7, which lets you begin selection of cells.


{MCORREL}

Syntax (Quattro Pro)

{MCORREL InBlock, OutBlock, <Grouped>, <Labels>}

Syntax (PerfectScript)

MCORREL (InBlock: String; OutBlock: String; [Grouped: String]; [Labels?: Enumeration {Yes!; No!}])

Parameters

InBlock

Input cells containing two or more sets of numeric data arranged in columns or rows.

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.

{MCORREL} computes the correlation matrix between two or more data sets. {MCORREL} is equivalent to the Correlation analysis tool.


{MCOVAR}

Syntax (Quattro Pro)

{MCOVAR InBlock, OutBlock, <Grouped>, <Labels>}

Syntax (PerfectScript)

MCOVAR (InBlock: String; OutBlock: String; [Grouped: String]; [Labels?: Enumeration {Yes!; No!}])

Parameters

InBlock

Input cells containing two or more sets of numeric data arranged in columns or rows.

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.

{MCOVAR} returns the covariance matrix between two or more data sets. {MCOVAR} is equivalent to the Covariance analysis tool.


{MENU}

{MENU} is equivalent to the Menu key (Alt or F10). This command moves the selector to the menu bar and highlights the first menu.


{MENUBRANCH}

Syntax (Quattro Pro)

{MENUBRANCH Location}

Parameters

Location

Cells containing menu cells.

{MENUBRANCH} pauses macro execution to display the custom pop-up menu stored at Location. After the user chooses an item from the menu, macro execution continues with the cell below the description of the menu choice. Often this is a {BRANCH}. The only exception is if the user presses Esc, or clicks outside the menu; in this case, the macro continues in the {MENUBRANCH} cell.

With the exception of the Esc key, a custom pop-up menu acts the same as one of Corel Quattro Pro’s own menus. Users can press the arrow keys to look at each item, and can choose a menu item by either pressing Enter while highlighting it, pressing the first letter of the menu item’s name, or choosing it with the mouse.

Example

The following macro displays a custom menu that offers the user three choices. If the user presses Esc, the menu is redisplayed with {BRANCH \F}.

quit_menu Continue Return Quit

Continue macro Return to Ready Leave Corel Quattro Pro

{BRANCH \F} {BRANCH _continue} {MENUBRANCH sure}

sure No Yes

Stay in Corel Quattro Pro Return to DOS

{BRANCH \F} {FileExit}

\F {MENUBRANCH quit_menu}

{BRANCH \F}

_continue


{MENUCALL}

Syntax (Quattro Pro)

{MENUCALL Location}

Parameters

Location

Cells containing a custom Corel Quattro Pro menu.

{MENUCALL} pauses macro execution and displays the custom pop-up menu stored at Location. It treats the called menu as a subroutine. After the user chooses an item from the menu, macro execution continues in the cell containing {MENUCALL}.

See {ADDMENU} and {ADDMENUITEM} for information on adding menus or menu commands to the Corel Quattro Pro menu bar.

Example

The following macro uses two consecutive custom menus to let the user change search criteria for a database. It then copies records that meet the criteria to the output cells and branches to another macro to print the output cells as labels. The cell name stat references the cell in the criteria table containing A in the example; pay references the cell in the criteria table containing F.

m_status Active Retired

Active Members Retired Members

{LET stat, “A”} {LET stat, “R”}

m_paid Paid Unpaid

Dues are paid Dues are unpaid

{LET pay, “T”} {LET pay, “F”}

\M {;Choose members for label print}

{MENUCALL m_status}

{MENUCALL m_paid}

{Query.Extract}

{BRANCH print_labels}

Database Criteria Cells:

STATUS PAID

A F


{MESSAGE}

Syntax (Quattro Pro)

{MESSAGE Block,Left,Top,Time}

Parameters

Block

Cell name or coordinates of the text and/or floating object to display in the message box.

Left

Screen column number (counting from 0) where the top left corner of the box should appear.

Top

Screen line number (counting from 0) where the top left corner of the box should appear.

Time

Corel Quattro Pro time serial number.

{MESSAGE} displays the contents of Block in a dialog box until Time is reached; Time is a standard Corel Quattro Pro date/time serial number (decimal portion). The window appears at the screen (not the notebook) coordinates Left,Top.

The message box contains a “snapshot” of current Block contents, including all fonts, colors, and other formatting. If Block includes a floating chart, bitmap, or macro button, its image displays in the message cells.

The height and width of the message box depend on the defined width and depth of Block. If text overflows the cell it is typed into, be sure to include adjoining cells in Block. Otherwise, the message will be truncated at the edge of Block.

The message box always appears over the frontmost window, even if that window is not a notebook (for example, a chart window).

If you enter 0 for Time, Corel Quattro Pro displays the box until the user presses any key. (You can use {GRAPHCHAR} to test for which key is pressed.)

Example

This example displays a message box for 15 seconds and then displays another box indefinitely. If the user presses Y, the macro closes the notebook without saving it. If the user, presses N (which is returned in the cells the_key), the user removes the second message box.

the_key

\A {MESSAGE msg1,15,5,+@NOW+@TIME(0,0,15)}

_warning {MESSAGE msg2,15,5,0}

{GRAPHCHAR the_key}

{IF @UPPER(the_key)="Y"}{BRANCH _lose_data}

msg1 Warning! You may lose data if you continue.

msg2 Are you sure you want to continue?

Press Y to continue or any other key to cancel...

_lose_data {FileClose 0}


{MOVEAVG}

Syntax (Quattro Pro)

{MOVEAVG InBlock, OutBlock, <Interval>, <StdErrs>}

Syntax (PerfectScript)

MOVEAVG (InBlock: String; OutBlock: String; Interval: Numeric; [StdErrs?: Enumeration {Yes!; No!}])

Parameters

InBlock

Input cells containing a single column or row with at least four numeric values; the cells must not contain labels.

OutBlock

Upper left cell of the output cells.

Interval

Number of values to include in the moving average; the default is 3.

StdErrs

Flag indicating whether to include standard error values in the OutBlock: yes (1) or no (0); the default is 0.

{MOVEAVG} returns a moving average for a specified Interval based on the values for the preceding periods in InBlock. {MOVEAVG} is equivalent to the Moving Average analysis tool.


{MOVETO}

Syntax (Quattro Pro)

{MOVETO x,y}

Syntax (PerfectScript)

MoveTo (x: Numeric; y: Numeric)

Parameters

x,y

Position to move the currently selected object(s) to in pixels.

{MOVETO} moves all selected objects in the active window (dialog, chart, or Objects sheet window) to the position specified by x,y. Since {MOVETO} is context-sensitive, you can use it to move controls in a dialog window or drawings in a chart window. It also moves chart icons on the Objects sheet. (Use {FLOATMOVE} to move floating objects in a notebook window.)

The coordinates x and y represent where to move the upper left corner of the object(s). Object size does not change.


{MTGAMT}

Syntax (Quattro Pro)

{MTGAMT <OutBlock>, <Rate>, <Term>, <OrigBal>, <EndBal>, <LastYear>}

Syntax (PerfectScript)

MTGAMT ([OutBlock: String]; [Rate: Numeric]; [Term: Numeric]; [OrigBal: Numeric]; [EndBal: Numeric]; [LastYear: Numeric])

Parameters

OutBlock

Upper left cell of the output cells.

Rate

Yearly interest rate; the default is 0.12.

Term

Number of years in the loan; the default is 30 years; can be a fractional value to designate months (for example, 3+5/12).

OrigBal

Original loan balance; the default is $100,000.

EndBal

Balance at loan completion; the default is $0.

LastYear

Last year through which the amortization period is generated; the default is equal to Term (the end of the loan); can be a fractional value to designate months (for example, 3+5/12).

{MTGAMT} generates an amortization schedule for a mortgage. {MTGAMT} is equivalent to the Amortization Schedule analysis tool.


{MTGREFI}

Syntax (Quattro Pro)

{MTGREFI <OutBlock>, <CurrBal>, <CurrRate>, <RemTerm>, <CandPctFees>, <CandRate>}

Syntax (PerfectScript)

MTGREFI (OutBlock: String; [CurrBal: Numeric]; [CurrRate: Numeric]; [RemTerm: Numeric]; [CandPctFees: Numeric]; [CandRate: Numeric])

Parameters


{Multiply.Option}

Command equivalent

Equivalent to Tools | Numeric Tools | ...

{Multiply.Destination Block}

...Multiply | Destination

{Multiply.Go}

... | OK

{Multiply.Matrix_1 Block}

...Multiply | Matrix 1

{Multiply.Matrix_2 Block}

...Multiply | Matrix 2

{Multiply.Option} is the command equivalent for Tools | Numeric Tools | Multiply. It multiplies one matrix ({Multiply.Matrix_1 Block}) by another ({Multiply.Matrix_2 Block}) and stores the product in other cells ({Multiply.Destination Block}). Use {Multiply.Go} after the other matrix-multiplication command equivalents to complete the operation.

You can use this command equivalent with {Invert.Option} to solve sets of linear equations.

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

Example

This macro multiplies cells C2..D6 by cells C18..G19 and stores the results in the cells with upper-left cell F1.

{Multiply.Matrix_1 A:C2..D6}

{Multiply.Matrix_2 A:C18..G19}

{Multiply.Destination A:F1}

{Multiply.Go}

OutBlock

Upper left cell of the output cells.

CurrBal

Remaining principal on the current loan.

CurrRate

Annual interest rate on the current loan.

RemTerm

Remaining term on the current loan.

CandPctFees

Percentage fees (“points”) for the candidate loan.

CandRate

Annual interest rate for the candidate loan.

{MTGREFI} generates a table of information relating to refinancing a mortgage. {MTGREFI} is equivalent to the Mortgage Refinancing analysis tool.