{GET} pauses macro execution, accepts one keystroke (no carriage return is necessary), and stores the keystroke as a macro command in Location. It then continues macro execution. Any Quattro Pro keystroke can be recorded with {GET} except Shift+F2, Pause, Caps Lock, Num Lock, and Scroll Lock. Unlike { ? }, the keystroke is not passed to Quattro Pro.
{GET} is useful for creating macros that run in the background while you work. It can detect each key, and restrict the actions you perform. You can use {LOOK} with {GET} to check the typeahead buffer for user response.
Example
The following example asks you if you want to continue.
\F {RIGHT 10}
{; display msg_area in top left of screen}
{GOTO}msg_area~
_again Press Y to continue...~
{GET keystroke}
{IF keystroke<>"Y"}{BEEP2}{HOME}{QUIT}
{BEEP 4}{BRANCH _again}
keystroke
msg_area Press Y to continue...
Parameters
Location Cell in which to store the keystroke you entered.
{GetCellFormula}
Syntax
{GetCellFormula Cell}
PerfectScript Syntax
GetCellFormula (Cell: String)
Description
Returns the unparsed form of a referenced formula. If the cell is a number, it will return the numeric text. If the cell is a label, it will be prefixed by the prefix char (', ", or ^). If the cell is a formula, it will return the formula itself.
Parameter
Cell The cell
{GetCellValue}
Syntax
{GetCellValue Cell}
PerfectScript Syntax
GetCellValue (Cell: String)
Description
Retrieves the cell contents as it is displayed, not as its value. If the cell contains a formula, it returns the result of the formula, including its numeric format.
{GETDIRECTORYCONTENTS} enters an alphabetized list of file names (determined by the path and DOS wildcard specified by Path) into Block; if Path is not included, {GETDIRECTORYCONTENTS} lists all the files in the current directory. Path must contain a DOS wildcard like *.BAT or *.*.
Example
{GETDIRECTORYCONTENTS A2,"C:\*.*"} fills column A (starting at row 2) with a list of the files in the root directory of drive C.
{GETDIRECTORYCONTENTS A2..C7,"C:\COREL\SUITE8\*.*"} fills the cells A2..C7 with a list of the files in the Quattro Pro directory on drive C. The first filename is stored in A2, the second in B2, and so on. If more than 18 files are found, the cells are only filled with the first 18.
{GETDIRECTORYCONTENTS C7,"C:\COREL\SUITE8\SAMPLES\*.W??"} fills column C (starting at row 7) with a list of the files in the COREL\SUITE8\SAMPLES directory on drive C that have file extensions beginning with W.
Parameters
Block Cells to enter list of files into
Path Path and wildcard specifying the list (optional)
Note
¿ If Block is one cell, {GETDIRECTORYCONTENTS} overwrites any information beneath the cell (if it finds more than one file). To restrict the file names to specific cells, set Block to more than one cell.
{GETLABEL}
Syntax
{GETLABEL Prompt,Location}
Description
{GETLABEL} pauses macro execution, displays Prompt in a dialog box, and accepts keystrokes until you choose OK or press Enter. At that time, Quattro Pro stores the characters typed as a label in Location. Unlike {GET}, it does not accept Quattro Pro's special keys (for example, Home).
Prompt can be a literal string, such as "Enter date:,"or a text formula such as +B6 (which contains a label). The prompt string itself can be up to 70 characters long, and is truncated if longer. The response can be as long as 160.
If {PANELOFF} is in effect, {GETLABEL} ignores it, letting you view and update the menus, status line, and input line as you type. Once input is completed (indicated by Enter or choosing OK), then these portions of the display are turned off again.
Example
This example displays the label in B6 as the dialog box prompt, and then stores the result in cell D1:
{GETLABEL +B6,D1}
The following example stores your last name in the cell named last_cell:
\F {GETLABEL "Enter your last name:",last_cell}
last_cell
Parameters
Prompt String displayed to you as a prompt
Location Cell in which to store your response; when {GETLABEL} is used in OLE automation, Location can also be a named variable
{GETNUMBER}
Syntax
{GETNUMBER Prompt,Location}
Description
{GETNUMBER} is like {GETLABEL}, but accepts only a numeric value, a formula resulting in a numeric value, or the cell address or cell name of a cell returning a value. If a text value is input, ERR is entered in the cell. The prompt can be up to 70 characters long, and the response can be as long as 160 characters.
Example
The following example stores your age in the cell named age_cell. If you do not enter a number, which the macro detects by checking to see whether age_cell contains ERR, it prompts again.
\F {GETNUMBER "Enter your age:",age_cell}
{IF @ISERR(age_cell)}{BRANCH \F}
age_cell
Parameters
Prompt String displayed to youas a prompt
Location Cell in which to store the user's response; when {GETNUMBER} is used in OLE automation, Location can also be a named variable
{GetObjectPageContents} stores a list of the objects contained on the Object Page on the Quattro Pro desktop in Block. Objects are charts, dialogs, maps, and slideshows.
Parameters
Block Cells in which to store object names
ObjectType All (default), Dialog, Chart, Map, and SlideShow.
Tip
¿ If Block is one cell, {GetObjectPageContents} overwrites any information beneath the cell if it finds more than one open window. To restrict the window names to specific cells, set Block to more than one cell.
{GETOBJECTPROPERTY} lets you view objects in Quattro Pro without using the mouse, including objects normally not selectable (like the application title bar). You can also study selectable objects, such as blocks and annotations, with {GETPROPERTY}. See {SETOBJECTPROPERTY} for the syntax of Object.Property.
Example
{GETOBJECTPROPERTY A23,"Active_Notebook.Zoom_Factor"} stores the Zoom Factor property's current setting in cell A23.
{GETOBJECTPROPERTY B42,"/File/Exit.Enabled"} stores whether Exit is operational or not in the cell B42.
Parameters
Cell Cell in which to store the property setting
Object Name of the object to study
Property Property of the object to study
{GETPOS}
Syntax
{GETPOS Location}
Description
{GETPOS} places the position of the file pointer in Location as a value. If no file has been opened using {OPEN}, the command is ignored.
The file pointer is a number corresponding to the position at which the next character written to the file will be placed. If the file pointer is 0, the next character written to the file with {WRITE} or {WRITELN} is placed at the beginning of the file. If the file already contains information, it is overwritten, beginning at the first position in the file. After the file is written to, the file pointer is positioned immediately after the last character written. If a file is newly created, then written to for the first time, the file pointer will be the size of the file.
If {GETPOS} succeeds, macro execution continues in the cell below the cell containing the {GETPOS} command, ignoring any commands in the same cell as {GETPOS}; if {GETPOS} fails, macro execution continues in the same cell.
Example
The following example 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 and 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 Quattro Pro when the text is read into cells. So, the calculated length is one character longer than the actual length. The text file read here was created by the macro example provided in the {WRITELN} command description.
\F {OPEN "A:TEST.TXT",R}
{GETPOS start}
{READLN input}
{GETPOS end}
{CLOSE}
{LET num_char,+(end-start)-1}
input This is a short line.
start 0
end 22
num_char 21
Parameters
Location Cell in which to store the retrieved value
{GETPROPERTY}
Syntax
{GETPROPERTY Cell,Property}
PerfectScript Syntax
GetProperty (Cell:String; PropertyName:String)
Description
{GETPROPERTY} lets you study the property settings of whatever object is selected. Property is the property to view its setting is stored in Cell. (see Property Reference for a list of properties)
Example
{GETPROPERTY A23,"Text_Color"} stores the Text Color setting of the selected object in the cell A23.
{GETPROPERTY B42,"Box_Type"} stores the border style of the selected object in cell B42.
Parameters
Cell Cell in which to store the property setting
Property Property of the selected object to study
{GETWINDOWLIST}
Syntax
{GETWINDOWLIST Block}
PerfectScript Syntax
GetWindowList (Block:String)
Description
{GETWINDOWLIST} stores a list of the windows open on the Quattro Pro desktop in Block, including dialog windows and chart windows. Windows currently hidden are not included.
If Block is one cell, {GETWINDOWLIST} overwrites any information beneath the cell (if it finds more than one window open). To restrict the window names to specific cells, set Block to more than one cell.
Example
{GETWINDOWLIST A2..C5} stores a list of open windows in the cells A2..C5. The first window name is stored in A2, the second in B2, and so on. If more than twelve windows are open, only the first twelve are stored in the cells.
Parameters
Block Cells to store window names in
{GOTO}
Description
{GOTO} lets you move the selector to a specific location. Note that you are unable to manipulate the "Enter address to go to" dialog box using the {GOTO} macro. A related macro, {QGOTO}, selects the cell or cells specified as its destination, while {GOTO} moves to the cell in the upper-left corner of the specified cells.
This command is for compatibility with Quattro Pro for DOS.
{GRAPH}
Description
{Graph} is equivalent to the Chart key, F11, which displays the current chart.
Note
¿ This command is obsolete.
¿
{GRAPHCHAR}
Syntax
{GRAPHCHAR Location}
Description
{GRAPHCHAR} returns the key you press to leave a chart or to remove a message box. The character is stored at Location. This command lets you create a chart or message that functions as a menu of choices. You can use the character returned to branch or display any other data.
{GRAPHCHAR} works with {MESSAGE} to record what key you pressed to remove a message box. It captures only characters you can normally type into a cell; special characters such as Esc are not stored.
Example
The following example displays a message box (its contents being the_msg) and returns the character you pressed to remove it. The key pressed is stored in cells named the_key.
\A {MESSAGE the_msg,15,15,0}
{GRAPHCHAR the_key}
the_key
the_msg Press C to continue or any other key to quit...
The next example displays a chart and waits for you to press a key. This macro begins with the command found next to "_graphic" and assumes that the current file contains charts by the name of "line," "pie," "bar," and "area." If you press P, B, or A, Quattro Pro displays a (predefined) pie chart, bar chart, or area chart, respectively. The macro stops playing when you press any key that is not P, B, or A.
the_chart bar
the_key b
_graphic {GraphView "line"}
_continue {GRAPHCHAR the_key}
{if @UPPER(the_key)="P"}{_draw "pie"}
{if @UPPER(the_key)="B"}{_draw "bar"}
{if @UPPER(the_key)="A"}{_draw "area"}
_draw {DEFINE the_chart}
{GraphView the_chart}
{BRANCH _continue}
Parameters
Location Cell address or the cell name where the returned character should be stored
{GraphCopy} copies the style, data, and/or annotation objects from one chart to another (within a notebook or between notebooks).
You can use {GraphCopy?} or {GraphCopy!} to display the Paste Special Chart dialog box. {GraphCopy?} lets you manipulate the dialog box, whereas {GraphCopy!} relies on the macro to manipulate it.
Parameters
FromChart Chart containing the style, data, or annotation objects to copy
DestChart New chart (the copy)
Style? Whether to copy properties that affect the appearance of the chart: yes (1), no (0)
Data? Whether to copy chart data: yes (1), no (0)
Annotations? Whether to copy annotation objects: yes (1), no (0)
{GraphDeactivate}
Description
{GraphDeactivate} deactivates a floating chart that has been activated for editing.
Example
The following macro activates a floating chart for editing, creates a rectangle in the chart, makes a copy of the rectangle, then deactivates editing.
{GraphEdit Chart1, 1}
{CreateObject Rect,147,176,416,427}
{Duplicate 269,338}
{GraphDeactivate}
{GraphDelete}
Syntax
{GraphDelete Name}
PerfectScript Syntax
GraphDelete (Name:String)
Description
{GraphDelete} deletes the specified chart from the active notebook.
You can use {GraphDelete?} or {GraphDelete!} to display the Delete Chart dialog box. {GraphDelete?} lets you manipulate the dialog box, whereas {GraphDelete!} relies on the macro to manipulate it.
{GraphEdit} displays the specified chart in a chart window for editing. Use the InPlace? argument to edit a floating chart on the notebook sheet.
You can use {GraphEdit?} or {GraphEdit!} to display the Edit Chart dialog box. {GraphEdit?} lets you manipulate the dialog box, whereas {GraphEdit!} relies on the macro to manipulate it.
Example
The following macro selects the floating chart named Inserted1 and then activates its source chart (Chart1) for editing on the notebook sheet.
{SelectFloat Inserted1}
{GraphEdit Chart1,1}
Parameters
Name Name of the chart to edit
InPlace? Whether to edit the chart in place on a notebook sheet; 0 = no, 1 = yes; the default is 0
{GraphGallery} applies a chart style and color scheme to selected charts.
Available choices for ColorScheme are:
¿ No change Pastels
¿ Default Fire and Ice
¿ Grayscale Bright and Bold
¿ Icy Blues Color Washes
¿ Deep Reds Black and White Patterns
¿ Autumn Leaves Color Patterns
¿ Tangerine Tiled Men
You can use {GraphGallery?} or {GraphGallery!} to display the Chart Gallery dialog box. {GraphGallery?} lets you manipulate the dialog box, whereas {GraphGallery!} relies on the macro to manipulate it.
Example
The following macro selects a 3-D Bar chart style and a "Tangerine" color scheme:
{GraphGallery "3dbar","Tangerine"}
Parameters
ChartStyle The style of chart; see {GraphSettings.Type} for a list of chart types
{GraphNew} creates a new chart and displays it in a chart window. If UseCurrentBlock? is 1, any selected data is shown in the chart; if it is 0, {GraphNew} creates a new chart without data.
You can use {GraphNew?} or {GraphNew!} to display the New Chart dialog box. {GraphNew?} lets you manipulate the dialog box, whereas {GraphNew!} relies on the macro to manipulate it.
Parameters
Name Name of the new chart
UseCurrentBlock? Whether to chart the current selected cells; 0 = no, 1 = yes; the default is 0name of the new chart
{GraphSettings.Titles} sets the titles of the active chart (or selected floating chart or chart icon). Each argument is a string; to reset a title, use an empty string ("").
Example
The following macro command displays the chart Profit99 in a chart window and sets its main title and subtitles. The empty strings ("") indicate that there are no axis titles.
Sub Title appearing below the main title of the chart
X-Axis Title of the chart's x axis
Y-Axis Title of the chart's y axis
Y2-Axis Title of the chart's secondary y axis
{GraphSettings.Type}
Syntax
{GraphSettings.Type Type,Class}
PerfectScript Syntax
GraphSettings_Type (Type:String)
Description
{GraphSettings.Type} lets you specify how the data in a chart is displayed. It affects the active chart (or chart icon or floating chart). Class specifies the class of chart type being used. Class can be one of six settings: Area/Line, Bar, Stacked Bar, Pie, Specialty, and Text.
{GraphView} displays a full-screen chart (or series of charts). {GraphView} without an argument displays the active chart (or chart icon or floating chart).
You can use {GraphView?} or {GraphView!} to display the View Chart dialog box. {GraphView?} lets you manipulate the dialog box, whereas {GraphView!} relies on the macro to manipulate it.
Example
The following macro displays the named charts Profit90 through Profit94.
ChartName1 Name of the first chart to display (optional)
ChartName2 Name of the second chart to display (optional)
{GraphWindow}
Syntax
{GraphWindow.Property}
PerfectScript Syntax
GraphWindow_Aspect_Ratio (Mode:String)
GraphWindow_Grid (Settings:String)
Description
{GraphWindow} is equivalent to right-clicking the title bar of a chart window to set its Aspect Ratio or Grid properties.
{GraphWindow.Aspect_Ratio Option} sets the aspect ratio of the active chart. Option can be one of the following settings: "35mm Slide," "Floating Chart," "Full Extent," "Printer Preview," or "Screen Slide."
{GraphWindow.Grid GridSize,DisplayGrid,SnapToGrid} sets the grid size of the active chart window. Use GridSize to specify the percent of chart window between grid points; DisplayGrid specifies whether the grid is visible; SnapToGrid specifies whether the grid is active.
Example
This macro sets up a 10 by 10 grid, displays the grid, and enables it.
Once you have defined a sheet group, you can use {Notebook.Group_Mode "On"} to activate Group mode. Use "Off" to cancel Group mode.
You can use {Group?} or {Group!} to display the Define/Modify Group dialog box. {Group?} lets you manipulate the dialog box, whereas {Group!} relies on the macro to manipulate it.
Options
{Group.Define GroupName, StartPage, EndPage} Creates sheet groups
{Group.Delete GroupName} Deletes the currently selected sheet group
{Group.ResetNames} Clears all group names in the notebook
{GroupObjects}
Description
{GroupObjects} groups selected objects in a chart window so they can be treated as one object in subsequent operations. Use {UngroupObjects} to treat them independently again.