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

  1. numeric: PercentChange
  2.  
  3. Syntax
  4.  
  5. ([Value: numeric]; [Value2: numeric])
  6.  
  7. Description
  8.  
  9. This command determines what percent to increase a value by, in order to get another value.
  10.  
  11. Return Value
  12.  
  13. The percent to increase the first value by.
  14.  
  15. Parameters
  16.  
  17. Value:
  18.  
  19. numeric    The value to increase.
  20.  
  21. Value2:
  22.  
  23. numeric    The value that is increased to.
  24.  
  25. numeric: PercentOf
  26.  
  27. Syntax
  28.  
  29. ([Percent: numeric]; [Value: numeric})
  30.  
  31. Description
  32.  
  33. This command returns a specified percentage of a value.
  34.  
  35. Return Value
  36.  
  37. The specified percentage of the specified value.
  38.  
  39. Parameters
  40.  
  41. Percent:
  42.  
  43. numeric    The percentage of the value to return.
  44.  
  45. Value:
  46.  
  47. numeric    The value to return a percentage of.
  48.  
  49. numeric: PercentOfTotal
  50.  
  51. Syntax
  52.  
  53. ([Value: numeric]; [Total: numeric})
  54.  
  55. Description
  56.  
  57. The percentage of a total value.
  58.  
  59. Return Value
  60.  
  61. The percentage.
  62.  
  63. Parameters
  64.  
  65. Value:
  66.  
  67. numeric    The value to test.
  68.  
  69. Total:
  70.  
  71. numeric    The total value to test against.
  72.  
  73. Pause
  74.  
  75. Example
  76.  
  77. Description
  78.  
  79. Pause a macro, returning computer control to the user.
  80.  
  81. To resume macro execution, press Enter, or choose Tools, Macro, Pause. To stop a macro, choose Tools, Macro, Play. When Pause follows a Prompt statement, choose OK to resume macro execution or Cancel to create a Cancel condition.
  82.  
  83. Persist
  84.  
  85. Example
  86.  
  87. Syntax
  88.  
  89. ({<VariableName> variable := <Value> any})
  90.  
  91. Description
  92.  
  93. Declare PerfectFit variables and arrays, and assign them to the persistent variable table.
  94.  
  95. Persist variables are available to any PerfectFit application while PerfectFit is running.
  96.  
  97. Parameters
  98.  
  99. <VariableName> variable    One or more user-defined variables separated by a semicolon. Variables must begin with a letter and can include any other combination of letters or numbers. Separate multiple variables with a semicolon. Parentheses are optional. For example,
  100.  
  101. Persist <VariableName>; <VariableName>
  102.  
  103. Persist (<VariableName>; <VariableName>)
  104.  
  105. are both valid statements. The next example declares persist arrays with 5 elements and 15 elements:
  106.  
  107. Persist FirstArray[5]; NextArray[15]
  108.  
  109. The last example simultaneously declares a variable and assigns a value:
  110.  
  111. Persist x := 2
  112.  
  113. or...
  114.  
  115. Persist x
  116.  
  117. x := 2
  118.  
  119. If you create two variables with the same name (for example, Global x and Persist x), the following statement
  120.  
  121. Persist x := 5
  122.  
  123. specifies which variable x is assigned the value 5.
  124.  
  125. <Value> any (optional)    Value assigned to <Variable> at time of declaration. For example, Persist vTest = 20. vTest equals 20 at run time.
  126.  
  127. If missing, the value of <Variable> is undefined.
  128.  
  129. enumeration := PersistAll
  130.  
  131. Syntax
  132.  
  133. (State: enumeration)
  134.  
  135. Description
  136.  
  137. Assign a macro's variables and arrays to the Persist variable table.
  138.  
  139. Persist variables are available to any PerfectFit application while PerfectFit is running.
  140.  
  141. Return Value
  142.  
  143. Off! Previous state was Off!
  144.  
  145. On! Previous state was On!
  146.  
  147. Only variables assigned values after PersistAll or declared Persist are Persist variables. Variables assigned values before PersistAll, and variables declared Local or Global, are not Persist variables. In the following example, only var6 and var7 are Persist variables:
  148.  
  149. Application(A1; "WordPerfect"; Default; "US")
  150.  
  151. Local var1; var2
  152.  
  153. var3 = 0
  154.  
  155. Global var4
  156.  
  157. Persist var7
  158.  
  159. var7 = "Persist Variable"
  160.  
  161. PersistAll
  162.  
  163. Local var5
  164.  
  165. var4 = 2
  166.  
  167. var6 = "Persist Variable"
  168.  
  169. Parameters
  170.  
  171. State: enumeration (optional)    If missing, the state defaults to On.
  172.  
  173. Off!
  174.  
  175. On!
  176.  
  177. NoChange! The current state is obtained and not changed.
  178.  
  179. numeric array: PrimeFactors
  180.  
  181. Syntax
  182.  
  183. ([Value: numeric])
  184.  
  185. Description
  186.  
  187. This command returns a list of prime factors for a specified value.
  188.  
  189. Return Value
  190.  
  191. An array containing the prime factors. If there are none, an empty array is returned.
  192.  
  193. Parameters
  194.  
  195. Value:
  196.  
  197. numeric    The value to compute the prime factors of.
  198.  
  199. numeric := pi
  200.  
  201. Description
  202.  
  203. Returns the value of pi.
  204.  
  205. Return Value
  206.  
  207. Result of pi.
  208.  
  209. Note
  210.  
  211.   The symbol for pi is. Pi equals approximately 3.14, which is the ratio of the circumference of a circle to its diameter.
  212.   
  213. Procedure <Name>label
  214.  
  215. Example
  216.  
  217. Syntax
  218.  
  219. ({[<Parameter>any]})
  220.  
  221. Description
  222.  
  223. Identify a macro subroutine that can receive one or more values from a calling statement.
  224.  
  225. Procedures contain one or more statements that execute when the procedure is called. Unlike Label subroutines, procedures do not execute unless called. A calling statement consists of the procedure's name, and can have one or more parameters that contain values passed to the procedure. Return, EndProc, or EndProcedure direct macro execution to the statement that follows the procedure's caller.
  226.  
  227. Address Mode
  228.  
  229. To change the value of a variable passed to a procedure, precede the calling statement parameter and its corresponding procedure parameter with an ampersand (&). In the following example, the value of x is 5 after calling Test:
  230.  
  231. x := 5
  232.  
  233. Test(x) // calling statement
  234.  
  235. Procedure Test(z)
  236.  
  237. z := z + 5
  238.  
  239. EndProc
  240.  
  241. In the next example, the value of x is 10 after calling Test:
  242.  
  243. x := 5
  244.  
  245. Test(&x) // calling statement
  246.  
  247. Procedure Test(&z)
  248.  
  249. z := z + 5
  250.  
  251. EndProc
  252.  
  253. The ampersand before variable x means the variable's address (location in memory) is passed to the procedure, not the variable's value. Changes made at the address of x are made to the contents of x.
  254.  
  255. The general form of a Procedure statement is:
  256.  
  257. Procedure <Name> (<Parameter>; <Parameter>)
  258.  
  259. ...statement block...
  260.  
  261. EndProc
  262.  
  263. The Syntax accepts EndProc or EndProcedure.
  264.  
  265. Parameters
  266.  
  267. <Name> label    The name of the procedure. It begins with a letter and consists of one or more letters or numbers.
  268.  
  269. {<Parameter> any} (optional)    Receive a value from a calling statement. If an ampersand precedes the calling statement variable, an ampersand must precede the corresponding procedure variable (see Address Mode above). Multiple variables are separated by a semicolon.
  270.  
  271. Procedure Prototype <Name> label
  272.  
  273. Example
  274.  
  275. Syntax
  276.  
  277. ({[<Parameter> any]})
  278.  
  279. Description
  280.  
  281. Verify the syntax of a Procedure statement (see Procedure).
  282.  
  283. If the syntax of a procedure contained in a Use macro file is incorrect and the procedure is called from the main macro, you get a run-time error but not a compile-time error. Use Procedure Prototype at the start of a main macro so that syntax errors will appear as compile-time errors instead of run-time errors.
  284.  
  285. Parameters
  286.  
  287. <Name> label    The name of the procedure. It begins with a letter and consists of one or more letters or numbers.
  288.  
  289. <Parameter> any (optional)    Receive a value from a calling statement. If an ampersand precedes the calling statement variable, an ampersand must precede the corresponding procedure variable (see Address Mode under Procedure). Multiple variables are separated by a semicolon.
  290.  
  291. numeric := Product
  292.  
  293. Syntax
  294.  
  295. ({Value: numeric})
  296.  
  297. Description
  298.  
  299. Get the product of a list of values.
  300.  
  301. Return Value
  302.  
  303. Product of a list of values.
  304.  
  305. Parameters
  306.  
  307. Value: numeric    The list of values. Separate multiple values with a semicolon.
  308.  
  309. Prompt
  310.  
  311. Example
  312.  
  313. Syntax
  314.  
  315. (Title: string; [Prompt: string]; [Style: enumeration]; [HorizontalPosition: numeric]; [VerticalPosition: numeric])
  316.  
  317. Description
  318.  
  319. Display a message box with OK and Cancel button controls. The parent of this dialog is maintained by the macro and is initially set to the application that started the macro. The dialog may be attached to a different application or window by setting a new default parent with the SetDefaultParent command.
  320.  
  321. Pause following Prompt displays a Prompt message box until the user selects OK or Cancel. OK removes the prompt and resumes macro execution. Cancel removes the prompt and creates a Cancel condition (see OnCancel).
  322.  
  323. If Prompt is not followed by Pause, the message box is displayed until an EndPrompt occurs or the macro ends. You can display only one message box at a time. Calling a second message box replaces the first.
  324.  
  325. The text displayed on the prompt dialog can be selected and copied to the clipboard.
  326.  
  327. The general form of a Prompt statement is:
  328.  
  329. Prompt (Title; Prompt; Style; HorizontalPosition; VerticalPosition)
  330.  
  331. Pause
  332.  
  333. A Prompt statement can have another form:
  334.  
  335. Prompt (Title; Prompt; Style; HorizontalPosition; VerticalPosition)
  336.  
  337. ...other statements...
  338.  
  339. EndPrompt
  340.  
  341. Example
  342.  
  343. Prompt ("No Button Example"; "Please Wait"; StopSign! | NoButtons! | Beeps!)
  344.  
  345. ...other statements...
  346.  
  347. EndPrompt()
  348.  
  349. Explanation: The prompt displays a stop-sign icon, no buttons, and beeps. It waits until other statements have executed before disappearing.
  350.  
  351. Parameters
  352.  
  353. Title: string    The text displayed in the title bar.
  354.  
  355. Prompt: string (optional)    The text displayed in the prompt box. If missing, the title is displayed as the prompt and "PerfectScript" as the title.
  356.  
  357. Style: enumeration (optional)    The icon to display to the left of Prompt. The default value is no icon. Type | between enumerations to combine styles (not all combinations are possible). The values are:
  358.  
  359. NoIcon!
  360.  
  361. QuestionMark!
  362.  
  363. InformationIcon!
  364.  
  365. ExclamationPoint!
  366.  
  367. WarningIcon! Same as ExclamationPoint!
  368.  
  369. ErrorIcon! Same as StopSign!.
  370.  
  371. Asterisk! Same as InformationIcon!
  372.  
  373. StopSign!
  374.  
  375. ApplicationIcon! Standard application icon.
  376.  
  377. WindowsLogo!
  378.  
  379. NoPause! Specifies default action (Prompt does not pause).
  380.  
  381. Pause! Prompt command pauses until a button is pressed (same as following Prompt
  382.  
  383. command with a Pause command).
  384.  
  385. Beep!
  386.  
  387. NoButtons! Show the prompt without OK and Cancel buttons. Use the EndPrompt command to remove the prompt (not the Pause command).
  388.  
  389. Buttons! Show the default buttons.
  390.  
  391. HorizontalPosition: numeric (optional)    The number of pixels from the left side of the main window to the left side of the message box. If you omit this parameter, the prompt is centered horizontally in the main window.
  392.  
  393. VerticalPosition: numeric (optional)    The number of pixels from the top of the main window to the top of the message box. If you omit this parameter, the prompt is centered vertically in the main window.
  394.  
  395. Quit
  396.  
  397. Example
  398.  
  399. Description
  400.  
  401. End a macro.
  402.  
  403. Chain does not execute if a macro ends because of Quit.
  404.  
  405.  
  406.  
  407.  
  408.  
  409.  
  410.