The {DatabaseQuery} macro sends the specified SQL statement to either ODBC or BDE and places the returned data in the specified block of cells.
Parameters
Type Type of database to query: "Paradox", "ODBC", or "BDE (Borland Database Engine)".
Name Name of the database. If the type is Paradox, the name must be a path. If the type is ODBC, the name is a Data Source Name (DSN) from the user's ODBC configuration. If the name is BDE, the name is an alias name from the user's IDAPI/BDE configuration.
QueryString An SQL Statement.
Destination The destination block of cells where to send the result.
{DATE}
Description
{DATE} is equivalent to pressing Ctrl+D, which lets users enter a date or time into the active cell.
You can enter a date in a cell without using Ctrl+D. Just type a date in one of Quattro Pro's date formats--for example, 6/1/95.
Example
{DATE}8/6/90~ enters 8/6/90 in the active cell as a date.
{DATE}{?}~ pauses to let the user enter a date, then enters that date into the active cell.
{DbAlias} lets you specify a private directory to hold temporary files, or a working directory where external data tables are most likely to be found.
Parameters
WORK | PRIV WORK to specify a Working directory; PRIV to specify a Private directory
Path path for the Working directory or the Private directory
{DEFINE}
Syntax
{DEFINE Location1<:Type1>, Location2<:Type2>,...}
Description
When you pass control to a subroutine with the {Subroutine} command, you can also pass arguments for use by that subroutine. If you do, you must include a {DEFINE} command in the subroutine's first line. This command defines the data type of *each argument passed and indicates which cells to store the arguments in. If no {DEFINE} command is included, the arguments are ignored.
{DEFINE} sequentially defines the arguments passed to the subroutine. The first location and type given are assigned to the first argument passed, the second location and type to the second argument, and so on.
You must specify a location for each argument. This tells Quattro Pro where to copy them. If there are more locations given than arguments passed, or more arguments than locations, the macro ends immediately, and an error message displays.
Type is optional. It tells Quattro Pro whether the argument is a value or string. If no data type is given, the argument is assumed to be a literal string (even if it is a valid cell name, cell address, or value). If you add :string (or :s) to the location, any argument passed is stored as a label. If you add :value (or :v), Quattro Pro treats the coming argument as a number or value resulting from a numeric formula. It it is not a numeric value, Quattro Pro treats it as a string (or string value from a formula).
Example
In the following example, the \F macro passes three arguments (principal, interest, and term) to the subroutine _calc_loan, which stores the arguments in named cells and defines them as values. It then
¿ uses the arguments to calculate the monthly payment on a loan
¿ stores the result in a cell named amount
¿ creates a label in a cell named payment displaying that amount as currency
¿ returns control to the main macro
The main macro (\F) displays the result in the active cell preceded by the string "The monthly payment will be ".
txt_area +"The monthly payment will be "&@TRIM(payment)
Parameters
Location Cell in which you want to store the argument being passed
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)
{DEL} and {DELETE}
Description
{DEL} and {DELETE} are equivalent to the Del key.
{DELETEMENU}
Syntax
{DELETEMENU MenuPath}
PerfectScript Syntax
DeleteMenu (MenuPath:String)
Description
{DELETEMENU} removes the menu specified by MenuPath from the menu system. See the description of {ADDMENU} for the syntax of MenuPath. Use {DELETEMENUITEM} to remove an individual menu item.
Example
{DELETEMENU "/File"} removes the File menu from the active menu system.
Parameters
MenuPath Menu in the tree to delete; type a forward slash (/) followed by the menu name; for example, to delete the Edit menu, type /Edit.
Notes
¿ You cannot delete menus between Edit and Tools on the menu bar. The area between these menu positions is reserved for context-sensitive menus that change depending on the active window. You can add menu items to menus between the Edit and Tools menus, but the new menu items will be swapped out of the menu when the context changes.
¿ Changes made to the menu system using this command are not saved; they are lost when you exit Quattro Pro. Each time you run a macro containing {DELETEMENU}, the menu changes appear again.
¿ To restore the original menu bar, use the macro command {SETMENUBAR} without an argument
{DELETEMENUITEM}
Syntax
{DELETEMENUITEM MenuPath}
PerfectScript Syntax
DeleteMenuItem (MenuPath:String)
Description
{DELETEMENUITEM} removes the menu item specified by MenuPath from the menu system. Use {DELETEMENU} to remove entire menus from the active menu system.
Example
{DELETEMENUITEM "/Edit/Clear"} removes the Clear command from the Edit menu.
{DELETEMENUITEM "/Edit/<-"} removes the first item on the Edit menu.
Parameters
MenuPath Menu item in the tree to delete; enter the sequence of menu items separated by forward slashes (/); you can use <- and -> to specify an item menu at the top or bottom of a menu, respectively. For example, /File/<- specifies the first item on the File menu. You can also use numbers to identify menu items. For example, /File/0 specifies the first item on the File menu (the ID numbers start at zero).
Notes
¿ You can delete menu items from any menu, but if you change a context-sensitive menu (all menus between Edit and Tools on the menu bar), the change applies only to the menu in the active window. For example, suppose you use a macro to change the View menu when the notebook window is active. If you then open a chart window, the chart View menu appears--without the change. If you want the change to apply to that View menu as well, you must run the macro again.
¿ Changes made to the menu system using this command are not saved; they are lost when you exit Quattro Pro. Each time you run a macro containing {DELETEMENUITEM}, the menu changes appear again.
¿ To restore the original menu bar, use the macro command {SETMENUBAR} without an argument.
{DELVAR}
Syntax
{DELVAR VarName1<,VarName2,...>}
PerfectScript Syntax
DelVar ([VarName1:String]; {[VarName:String]})
Description
{DELVAR} deletes unused named variables. Named variables are used to control OLE objects. OLE objects are released from control at the end of macro execution, but named variables remain until you exit Quattro Pro. You can delete the unused named variables to free an object assigned to that name, and then control the object using another macro.
Example
{DELVAR} deletes all named variables
{DELVAR calc} deletes a named variable calc
{DELVAR calc 0, calc 1, calc 3} deletes the named variables calc 0, calc 1, and calc 3.
{DESCR} returns a table of descriptive statistics that characterize a sample. {DESCR} is equivalent to the Descriptive Statistics analysis tool.
Parameters
InBlock One or more numeric cell values representing the input cells
OutBlock Upper-left cell of the output cells
Grouped "C" to group results by column or "R" to group results by row; "C" is the default
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
Summary 1 to display summary statistics; 0 to omit summary statistics; the default is 0
Largest A value n which, if present, makes {DESCR} report the nth largest data point; if omitted, the largest data point is not reported
Smallest A value n which, if present, makes {DESCR} report the nth smallest data point; if omitted, the smallest data point is not reported
Confidence Confidence level of the mean; the default is 0.95
{DialogView}
Syntax
{DialogView Window}
PerfectScript Syntax
DialogView (Window:String)
Description
{DialogView} lets you edit an existing dialog box.
Parameters
Window Dialog window to make active
{DialogWindow}
Syntax
{DialogWindow.Property}
Description
{DialogWindow} is equivalent to right-clicking the title bar of a dialog window to set its properties.
{DialogWindow} commands affect the active dialog window. The next table lists the possible settings for Property. To display a property description with syntax, choose that property in the following list:
Dimension
Disabled
Grid_Options
Name
Position_Adjust
Title
Value
{DialogWindow.Dimension}
Syntax
{DialogWindow.Dimension<Option>}
PerfectScript Syntax
DialogWindow_Dimension_Height (Height:Numeric)
DialogWindow_Dimension_Width (Width:Numeric)
DialogWindow_Dimension_X (XPos:Numeric)
DialogWindow_Dimension_Y (YPos:Numeric)
Description
{DialogWindow.Dimension} is equivalent to the dialog window property Dimension, which lets you move and resize the active dialog window. Each argument is specified in pixels. XPos and YPos specify the distance in pixels from the left side of the Quattro Pro window and bottom of the input line, respectively.
Example
The following macro command positions the active dialog window two pixels from the left edge of the Quattro Pro window and five pixels below the input line, and sets the width to 150 pixels and the height to 250 pixels.
{DialogWindow.Disabled} disables (Yes) or enables (No) the active dialog box or Toolbar. This command works only when you view a dialog box or toolbar; it does not work when you edit one.
{DialogWindow.Grid_Options} sets the grid size of the active dialog window. Use GridSize to specify the distance between grid points in pixels; ShowGrid specifies whether the grid is visible; SnapToGrid specifies whether objects snap to the grid.
Example
The following macro sets the distance between grid points to 10, shows the grid, and enables it.
{DialogWindow.Grid_Options "10,Yes,Yes"}
{DialogWindow.Name}
Syntax
{DialogWindow.Name Name}
PerfectScript Syntax
DialogWindow_Name (Name:String)
Description
{DialogWindow.Name} sets the name of the active dialog window. This name is used by macro commands, @functions, and link commands to identify the dialog box (or Toolbar).
{DialogWindow.Position_Adjust} specifies how the active dialog box resizes when the Quattro Pro window is resized. The arguments are equal to options in the Position Adjust dialog box.
{DialogWindow.Title}
Syntax
{DialogWindow.Title String}
PerfectScript Syntax
DialogWindow_Title (Title:String)
Description
{DialogWindow.Title} specifies the title that appears on the dialog box when the user is viewing it (the title does not appear when editing the dialog box).
{DialogWindow.Value}
Syntax
{DialogWindow.Value String}
PerfectScript Syntax
DialogWindow_Value (String:String)
Description
{DialogWindow.Value} sets the initial settings of the dialog box (or Toolbar). You can use it with @COMMAND to find the current settings of the dialog box. String is a comma-separated list of settings. Each setting sets the initial value of one control. Control values appear in this list if their Process Value property is set to Yes. You can set the order of the settings while editing the dialog box.
Example
The following macro command sets the initial values of a dialog box with three controls. Each setting maps to one control.
{DialogWindow.Value "25000,5,1st of month"}
{DISPATCH}
Syntax
{DISPATCH Location}
Description
{DISPATCH} is similar to {BRANCH}, except it uses Location differently:
¿ If Location is a cell address or one named cell, {DISPATCH} branches to the address stored in that cell.
¿ If Location is a text formula resulting in a cell or one named cell, {DISPATCH} branches to the address stored in that result address. (In Quattro Pro DOS, {DISPATCH} branches to the actual result address.)
¿ If Location contains cells or a text formula resulting in cells, {DISPATCH} branches to the first cell of those cells.
{DISPATCH} is useful when you want to branch to one of several alternative macros, depending on circumstances. You can also set up a macro that modifies the contents of Location, depending on user input or test conditions.
Example
The macro _continue in the following example uses {DISPATCH jump_cell} to create a form letter that changes depending on the result of a credit check.
Type the line to the right of \F with no hard returns until after the first {BRANCH _continue}, then press Enter to insert the text into one cell.
{DLL} runs a macro or returns a value from an add-in @function contained in a dynamic-link library file. The @function can have up to 16 arguments.
Example
This statement calls the @function AMPLITUDE, included in the DLL Math, with two selections as arguments:
{DLL Math.AMPLITUDE,A1..A10,B1..B10}
Parameters
DLLName The name of a DLL file (if not already loaded)
FunctionName The name of an @function contained in the DLL
Argument1,Argument2... Arguments to the @function
{DLL.Load}
Syntax
{DLL.Load DLLName}
PerfectScript Syntax
DLL_Load (DLLName:String)
Description
{DLL.Load} loads a dynamic-link library (DLL) program. You can use {DLL.Load} to load a DLL containing add-in @functions or macros. When the DLL is loaded, you can reference add-in @functions contained in the DLL without typing the DLL name. Similarly, macros contained in the DLL become resident in memory.
You can use {DLL.Load} to define a startup macro in QPW.INI.
{DODIALOG} displays a dialog box for you or the macro to manipulate. MacUse? specifies how to manipulate the dialog box; if 0, the macro manipulates the dialog box; if 1, the macro pauses so the user can manipulate the dialog box.
DialogName is the name of the dialog box to display. Arguments refers to the cells containing initial settings for controls in the dialog box. Each cell in Arguments corresponds to one control in the dialog box with a Process Value property set to Yes; the order of controls in the dialog box determines which cell maps to which control (the first cell maps to the first control, the second cell maps to the second, and so on).
If a dialog box is under macro control (MacUse? set to 0), you can make it revert to user control using {PAUSEMACRO}.
Once the dialog box closes (performing its function), Quattro Pro writes the new control settings into their respective cells. OKExit? is a cell containing the result of the dialog box operation; 1 if OK was chosen, 0 if the dialog box was canceled.
Parameters
DialogName Name of dialog box to display
OKExit? Cell to store how the dialog box closed (1 for OK, 0 for Cancel)
Arguments Cells to store the initial settings for controls in the dialog box and their final settings (optional)
MacUse? 1 if the user should manipulate the dialog box, 0 if the macro manipulates it (optional; 1 is the default)
{DOWN} and {D}
Syntax
{DOWN <Number>} or {D <Number>}
Description
{DOWN} and {D} are equivalent to the Down key. The optional argument Number moves the selector down the corresponding number of rows. You can also use cell references or cell names as arguments.
Example
{DOWN}{DOWN} moves the selector down two rows.
{DOWN 4} moves the selector down four rows.
{DOWN G13} moves down the number of rows specified in cell G13.
{DOWN count} moves down the number of rows specified in the first cell of the named area "count".
Parameters
Number Any positive integer (optional)
{DraftViewGoto}
Description
Switches from either the Objects Sheet or the sheet in Page View mode to Draft View.
{DUPLICATE}
Syntax
{DUPLICATE xoffset, yoffset }
PerfectScript Syntax
Duplicate (xoffset:Numeric; yoffset:Numeric)
Description
{DUPLICATE} copies selected chart annotations or dialog box controls. If no object is selected, {DUPLICATE} does nothing.
xoffset and yoffset are measured in relative coordinates for objects in a chart window, and in pixels for dialog box objects.
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}
Parameters
xoffset Offset from the left edge of UpperCell to the left edge of the floating object
yoffset Offset from the top edge of UpperCell to the top edge of the floating object