{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.
Example
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}
Parameters
Condition A logical expression (or the address of a cell containing a label, value, or expression)
{IFAUTOOBJ}
Syntax
{IFAUTOOBJ ObjectExpression}
Description
{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.
ObjectExpression Object expression resulting from an OLE automation object
{IFKEY}
Syntax
{IFKEY String}
Description
{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.
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
{IMFORMAT}
Syntax
{IMFORMAT Format}
PerfectScript Syntax
IMFORMAT (Format:Numeric)
Description
{IMFORMAT} specifies how complex numbers display in the active notebook, and returns a label showing the selected format.
Example
{IMFORMAT 1} returns "x+iy"
{IMFORMAT 2} returns "x+jy"
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
{ImportGraphic}
Syntax
{ImportGraphic Filename}
PerfectScript Syntax
ImportGraphic (Filename:String)
Description
{ImportGraphic} imports graphics files into a chart window.
You can use {ImportGraphic?} or {ImportGraphic!} to display the Insert Image dialog box. {ImportGraphic?} lets you manipulate the dialog box, whereas {ImportImage!} relies on the macro to manipulate it.
Parameters
Filename Name of the bitmap or other graphics file to import
{ImportGraphic.Clipart}
Syntax
{ImportGraphic.Clipart}
PerfectScript Syntax
ImportGraphic Clipart()
Description
Equivalent to Insert Graphics Clipart
{INDICATE}
Syntax
{INDICATE String}
PerfectScript Syntax
Indicate ([String:String])
Description
{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.
Parameters
String Any seven-character string
{InitApp}
Syntax
{InitApp}
PerfectScript Syntax
InitApp ()
Description
Starts Quattro Pro.
{INITIATE}
Syntax
{INITIATE AppName,Topic,ChannelLoc}
Description
{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}.
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
{INS}, {INSERT}, {INSOFF}, and {INSON}
Description
{INS} and {INSERT} toggle the Ins key on or off. {INSOFF} is equivalent to Ins off, and {INSON} to Ins on.
{InsertBreak}
Syntax
{InsertBreak}
PerfectScript Syntax
InsertBreak ()
Description
Inserts a new line and a hard page break into notebook print blocks at the current selector location.
{InsertObject} 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 you 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"}
Parameters 1
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
Parameters 2
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
{InsertPageBreak.Create} inserts a page break above Row# and to left of Column#.
{InsertPageBreak.Delete} deletes the current PageBreak above Row# and to left of Column#.
Options
{InsertPageBreak.Create Row#, Column#} Creates a hard page break to start a new page
{InsertPageBreak.Delete Row#, Column#} Deletes a hard page break
{INSPECT}
Description
{INSPECT} is equivalent to the Inspect key, F12. It displays an Object Inspector for the current object.
{Invert}
Syntax
{Invert.Option}
PerfectScript Syntax
Invert_Destination (Block:String)
Invert_Go ()
Invert_Source (Block:String)
Description
{Invert} 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 you manipulate the dialog box, whereas {Invert!} relies on the macro to manipulate it.
Options
{Invert.Destination Block} Specifies the upper-left cell of the area where you want to write the inverted matrix
{Invert.Go} Inverts the selected matrix
{Invert.Source Block} Specifies the matrix you want to invert