home *** CD-ROM | disk | FTP | other *** search
/ Chip: 25 Years Anniversary / CHIP_25Jahre_Jubilaeum.iso / downloads / 401065 / WPO11 / Data1.cab / _13D19513B08747E5A1DCE998F50C8994 < prev    next >
Text File  |  2003-03-07  |  16KB  |  476 lines

  1. {OBJECTSPAGEGOTO}{OLE.Option}
  2.  
  3. Description
  4.  
  5. {OBJECTSPAGEGOTO} displays the Objects sheet of the active notebook. When the Objects sheet is active, you can use {SELECTOBJECT} to select icons, and other object commands to manipulate them.
  6.  
  7. You can use {SELECTBLOCK} to move from the Objects sheet to a spreadsheet sheet.
  8.  
  9. {OLE}
  10.  
  11. Syntax
  12.  
  13. {OLE.Option}
  14.  
  15. PerfectScript Syntax
  16.  
  17. OLE_ActivateAs (ObjectType:String)
  18.  
  19. OLE_AutomaticResize (Auto?:Enumeration {Yes!; No!})
  20.  
  21. OLE_AutomaticUpdate (Auto?:Enumeration {Yes!; No!})
  22.  
  23. OLE_Change_Link (Filename:String)
  24.  
  25. OLE_Change_To_Picture ()
  26.  
  27. OLE_Convert (ObjectType:String)
  28.  
  29. OLE_Display_As_Icon (Icon?:Enumeration {Yes!; No!})
  30.  
  31. OLE_DoVerb (Action:String)
  32.  
  33. OLE_OpenEdit ()
  34.  
  35. OLE_Update ()
  36.  
  37. Description
  38.  
  39. {OLE} affects the selected OLE object. The type of OLE object determines what command equivalents affect it:
  40.  
  41. OLE type    Commands
  42.  
  43. Embedded    {OLE.DoVerb}, {OLE.Convert}, {OLE.Change_To_Picture}, {OLE.DisplayAsIcon}, {OLE.ActivateAs}
  44.  
  45. Linked    {OLE.DoVerb}, {OLE.Change_Link}, {OLE.Update}, {OLE.Convert}, {OLE.Change_To_Picture}, {OLE.DisplayAsIcon}, and {OLE.ActivateAs}
  46.  
  47. Example
  48.  
  49. This macro selects an OLE object named Embedded1, lets you edit the data (in the OLE server), then converts the object into a picture (disabling the OLE link).
  50.  
  51. {SELECTFLOAT Embedded1}
  52.  
  53. {OLE.DoVerb Edit}
  54.  
  55. {OLE.Change_To_Picture}
  56.  
  57. Options
  58.  
  59. {OLE.ActivateAs ObjectType}    Opens the object using a different but compatible application
  60.  
  61. {OLE.AutomaticResize 0|1}    Automatically resizes the object after you edit it
  62.  
  63. {OLE.AutomaticUpdate 0|1}    Turns automatic updating on or off
  64.  
  65. {OLE.Change_Link FileName}    Switches links from one file to another
  66.  
  67. {OLE.Change_To_Picture}    Clicks to convert the embedded picture to a differenty type
  68.  
  69. {OLE.Convert ObjectType}    Converts the embedded information to a different type
  70.  
  71. {OLE.DisplayAsIcon 0|1}    Displays the embedded object as an icon
  72.  
  73. {OLE.DoVerb Action}    Plays, edits, or opens the object
  74.  
  75. {OLE.OpenEdit}    Opens the original application to edit the object
  76.  
  77. {OLE.Update}    Refreshes links to unopened files
  78.  
  79. {ONERROR}
  80.  
  81. Syntax
  82.  
  83. {ONERROR BranchLocation, <MessageLocation>, <ErrorLocation>}
  84.  
  85. Description
  86.  
  87. Normally, if an error occurs during macro execution, the macro ends and you see an error message. {ONERROR} tells Quattro Pro to branch to a different location (BranchLocation) if an error is encountered and to store the error message in MessageLocation for future reference. Quattro Pro stores the location of the error in ErrorLocation. MessageLocation and ErrorLocation are optional. If MessageLocation is omitted, no error message will be displayed or stored.
  88.  
  89. Only one {ONERROR} command can be in effect at a time, so each time it is called, the most recent {ONERROR} replaces the previous one. If an error occurs, the {ONERROR} state is "used up" and must be redeclared. It is best to declare {ONERROR} at the very beginning of your macro, or at least before any procedure is likely to result in an error.
  90.  
  91. In general, {ONERROR} will not capture macro programming errors, such as an incorrect sequence of commands, or an attempt to call a nonexisting subroutine. Nor will it detect syntax errors within a macro itself, such as an error resulting from the incorrect use of a macro keyword.
  92.  
  93. Typical errors that {ONERROR} detects include
  94.  
  95. ¿    disk errors, such as a disk drive door left open, a full disk, or failure to find a file of a given name
  96.  
  97. ¿    attempts to copy to a protected cell when a notebook's protection property is enabled
  98.  
  99. ¿    attempts to insert a row that would push a nonblank cell off the bottom of the notebook
  100.  
  101. Example
  102.  
  103. The following macro uses {ONERROR} by first deliberately causing an error (trying to insert a row that would push text off the bottom of the notebook), then beeping when that error occurs.
  104.  
  105. \G    {ONERROR _on_err,err_msg,err_loc}
  106.  
  107.         {EditGoto A8192}
  108.  
  109.         {PUTCELL "This is the end"}
  110.  
  111.         {UP}
  112.  
  113.         {BlockInsert.Rows C(0)R(0), "Entire"}
  114.  
  115.  
  116.  
  117. _on_err    {BEEP 5}
  118.  
  119. err_msg
  120.  
  121. err_loc
  122.  
  123. Parameters
  124.  
  125. BranchLocation    First cell of the macro to run in case of an error
  126.  
  127. MessageLocation    Cell in which to store any error message (optional)
  128.  
  129. ErrorLocation    Cell in which to store the address of the cell containing the macro error (optional)
  130.  
  131. {OnlineService}
  132.  
  133. Syntax
  134.  
  135. {OnlineService ServiceName;Arguments}
  136.  
  137. PerfectScript Syntax
  138.  
  139. OnlineService (ServiceName:String; [Arguments:String])
  140.  
  141. Description
  142.  
  143. {OnlineService} launches internet URL address from a QuickButton.
  144.  
  145. Example
  146.  
  147. {OnlineService Internet,"http://www.corel.com/products/wordperfect/cqp8/index.htm"}
  148.  
  149. Parameters
  150.  
  151. ServiceName    A string indicating the type of online service to use.
  152.  
  153. Arguments    A string indicating the command line to pass to the service.
  154.  
  155. {OPEN}
  156.  
  157. Syntax
  158.  
  159. {OPEN Filename,AccessMode}
  160.  
  161. Description
  162.  
  163. {OPEN} establishes a connection to Filename so you can use other file-access macro commands ({READ}, {WRITE}, and so on) on it. There are five different access modes:
  164.  
  165. R (Read-Only)    Allows only reading from this file, ensuring no changes are made to it. {WRITE} and {WRITELN} cannot be used with a file opened as read-only.
  166.  
  167. M (Modify)    Opens an existing file for modification. All reading and writing commands can be used with a file opened for modification. You can also use this access mode to open a stream to a communications port (for example, "COM1") or a printer port (for example, "LPT1").
  168.  
  169. W (Write)    Opens a new file with the name given in {OPEN}. If a file already exists with that name, the existing file is erased. All reading and writing commands can be used with a file opened for writing.
  170.  
  171. A (Append)    Opens an existing file for modification. Allows writing to the selected file only, and positions the file pointer at the end of the file.
  172.  
  173.  L (Locate)    Opens and closes a file to locate it.
  174.  
  175. Filename's full name and access path must be given, and the entire name must be in quotes. For instance, to open and modify the file DATA.TXT in the subdirectory called FILES on drive C, use the command {OPEN "C:\FILES\DATA.TXT",M}. If any part of the access path or file name is left out, the file might not be found.
  176.  
  177. Although {OPEN} can provide access to any type of file (including .WB3 spreadsheet files), Quattro Pro's file-access macro commands are designed to work only with plain text files. Using these commands with any other file type is not recommended and can result in corruption of that file. Make a backup copy of your file before using {OPEN} on it.
  178.  
  179. Once {OPEN} runs successfully, Quattro Pro skips to the next row of the macro and continues executing instructions there. {OPEN Filename,R}, {OPEN Filename,M}, and {OPEN Filename,A} fail if the file is not found. {OPEN Filename,W} fails if the supplied access path or file name is invalid. If {OPEN} fails, Quattro Pro continues executing commands in the same cell as the {OPEN} command. (See the third macro below for an example.) You can use {ONERROR} to trap some errors that occur in {OPEN}.
  180.  
  181. Example
  182.  
  183. The following example opens the file named MYDATA.TXT for reading. If the file does not exist in the default data directory, the command fails.
  184.  
  185.     {OPEN "MYDATA.TXT",R}
  186.  
  187. The next example creates a file MYDATA.TXT on drive A for writing. If there is already a file on drive A with that name, it is erased. This command will fail only if there is no disk in drive A.
  188.  
  189.     {OPEN "A:MYDATA.TXT",W}
  190.  
  191. The last example demonstrates how to do error trapping in an {OPEN} macro. When you press Ctrl+H, Quattro Pro attempts to open the file C:\MYDIR\DATA.TXT. If that succeeds, the macro stops, since there are no more commands in the row below. If {OPEN} fails (meaning the file does not exist), the adjacent {BRANCH} runs. The subroutine _try_again then attempts to create the file. If that succeeds, the macro restarts, since {OPEN} should succeed now that the file has been created. If _try_again fails, probably an invalid directory path was given. Therefore, the adjacent {BRANCH} goes to _bad_dir, which displays a relevant error message with pertinent instructions.
  192.  
  193. \H    {OPEN "C:\MYDIR\DATA.TXT",M}{BRANCH _try_again}
  194.  
  195.     {CLOSE}
  196.  
  197.     
  198.  
  199. _try_again    {OPEN "C:\MYDIR\DATA.TXT",W}{BRANCH _bad_dir}
  200.  
  201.     {CLOSE}
  202.  
  203.     {BRANCH \H}
  204.  
  205.     
  206.  
  207. _bad_dir    {EditGoto err_loc}{BEEP 4}
  208.  
  209.     {PUTCELL "The directory C:\MYDIR\ does not exist."}
  210.  
  211.     {DOWN}
  212.  
  213.     {PUTCELL "Create it, then try again."}
  214.  
  215.     {DOWN}
  216.  
  217. err_loc    
  218.  
  219. Parameters
  220.  
  221. Filename    file name
  222.  
  223. AccessMode    R, M, W, A, or L
  224.  
  225.  
  226.  
  227. {Optimizer}
  228.  
  229. Syntax
  230.  
  231. {Optimizer.Option}
  232.  
  233. PerfectScript Syntax
  234.  
  235. Optimizer_Add (Constraint:Numeric; Cell:String; Operator:String; [Constant:Any])
  236.  
  237. Optimizer_Answer_Reporting (Cell:String)
  238.  
  239. Optimizer_Auto_Scale (Auto?:Enumeration {Yes!; No!})
  240.  
  241. Optimizer_Change (Constraint:Numeric; Cell:String; Operator:String; [Constant:Any])
  242.  
  243. Optimizer_Delete (Constraint:Numeric)
  244.  
  245. Optimizer_Derivatives (Derivatives:String)
  246.  
  247. Optimizer_Detail_Reporting (Cell:String)
  248.  
  249. Optimizer_Estimates (Estimates:String)
  250.  
  251. Optimizer_Linear (Linear?:Enumeration {Yes!; No!})
  252.  
  253. Optimizer_Load_Model ()
  254.  
  255. Optimizer_Max_Iters (Iters:Numeric)
  256.  
  257. Optimizer_Max_Time (Time:Numeric)
  258.  
  259. Optimizer_Model_Cell (Cell:String)
  260.  
  261. Optimizer_Precision (Precision:Numeric)
  262.  
  263. Optimizer_Reset ()
  264.  
  265. Optimizer_Save_Model ()
  266.  
  267. Optimizer_Search (Search:String)
  268.  
  269. Optimizer_Show_Iters (Show?:Enumeration {Yes!; No!})
  270.  
  271. Optimizer_Solution_Cell (Cell:String)
  272.  
  273. Optimizer_Solution_Goal (Goal:String)
  274.  
  275. Optimizer_Solve ()
  276.  
  277. Optimizer_Target_Value (Target:Numeric)
  278.  
  279. Optimizer_Tolerance (Tolerance:Numeric)
  280.  
  281. Optimizer_Variable_Cells (Cell:String)
  282.  
  283. Description
  284.  
  285. {Optimizer} performs goal-seeking calculations and solves sets of linear and nonlinear equations and inequalities.
  286.  
  287. Constraint# refers to a constraint's order in the constraint list. Constant may be a value or a cell containing a value. The Value for Target_Value may also be a value or a cell. Use {Optimizer.Solve} after the other commands to calculate the solution.
  288.  
  289. To save an Optimizer model, use {Optimizer.Model_Cell Cell} {Optimizer.Save_Model}. To load a model, use {Optimizer.Model_Cell Cell}{Optimizer.Load_Model}
  290.  
  291. You can use {Optimizer?} or {Optimizer!} to display the Optimizer dialog box. {Optimizer?} lets the user manipulate the dialog box, whereas {Optimizer!} relies on the macro to manipulate it.
  292.  
  293. Example
  294.  
  295. The following macro sets up an Optimizer problem designed to maximize the formula in D6 by varying cells B8..B10. Seven constraints limit the solution. All options have been changed from their default settings. T2 and G13 are the upper-left cells of the report selections.
  296.  
  297. {Optimizer.Solution_cell A:D6}
  298.  
  299. {Optimizer.Solution_goal Max}
  300.  
  301. {Optimizer.Variable_cells A:B8..A:B10}
  302.  
  303. {Optimizer.Add 1,"A:D8..A:D8",<=,"1000"}
  304.  
  305. {Optimizer.Add 2,"A:B8..A:B8",>=,"100"}
  306.  
  307. {Optimizer.Add 3,"A:B9..A:B9",>=,"100"}
  308.  
  309. {Optimizer.Add 4,"A:B10..A:B10",>=,"100"}
  310.  
  311. {Optimizer.Add 5,"A:D8..A:D8",>=,"500"}
  312.  
  313. {Optimizer.Add 6,"A:D9..A:D9",<=,"900"}
  314.  
  315. {Optimizer.Add 7,"A:D10..A:D10",<=,"110000"}
  316.  
  317. {Optimizer.Max_Time 50}
  318.  
  319. {Optimizer.Max_Iters 300}
  320.  
  321. {Optimizer.Precision 5E-05}
  322.  
  323. {Optimizer.Linear 1}
  324.  
  325. {Optimizer.Show_Iters 1}
  326.  
  327. {Optimizer.Estimates Quadratic}
  328.  
  329. {Optimizer.Derivatives Central}
  330.  
  331. {Optimizer.Search Conjugate}
  332.  
  333. {Optimizer.Detail_Reporting A:T2..A:T2}
  334.  
  335. {Optimizer.Answer_Reporting A:G13..A:G13}
  336.  
  337. {Optimizer.Solve}
  338.  
  339. Options
  340.  
  341. {Optimizer.Add Constraint#, Cell, <=|>=|=|Integer, Constant}    Adds a new constraint
  342.  
  343. {Optimizer.Answer_Reporting Cell}    Specifies the cells for the Answer Report
  344.  
  345. {Optimizer.Auto-scale 0|1}    Automatically scales variables to achieve a target value
  346.  
  347. {Optimizer.Change Constraint#, Cell, <=|>=|=|Integer, Constant}    Edits the selected constraint
  348.  
  349. {Optimizer.Delete Constraint#}    Removes the selected constraint
  350.  
  351. {Optimizer.Derivatives Central|Forward}    Selects differencing for estimates of partial derivatives
  352.  
  353. {Optimizer.Detail_Reporting Cell}    Specifies the cells for the Detail Report
  354.  
  355. {Optimizer.Estimates Quadratic|Tangent}    Specifies the approach used to obtain initial estimates of the basic variables in each iteration
  356.  
  357. {Optimizer.Linear 0|1}    Uses a linear method to solve the problem
  358.  
  359. {Optimizer.Load_Model}    Loads cells of Optimizer settings
  360.  
  361. {Optimizer.Max_Iters Value}    Sets the maximum number of iterations or trails
  362.  
  363. {Optimizer.Max_Time Value}    Indicates how long Optimizer can spend looking for the best solution
  364.  
  365. {Optimizer.Model_Cell Cell}    Saves cells of Optimizer settings for later use
  366.  
  367. {Optimizer.Precision Value}    Controls the accuracy of the solution
  368.  
  369. {Optimizer.Reset}    Clears Optimizer settings
  370.  
  371. {Optimizer.Save_Model}    Saves cells of Optimizer settings for future use
  372.  
  373. {Optimizer.Search Conjugate|Newton}    Selects a method for computing the search direction
  374.  
  375. {Optimizer.Show_Iters 0|1}    Pauses between iterations so you can check the progress of the search
  376.  
  377. {Optimizer.Solution_Cell SolutionCell}    Specifies the cell whose value you want Optimizer to measure
  378.  
  379. {Optimizer.Solution_Goal Max|Min|None|Target Value}    Specifies maximum, minimum, and target values
  380.  
  381. {Optimizer.Solve}    Finds a solution to the defined problem
  382.  
  383. {Optimizer.Target_Value Value}    Specifies the value to be reached by the formula in the Solution Cell
  384.  
  385. {Optimizer.Tolerance Value}    Indicates the maximum percentage a solution can differ from a theoretical optimum integer solution
  386.  
  387. {Optimizer.Variable_Cells Cell(s)}    Specifies the cells the Optimizer can adjust to reach an optimal solution
  388.  
  389. {Order}
  390.  
  391. Syntax
  392.  
  393. {Order.Option}
  394.  
  395. PerfectScript Syntax
  396.  
  397. Order_Backward ()
  398.  
  399. Order_Forward ()
  400.  
  401. Order_ToBack ()
  402.  
  403. Order_ToFront ()
  404.  
  405. Description
  406.  
  407. {Order} reorders overlapping objects in a chart or dialog window. Each command affects selected objects in the active window.
  408.  
  409. Options
  410.  
  411. {Order.Backward}    Sends the selected object back one layer
  412.  
  413. {Order.Forward}    Sends the selected object forward one layer
  414.  
  415. {Order.ToBack}    Sends the selected object to the back layer
  416.  
  417. {Order.ToFront}    Sends the selected object to the front layer
  418.  
  419. {Outline}
  420.  
  421. Syntax
  422.  
  423. {Outline.Option}
  424.  
  425. PerfectScript Syntax
  426.  
  427. Outline_AutoOutline ()
  428.  
  429. Outline_Collapse ()
  430.  
  431. Outline_Expand ()
  432.  
  433. Outline_Group ()
  434.  
  435. Outline_Hide (Hide?:Numeric)
  436.  
  437. Outline_Summary (Row?:Enumeration {Above!; Below!}; Col?:Enumeration {Left!; Right!})
  438.  
  439. Outline_ToLevel (RowCol?:String; [Level?:Numeric])
  440.  
  441. Outline_Ungroup ()
  442.  
  443. Outline_UnGroupAll ()
  444.  
  445. Description
  446.  
  447. {Outline} defines, creates, manipulates, and groups outlines.
  448.  
  449. Options
  450.  
  451. {Outline.AutoOutline}    Creates an outline automatically on the current pane/page
  452.  
  453. {Outline.Group}    Groups rows or columns. If the cells are not an entire row or column, whichever one contains the most elements (rows or columns) will be grouped
  454.  
  455. {Outline.Ungroup}    Ungroups rows or columns. If the cells are not an entire row or column, whichever one contains the most elements (rows or columns) will be ungrouped. If the cells do not span the ENTIRE group, only those rows/columns that are inside the cells will be ungrouped
  456.  
  457. {Outline.UngroupAll}    Destroys all groups on the current pane/page
  458.  
  459. {Outline.Expand}    Expands a collapsed group of rows or columns. If the cells are not an entire row or column and are inside a group, whichever one contains the most elements (rows or columns) and is inside a current group, will be expanded
  460.  
  461. {Outline.Collapse}    Collapses an expanded group of rows or columns. If the cells are not an entire row or column and are inside a group, whichever one contains the most elements (rows or columns) and is inside a current group will be collapsed
  462.  
  463. {Outline.Hide 0|1}    Either hides or shows the outline in the current pane/page
  464.  
  465. {Outline.Summary Above|Below, Left|Right}    Sets whether the summary will be above or below for row-based groups, and left or right for column-based groups
  466.  
  467. {Outline.ToLevel Rows|Columns, Level}    Collapses or expands a group or rows or columns at a specific level
  468.  
  469.  
  470.  
  471.  
  472.  
  473.  
  474.  
  475.  
  476.