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

  1. string := UnitStr
  2.  
  3. Syntax
  4.  
  5. (Value: any; Units: enumeration)
  6.  
  7. Description
  8.  
  9. Convert a measurement to a character string.
  10.  
  11. If a unit of measure is not specified, the default is WordPerfect (WP) units. To change the default, use DefaultUnits. The following example converts WP units to centimeters and returns the result as a string:
  12.  
  13. Units := UnitStr(1200; Centimeters!)
  14.  
  15. Result: vUnits equals "2.540000C"
  16.  
  17. The next example converts centimeters to millimeters and returns the result as a string:
  18.  
  19. DefaultUnits(Centimeters!)
  20.  
  21. vUnits := UnitStr(1.0; Millimeters!)
  22.  
  23. Result: vUnits equals "10.000000M"
  24.  
  25. The next example converts inches to centimeters and returns the result as a string:
  26.  
  27. vUnits := UnitStr(2.0i; Centimeters!)
  28.  
  29. Result: vUnits equals "5.080000C"
  30.  
  31. See StrUnit to convert a string of numbers to a measurement expression.
  32.  
  33. Return Value
  34.  
  35. A measurement expressed as a string.
  36.  
  37. Parameters
  38.  
  39. Value: any    A real number measurement. Unless you specifiy a unit of measure, the default is WP Units. To change the default, use DefaultUnits.
  40.  
  41. Units: enumeration    The unit of measure that Value converts to.
  42.  
  43. Centimeters!
  44.  
  45. Inches!
  46.  
  47. Millimeters!
  48.  
  49. Points! (72 per inch)
  50.  
  51. WPUnits! (1200 per inch)
  52.  
  53. WP1200ths! (1200 per inch)
  54.  
  55. Until
  56.  
  57. Example
  58.  
  59. Syntax
  60.  
  61. (<Test> boolean)
  62.  
  63. Description
  64.  
  65. Specify the condition for closing a Repeat control loop. See Repeat.
  66.  
  67. Use
  68.  
  69. Example
  70.  
  71. Syntax
  72.  
  73. (<MacroFile> string)
  74.  
  75. Description
  76.  
  77. Specify a macro file with functions and/or procedures that can be called from another macro.
  78.  
  79. Use is a non-executable statement that can occur anywhere in a macro. A macro with a calling statement to a function or procedure in another macro file must include a Use statement that identifies the file.
  80.  
  81. A Use macro file that includes only function and/or procedure statements must be compiled like any macro file. Corel PerfectScript automatically compiles uncompiled Use macros. Macro execution stops if the macro will not compile.
  82.  
  83. Macro files identified by multiple Use statements are searched from first to last. Thus a parent macro always calls the first occurrence of a function or procedure with the same name in different Use files.
  84.  
  85. Parameters
  86.  
  87. <MacroFile> string    The path and name of a macro file. You cannot substitute string with a variable.
  88.  
  89. any := Value
  90.  
  91. Syntax
  92.  
  93. (<Value> any)
  94.  
  95. Description
  96.  
  97. Return the value of an enumeration or the internal product command ID value for a command.
  98.  
  99. If specifying a product command name, do not enclose the command in quotes. For example, x := Value(MessageBox).
  100.  
  101. If specifying a product command parameter enumeration, use the product command name, a period, the parameter name, a period, and the enumeration. For example, x := Value(MessageBox.Style.OKCancel!).
  102.  
  103. If using this command to obtain the value of a product command return enumeration value, specify the product command name, a period, and the return enumeration name. For example, x := Value(PersistAll.On!).
  104.  
  105. Using Value to obtain enumeration values is optional. The following syntax is also correct: x := MessageBox.Style.OKCancel! or x := PersistAll.On!
  106.  
  107. Parameters
  108.  
  109. <Value> any    An enumeration or command.
  110.  
  111. enumeration or boolean := ValueType
  112.  
  113. Syntax
  114.  
  115. (Value: any; [;Type: enumeration])
  116.  
  117. Description
  118.  
  119. Return data type information about a variable or a value.
  120.  
  121. Examples
  122.  
  123. DECLARE myName
  124.  
  125. DECLARE myAns
  126.  
  127. //*** Assign a string value to myName
  128.  
  129. myName := "Frank Jones"
  130.  
  131.  
  132.  
  133. //*** ValueType returns true
  134.  
  135. myAns = ValueType(myName; String!)
  136.  
  137.  
  138.  
  139. //*** ValueType returns false
  140.  
  141. myAns = ValueType(myName; Numeric!)
  142.  
  143. Return Value
  144.  
  145. This command returns either the type of the value or a True/False value (depending on input parameters). The possible enumerations are:
  146.  
  147. CurrentType!
  148.  
  149. Boolean!
  150.  
  151. WPString!
  152.  
  153. AnsiString!
  154.  
  155. OemString!
  156.  
  157. Float!
  158.  
  159. Integer!
  160.  
  161. DateTime!
  162.  
  163. Centimeters!
  164.  
  165. Inches!
  166.  
  167. Millimeters!
  168.  
  169. Points!
  170.  
  171. WPUnits!
  172.  
  173. RawBinary!
  174.  
  175. Object!
  176.  
  177. Parameters
  178.  
  179. Value: any    The value to be tested (any valid expression including a variable name).
  180.  
  181. Type: enumeration (optional)    The type to test for. True if Value is of the specified Type, or False if not. If missing, the data type of Value is returned.
  182.  
  183. CurrentType! Current value type
  184.  
  185. Boolean! Value must be a boolean value.
  186.  
  187. WPString! WordPerfect string.
  188.  
  189. AnsiString! ANSI string.
  190.  
  191. OemString! OEM string.
  192.  
  193. Float! Floating point value.
  194.  
  195. Integer! Integer value.
  196.  
  197. DateTime! DateTime value, stored as a numeric by the Date and Time commands. See the DateAndTime command for more information.
  198.  
  199. Centimeters! Centimeters measurement value.
  200.  
  201. Inches! Inches measurement value.
  202.  
  203. Millimeters! Millimeters measurement value.
  204.  
  205. Points! Points measurement value.
  206.  
  207. WPUnits! WP Units measurement value.
  208.  
  209. RawBinary! Raw binary measurement value
  210.  
  211. Object! OLEObject variable.
  212.  
  213. numeric := Variance
  214.  
  215. Syntax
  216.  
  217. ([Type: enumeration]; [Value: numeric])
  218.  
  219. Description
  220.  
  221. This command computes the statistical variance of a list of data values.
  222.  
  223. Return Value
  224.  
  225. The variance of the data.
  226.  
  227. Parameters
  228.  
  229. Type:
  230.  
  231. enumeration    Whether the list of data values represents the entire population of data values, or just a sample of the values. If missing, Population! is used.
  232.  
  233. Population! List is entire set of data values.
  234.  
  235. Sample! List is a sample of the entire set of data values.
  236.  
  237. Value:
  238.  
  239. numeric    The list of data values to compute the variance for.
  240.  
  241. enumeration := VarErrChk
  242.  
  243. Example
  244.  
  245. Syntax
  246.  
  247. ([State: enumeration])
  248.  
  249. Description
  250.  
  251. Determine how a macro responds to uninitialized variables, or variables not assigned a value.
  252.  
  253. Return Value
  254.  
  255. Off! Previous VarErrChk state was Off!
  256.  
  257. On! Previous VarErrChk state was On!
  258.  
  259. Parameters
  260.  
  261. State: enumeration (optional)    Specify the state of variable checking. The default is VarErrChk(On!). If missing, the current state is returned without changing it.
  262.  
  263. Off! Ignore uninitialized variables by temporarily assigning a value of 0.
  264.  
  265. On! Display a run-time Error message when a macro attempts to use an uninitialized variable, and end the macro.
  266.  
  267. string or numeric := VersionInfo
  268.  
  269. Syntax
  270.  
  271. (VersionInfo: string or enumeration; [VersionItem: enumeration][ObjectItem: enumeration)
  272.  
  273. Description
  274.  
  275. Return an item's version information.
  276.  
  277. Return Value
  278.  
  279. Version information.
  280.  
  281. Parameters
  282.  
  283. VersionInfo: string or enumeration    A filename or enumeration of a predefined item.
  284.  
  285. "<filename>" Return version information about a specified file.
  286.  
  287. PlatformVersion! Return version information about the platform.
  288.  
  289. PerfectFitVersion! Return version information about PerfectFit.
  290.  
  291. PerfectScriptVersion! Return version information about PerfectScript.
  292.  
  293. VersionItem: enumeration (optional)    The type of version information to return. If missing, FullVersion! | Numeric! is used.
  294.  
  295. FullVersion! Return the full version, including the major, minor, maintenance or build number and sub-build number.
  296.  
  297. Item to return:    MajorVersion! Return the major version number only.
  298.  
  299. MinorVersion! Return the minor version number only.
  300.  
  301. MaintenanceVersion! Return the maintenance version or build number only.
  302.  
  303. BuildNumber! Return the maintenance version or build number only.
  304.  
  305. SubBuildNumber! Return the sub-build number only.
  306.  
  307. ObjectItem: enumeration    The item that version information is requested for.
  308.  
  309. WordPerfectVersion! Return information about WordPerfect.
  310.  
  311. PresentationsVersion! Return information about Presentations.
  312.  
  313. QuattroProVersion! Return information about QuattroPro.
  314.  
  315. Format of the item to return:    Numeric! Return the item as a numeric value in the form: Mmmmnnn where M is the major version number, mmm is the minor version number (0 padded to three digits), and nnnn is the build number (0 padded to four digits).
  316.  
  317. String! Return the item as a string value in the form: "M.mm.nnn" where "M" is the major version number, "mm" is the minor version number (0 padded to two digits, and "nnn" is the build number (0 padded to three digits).
  318.  
  319. Wait
  320.  
  321. Example
  322.  
  323. Syntax
  324.  
  325. (TenthsOfSeconds: numeric)
  326.  
  327. Description
  328.  
  329. Pause macro execution.
  330.  
  331. Time is measured in tenths of a second. The maximum pause is one minute, or Wait(600).
  332.  
  333. Parameters
  334.  
  335. TenthsOfSeconds: numeric    A number from zero to 600. Divide the number by 10 to calculate the number of seconds.
  336.  
  337. While
  338.  
  339. Example
  340.  
  341. Syntax
  342.  
  343. (<Test> boolean)
  344.  
  345. Description
  346.  
  347. A loop statement that executes while the expression at the top of the loop is true.
  348.  
  349. The loop does not execute the first time unless Test is true. When Test is false, the first statement after EndWhile is executed.
  350.  
  351. Example
  352.  
  353. The general form of a While statement is:
  354.  
  355. While (<Test> boolean)
  356.  
  357. ...statement block...
  358.  
  359. EndWhile
  360.  
  361. Parameters
  362.  
  363. <Test> boolean    Evaluate to true or false.
  364.  
  365. With
  366.  
  367. Syntax
  368.  
  369. (ObjectVariable: variable)
  370.  
  371. Description
  372.  
  373. Define a local block, in which the current default product or object is temporarily changed. After EndWith, the previous default product or object is restored. With-EndWith statements can be nested, establishing nested blocks of localized default object prefixes.
  374.  
  375. Parameters
  376.  
  377. ObjectVariable: variable    New default product or object prefix for the statements inside the With block. Default prefixes can be replaced with "..", which informs the macro compiler that the method or property name following the ".." belongs to the current default prefix.
  378.  
  379. numeric := WordCount
  380.  
  381. Syntax
  382.  
  383. (String: string; [WordLength: numeric]; [SeparatorChars: string]; [Option: enumeration])
  384.  
  385. Description
  386.  
  387. Count the words in a string.
  388.  
  389. Example
  390.  
  391. str=WordCount (String:" This is an example for WordCount command"; WordLength:4; Option:CountShorter!)
  392.  
  393. MessageBox ( Caption:"Example"; Message:str; Style:OK!)
  394.  
  395. str=WordCount (String:"Thanks for using Perfect Script tool!")
  396.  
  397. MessageBox ( Caption:"Example"; Message:str; Style:OK!)
  398.  
  399. Return Value
  400.  
  401. The number of words in a string.
  402.  
  403. Parameters
  404.  
  405. String: string    The string containing words.
  406.  
  407. WordLength: numeric (optional)    The length of words to count. If missing, or less than or equal to zero, all words are counted.
  408.  
  409. SeparatorChars: string (optional)    The character(s) used to separate words. If missing, white-space characters are used.
  410.  
  411. Option: enumeration (optional)    The type of counting to perform. If missing, the value of WordLength determines which words are counted. Default: CountWords!
  412.  
  413. CountWords! See the WordLength parameter.
  414.  
  415. CountShorter! Count words shorter than the specified length.
  416.  
  417. CountLonger! Count words longer than the specified length.
  418.  
  419. ShortestLength! Return the length of the shortest word (ignore WordLength).
  420.  
  421. LongestLength! Return the length of the longest word (ignore WordLength).
  422.  
  423. AverageLength! Return the average word length (ignore WordLength).
  424.  
  425. string := WPString
  426.  
  427. Syntax
  428.  
  429. (<Value> string)
  430.  
  431. Description
  432.  
  433. Pass a value as a WordPerfect string (DLL call in-line parameter and OLE type casting function). See DLLCall and OLE Automation.
  434.  
  435. boolean := boolean XOR boolean
  436.  
  437. Description
  438.  
  439. Operator. Precedence level 9. Combine two relationship expressions.
  440.  
  441. Return Value
  442.  
  443. True if only one expression is true, or False if both are true or both are false.
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.