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

  1. SendKeys
  2.  
  3. Syntax
  4.  
  5. (KeyCode: string; [MarkupLanguage: enumeration])
  6.  
  7. Description
  8.  
  9. Send keystrokes to the application that has focus. If you combine keystrokes in a single set of braces, you must separate them with a plus operator. Enclosing single-character keystrokes in braces is optional. The SendKeys command is always processed immediately. For example,
  10.  
  11. SendKeys("{Ctrl+X}")
  12.  
  13. HardReturn
  14.  
  15. HardReturn
  16.  
  17. HardReturn
  18.  
  19. SendKeys("{Ctrl+V}")
  20.  
  21. cuts the selected text to the Clipboard (Ctrl+X), inserts three hard returns, and then pastes the contents of the clipboard. (Ctrl+V).
  22.  
  23. You can also use this command to combine several keystrokes. The following example demonstrates how to create a new file and print it by combining keystrokes.
  24.  
  25. Display(ON!)
  26.  
  27. InhibitInput(Off!)
  28.  
  29. //create a new file
  30.  
  31. sendkeys("{Alt+F}{n}")
  32.  
  33. type ("Print this document.")
  34.  
  35. wait(3)
  36.  
  37. //prints wpd file
  38.  
  39. sendkeys ("{Alt+F}{p}{enter}")
  40.  
  41. Quit
  42.  
  43. Notes
  44.  
  45.   Keys such as Alt or F1 must be enclosed in braces to specify a single keystroke.
  46.   
  47.   Make sure focus is where it should be. Most errors using SendKeys occur when keys are sent to the wrong place.
  48.   
  49. Parameters
  50.  
  51. KeyCode: string    The keystrokes to send.
  52.  
  53. {VKnnn} nnn = ANSI character number
  54.  
  55. {Alt}
  56.  
  57. {Ctrl}
  58.  
  59. {Control}
  60.  
  61. {Shift}
  62.  
  63. {0} - {9} Digits
  64.  
  65. {A} - {Z} Alphabet
  66.  
  67. {F1} - {F16} Function keys
  68.  
  69. {NumLock}
  70.  
  71. {NumAdd}
  72.  
  73. {NumSubtract}
  74.  
  75. {NumMultiply}
  76.  
  77. {NumDivide}
  78.  
  79. {NumDecimal}
  80.  
  81. {Num0} - {Num9} Numpad numbers
  82.  
  83. {Left}
  84.  
  85. {Right}
  86.  
  87. {Up}
  88.  
  89. {Down}
  90.  
  91. {PgDn}
  92.  
  93. {PageDown}
  94.  
  95. {PgUp}
  96.  
  97. {PageUp}
  98.  
  99. {Bksp}
  100.  
  101. {Backspace}
  102.  
  103. {Break} Cancel
  104.  
  105. {CapsLock}
  106.  
  107. {Clear}
  108.  
  109. {Del}
  110.  
  111. {Delete}
  112.  
  113. {End}
  114.  
  115. {Enter}
  116.  
  117. {Esc}
  118.  
  119. {Escape}
  120.  
  121. {Help} VK Help key
  122.  
  123. {Home}
  124.  
  125. {Ins}
  126.  
  127. {Insert}
  128.  
  129. {Minus}
  130.  
  131. {Pause}
  132.  
  133. {ScrLock}
  134.  
  135. {ScrollLock}
  136.  
  137. {PrintScrn}
  138.  
  139. {PrintScreen}
  140.  
  141. {Space}
  142.  
  143. {Tab}
  144.  
  145. {LeftBrace}
  146.  
  147. {RightBrace} 
  148.  
  149. MarkupLanguage: enumeration (optional)    Specify which language interprets the key codes. Default: New! The values are:
  150.  
  151. Old!
  152.  
  153. New!
  154.  
  155. boolean := SetCurrentDirectory
  156.  
  157. Example
  158.  
  159. Syntax
  160.  
  161. (DirectoryName: string)
  162.  
  163. Description
  164.  
  165. Specify a new default directory.
  166.  
  167. Return Value
  168.  
  169. Return True if successful, False if not.
  170.  
  171. Parameters
  172.  
  173. DirectoryName: string    Include the full path.
  174.  
  175. numeric := SetDefaultParent
  176.  
  177. Syntax
  178.  
  179. ([Parent: string, or enumeration})
  180.  
  181. Description
  182.  
  183. Lets you set or get the handle that you use as the parent window for the Prompt, MessageBox, GetNumber, GetString, and GetUnits commands, and Macro dialogs that don't otherwise specify a parent window.
  184.  
  185. Return Value
  186.  
  187. The previous parent window.
  188.  
  189. Parameter
  190.  
  191. Parent: string or Enumeration    The named region or the window handle of the window to be used as the new default parent for dialogs and prompts. Some enumerations have also been defined to specify certain regions. If missing, NoChange! Is used.
  192.  
  193. NoChange! Do not set a new default parent. Return the handle of the window of the current default parent.
  194.  
  195. ResetToOriginal! Restore the default parent to the original parent. The original parent is always the top-level window of the application that started the macro.
  196.  
  197.  
  198.  
  199. boolean := SetFileAttributes
  200.  
  201. Example
  202.  
  203. Syntax
  204.  
  205. (Filename: string; [Attributes: enumeration]; [Prompts: enumeration])
  206.  
  207. Description
  208.  
  209. Change file attributes.
  210.  
  211. Return Value
  212.  
  213. Return True if successful, False if not.
  214.  
  215. Parameters
  216.  
  217. Filename: string    Include the full path and filename.
  218.  
  219. Attributes: enumeration (optional)    Default: Normal!
  220.  
  221. Normal!
  222.  
  223. ReadOnly!
  224.  
  225. Hidden!
  226.  
  227. System!
  228.  
  229. Label!
  230.  
  231. Directory!
  232.  
  233. Archive!
  234.  
  235. Prompts: enumeration (optional)    Prompt if attribute does not exist. Default: NoPrompts!
  236.  
  237. NoPrompts!
  238.  
  239. Prompts!
  240.  
  241. boolean := SetFileDateAndTime
  242.  
  243. Example
  244.  
  245. Syntax
  246.  
  247. (Filename: string; [DateAndTime: numeric])
  248.  
  249. Description
  250.  
  251. Change the date and time a file was last written to.
  252.  
  253. Return Value
  254.  
  255. Return True if successful, False if not.
  256.  
  257. Parameters
  258.  
  259. Filename: string    Include the full path and filename.
  260.  
  261. DataType:    The type of date and time to set. If missing, ModificationDateTime! is used.
  262.  
  263. CreationDateTime! Set the date and time the file was created.
  264.  
  265. LastAccessDateTime! Set the date and time the file was last accessed.
  266.  
  267. ModificationDateTime! Set the date and time the file was last moi
  268.  
  269. DateAndTime: numeric (optional)    This value is returned from DateAndTime.
  270.  
  271. numeric := Sign
  272.  
  273. Syntax
  274.  
  275. (Value: numeric)
  276.  
  277. Description
  278.  
  279. Return the sign of a value.
  280.  
  281. Return Value
  282.  
  283. Return -1 if Value is less than 0, 0 if Value equals 0, and 1 if Value is greater than 0.
  284.  
  285. Parameters
  286.  
  287. Value: numeric    Return the sign of this value.
  288.  
  289. numeric := sin
  290.  
  291. Syntax
  292.  
  293. (Angle: numeric)
  294.  
  295. Description
  296.  
  297. Get the sine of an angle in radians.
  298.  
  299. Return Value
  300.  
  301. Sine of an angle in radians.
  302.  
  303. Parameters
  304.  
  305. Angle: numeric    The angle in radians.
  306.  
  307. numeric := sinh
  308.  
  309. Syntax
  310.  
  311. (Angle: numeric)
  312.  
  313. Description
  314.  
  315. Get the hyperbolic sine of an angle in radians.
  316.  
  317. Return Value
  318.  
  319. Hyperbolic sine of an angle in radians.
  320.  
  321. Parameters
  322.  
  323. Angle: numeric    The angle in radians.
  324.  
  325. numeric := SizeOf
  326.  
  327. Syntax
  328.  
  329. (Value: any)
  330.  
  331. Description
  332.  
  333. Get the size needed to store a specified data value.
  334.  
  335. This command is mostly used with BinaryPack and BinaryUnpack.
  336.  
  337. Return Value
  338.  
  339. Size needed to store a specified data value.
  340.  
  341. Parameters
  342.  
  343. Value: any (optional)    The value to compute the size of. If missing, the size of the Corel PerfectScript system overhead for storing a value is returned.
  344.  
  345. Speed
  346.  
  347. Example
  348.  
  349. Syntax
  350.  
  351. (TenthsOfSeconds: numeric)
  352.  
  353. Description
  354.  
  355. Slow macro execution.
  356.  
  357. Time is measured in tenths of a second. Speed(0) runs at maximum speed. Speed(5) delays a macro one-half second between statements. The maximum delay is one minute or Speed(600). The following example delays one second between beeps.
  358.  
  359. Return Value
  360.  
  361. The current speed delay value is returned.
  362.  
  363. Speed(10)
  364.  
  365. Beep
  366.  
  367. Beep
  368.  
  369. Beep
  370.  
  371. Parameters
  372.  
  373. TenthsOfSeconds: numeric
  374.  
  375. (optional)    The new speed delay value. If missing, the speed delay is not changed, and the current value is returned. A number from zero to 600. Divide the number by 10 to calculate the number of seconds.
  376.  
  377. numeric := SquareRoot
  378.  
  379. Syntax
  380.  
  381. (Value: numeric)
  382.  
  383. Description
  384.  
  385. Get the square root of a value.
  386.  
  387. Return Value
  388.  
  389. Square root.
  390.  
  391. Parameters
  392.  
  393. Value: numeric    The value must be greater than or equal to 0.0.
  394.  
  395. numeric: StdDev
  396.  
  397. Syntax
  398.  
  399. ([Type: enumeration]; [Value: numeric])
  400.  
  401. Description
  402.  
  403. This command computes the statistical standard deviation of a list of data values.
  404.  
  405. Return Value
  406.  
  407. The standard deviation of the data.
  408.  
  409. Parameters
  410.  
  411. Type:
  412.  
  413. enumeration    Whether the list of data values represents the entire popluation of data values or just a sample of the data values. If missing, Population! is used.
  414.  
  415. Population! List is the entire set of data values.
  416.  
  417. Sample! List represents a sample of all data values.
  418.  
  419. Value:
  420.  
  421. numeric    The list of data values to compute the standard deviation for.
  422.  
  423. Step
  424.  
  425. Syntax
  426.  
  427. (State: enumeration)
  428.  
  429. Description
  430.  
  431. Turn on Macro Debugger single stepping.
  432.  
  433. See Corel PerfectScript for Help on the debugger itself.
  434.  
  435. Parameters
  436.  
  437. State: enumeration    Off!
  438.  
  439. On!
  440.  
  441. string := String
  442.  
  443. Syntax
  444.  
  445. (<Value> string)
  446.  
  447. Description
  448.  
  449. Pass a value as an ANSI string (DLL call in-line parameter function and OLE type casting function). See DLLCall and OLE Automation.
  450.  
  451. string := StrFill
  452.  
  453. Syntax
  454.  
  455. (Count: numeric; [String: string])
  456.  
  457. Description
  458.  
  459. Fill (replicate) a string a specified number of times.
  460.  
  461. Examples
  462.  
  463. vStr := StrFill (2; "PerfectScript")
  464.  
  465. MessageBox (x; "StrFill"; "..." + vStr + "...")
  466.  
  467. Result: ...PerfectScriptPerfectScript...
  468.  
  469. vStr := StrFill (2)
  470.  
  471. MessageBox (x; "StrFill"; "..." + vStr + "...")
  472.  
  473. Result: ... ...
  474.  
  475. Return Value
  476.  
  477. Replicated string.
  478.  
  479. Parameters
  480.  
  481. Count: numeric    The number of times to duplicate String. If Count is less than or equal to zero, an empty ("") string is returned.
  482.  
  483. String: string (optional)    The string to repeat. If String is missing, spaces are used.
  484.  
  485. numeric := StrFraction
  486.  
  487. Syntax
  488.  
  489. (String: string)
  490.  
  491. Description
  492.  
  493. Get the numeric value of a string representing a fraction.
  494.  
  495. Examples
  496.  
  497. vFrac := StrFraction ("1/2")
  498.  
  499. Result: vFrac = 0.5
  500.  
  501. vFrac := StrFraction ("187 7/8")
  502.  
  503. Result: 187.875
  504.  
  505. Return Value
  506.  
  507. Numeric value of a string representing a fraction.
  508.  
  509. Parameters
  510.  
  511. String: string    The string to convert. The form of the string is "n/n" or "n n/n".
  512.  
  513. string := StrInsert
  514.  
  515. Syntax
  516.  
  517. (String: string; [SubString: string]; [Beginning: numeric]; [NumberOfChars: numeric])
  518.  
  519. Description
  520.  
  521. Insert a substring into a string, replace characters in a string, or remove characters from a string.
  522.  
  523. Examples
  524.  
  525. vStr := StrInsert ("Corel Corporation"; ""; 6; 12)
  526.  
  527. MessageBox (x; "StrInsert"; "..." + vStr + "...")
  528.  
  529. Result: ...Corel...
  530.  
  531. vStr := StrInsert ("Corel Corporation"; "anada"; 8; -1)
  532.  
  533. MessageBox (x; "StrInsert"; "..." + vStr + "...")
  534.  
  535. Result: ...Corel Canada...
  536.  
  537. vStr := StrInsert ("Corel Corpxxxtion"; "ora"; 11; 3)
  538.  
  539. MessageBox (x; "StrInsert"; "..." + vStr + "...")
  540.  
  541. Result: ...Corel Corporation...
  542.  
  543. Return Value
  544.  
  545. The modified string.
  546.  
  547. Parameters
  548.  
  549. String: string    The original string.
  550.  
  551. SubString: string (optional)    The string to insert into String. If missing, characters are removed from String.
  552.  
  553. Beginning: numeric (optional)    The starting position for inserting SubString, or for removing characters from String. If missing, the starting position is the end of the string. If less than zero, the starting position is the absolute value taken from the end of the string. See the example above.
  554.  
  555. NumberOfChars: numeric (optional)    The number of characters replaced by SubString. If SubString is missing, the number of characters to remove from String. If NumberOfChars is missing or equal to zero, no characters are removed. If less than zero, all characters from the starting position to the right are either replaced by SubString or removed.
  556.  
  557. boolean := StrIsChar
  558.  
  559. Syntax
  560.  
  561. (String: string; [Position: numeric]; [Option: enumeration]; [CharSet: string or enumeration])
  562.  
  563. Description
  564.  
  565. Determine whether a string or character is of a specified type.
  566.  
  567. Return Value
  568.  
  569. True if String is of type CharSet, False if not.
  570.  
  571. Parameters
  572.  
  573. String: string    The string to test.
  574.  
  575. Position: numeric (optional)    The position of a character to test. If missing or 0, all characters are tested. If greater than the length of String, False is returned. If less than 0, the starting position is the absolute value taken from the end of the string (-1 tests the last character in the string, -2 the second to last character, and so forth).
  576.  
  577. Option: enumeration (optional)    Specify matching criteria. If missing, EqualTo! is used. If CharSet is also missing, NotEqualTo! is used and WhiteSpace! is used for CharSet.
  578.  
  579. EqualTo! Test for a character in the specified character set.
  580.  
  581. NotEqualTo! Test for a character that is not in the specified character set.
  582.  
  583. CharSet: string or enumeration (optional)    The set of characters to test. If missing, WhiteSpace! is used. CharSet may be a user-defined character set, specified as a character string expression such as "abcdef", or any combination of the character sets listed below. Type | between enumerations to combine character sets.
  584.  
  585. Alphabetic!
  586.  
  587. AlphaNumeric!
  588.  
  589. Numeric!
  590.  
  591. Punctuation!
  592.  
  593. WhiteSpace!
  594.  
  595. UpperCase!
  596.  
  597. LowerCase!
  598.  
  599. string := StrLeft
  600.  
  601. Syntax
  602.  
  603. (String: string; [Length: numeric])
  604.  
  605. Description
  606.  
  607. Get the left part of a string.
  608.  
  609. Examples
  610.  
  611. vStr := StrLeft ("Corel Corporation"; 5)
  612.  
  613. MessageBox (x; "StrLeft"; "..." + vStr + "...")
  614.  
  615. Result: ...Corel...
  616.  
  617. vStr := StrLeft ("Corel Corporation ")
  618.  
  619. MessageBox (x; "StrLeft"; "..." + vStr + "...")
  620.  
  621. Result: ...Corel Corporation...
  622.  
  623. Return Value
  624.  
  625. Left part of a string.
  626.  
  627. Parameters
  628.  
  629. String: string    The original string.
  630.  
  631. Length: numeric (optional)    The length of string to return from the left side. If Length is greater than String length, the original string is returned. If Length is 0, an empty ("") string is returned. If Length is missing, or less than or equal to zero, leading whitespace is removed.
  632.  
  633. numeric := StrLen
  634.  
  635. Example
  636.  
  637. Syntax
  638.  
  639. (String: string)
  640.  
  641. Description
  642.  
  643. Return the number of characters in a string.
  644.  
  645. The string can be a variable, constant, character string, or result of an expression.
  646.  
  647. Examples
  648.  
  649. vWord := "WordPerfect"
  650.  
  651. vNumber := StrLen(vWord)
  652.  
  653. Result: vNumber equals 11
  654.  
  655. vNumber := StrLen(45899)
  656.  
  657. Result: vNumber equals 5
  658.  
  659. vNumber := StrLen("WordPerfect")
  660.  
  661. Result: vNumber equals 11
  662.  
  663. vNumber := StrLen(9 + 9)
  664.  
  665. Result: vNumber equals 2
  666.  
  667. Return Value
  668.  
  669. The number of characters in a string.
  670.  
  671. Parameters
  672.  
  673. String: string    A variable, constant, character string, or result of an expression.
  674.  
  675. string := StrMakeList
  676.  
  677. Syntax
  678.  
  679. ([Separator: string] [; {SubString: string}])
  680.  
  681. Description
  682.  
  683. Return a list of substrings.
  684.  
  685. Return Value
  686.  
  687. The string list of SubString items.
  688.  
  689. Example
  690.  
  691. Type(StrMakeList(Separator:"***"; SubString:"one"; "two"; "three"; "four"))
  692.  
  693. Result: one***two***three***four
  694.  
  695. Parameters
  696.  
  697. Separator: string (optional)    The string to insert between SubString items. If missing, ";" is used.
  698.  
  699. Type:
  700.  
  701. enumeration    If a type is specified, the return value is a boolean indicating if the specified value is of the specified type. If missing, CurrentType! Is used.
  702.  
  703. CurrentType! The actual type of the specified value parameter is returned instead of a boolean value.
  704.  
  705. SubString: string (repeating)
  706.  
  707. [optional]    The repeating group of items from which to make a list. If missing, returns an empty string.
  708.  
  709. string := StrNum
  710.  
  711. Example
  712.  
  713. Syntax
  714.  
  715. (String: string)
  716.  
  717. Description
  718.  
  719. Convert a character string of numbers to a numeric equivalent.
  720.  
  721. Return Value
  722.  
  723. A number.
  724.  
  725. Examples
  726.  
  727. vNum := StrNum("123")
  728.  
  729. Result: vNum = 123
  730.  
  731. vNum := StrNum("123.5")
  732.  
  733. Result: vNum = 123.5
  734.  
  735. vNum := StrNum("9 + 9")
  736.  
  737. Result: vNum = 9
  738.  
  739. Parameters
  740.  
  741. String: string    Contains a character string of numbers. StrNum recognizes the decimal point defined by the sDecimal setting in the [intl] section of the Windows WIN.INI file. Alphabetic characters, operators, punctuation marks, and everything that follows them are ignored.
  742.  
  743. string := StrPad
  744.  
  745. Syntax
  746.  
  747. (String: string; Length: numeric; [Option: enumeration]; [PadString: string])
  748.  
  749. Description
  750.  
  751. Pad (lengthen) a string to a specified length.
  752.  
  753. Examples
  754.  
  755. In the following examples, PadString consists of numbers to illustrate the command. Any string of characters, including spaces, could have been used.
  756.  
  757. vPad := StrPad ("Corel"; 15; PadRight!; "12345")
  758.  
  759. MessageBox (x; "StrPad"; vPad)
  760.  
  761. Result: Corel1234512345
  762.  
  763. vPad := StrPad ("Corel"; 15; PadLeft!; "12345")
  764.  
  765. MessageBox (x; "StrPad"; vPad)
  766.  
  767. Result: 1234512345Corel
  768.  
  769. vPad := StrPad ("Corel"; 15; PadEnds!; "12345")
  770.  
  771. MessageBox (x; "StrPad"; vPad)
  772.  
  773. Result: 12345Corel12345
  774.  
  775. vPad := StrPad ("Corel products are great"; 30; PadWords!; "o")
  776.  
  777. MessageBox (x; "StrPad"; vPad)
  778.  
  779. Result: Coooorel prooooducts are great
  780.  
  781. Return Value
  782.  
  783. The padded string.
  784.  
  785. Parameters
  786.  
  787. String: string    The string to be padded.
  788.  
  789. Length: numeric    The final length of the padded string. If the length is less than or equal to zero, or less than the length of String, the original string is returned.
  790.  
  791.  
  792.  
  793. Option: enumeration (optional)    Specify where padding is to be added. Default: PadRight!
  794.  
  795. PadRight! Pad the end of the string.
  796.  
  797. PadLeft! Pad the front of the string.
  798.  
  799. PadEnds! Pad both ends, centering the string.
  800.  
  801. PadWords! Spread the padding between words, expanding String to the specified length. Words must be separated by a character in PadString, or PadEnds! is used.
  802.  
  803. PadString: string (optional)    Multiples of characters in this string pad String to the specified length. PadString may be any string of characters (it is not limited to a single character). If missing, spaces are used. If the string is empty (""), no padding is done. See the examples above.
  804.  
  805. array := StrParseList
  806.  
  807. Syntax
  808.  
  809. (String: string; [Separators: string or enumeration]; [Option: enumeration])
  810.  
  811. Description
  812.  
  813. Parse a string list into substrings.
  814.  
  815. Example
  816.  
  817. Type(StrParseList(String: "one, two, three, four"; Separators: Punctuation!; Option: Strings!))
  818.  
  819. Result: one two three four
  820.  
  821. Return Value
  822.  
  823. The array of substrings (a substring occupies each array element).
  824.  
  825. Parameters
  826.  
  827. String: string    The string to parse.
  828.  
  829. Separators: string or enumeration (optional)    Characters or a string that separate(s) the substrings in String. This parameter is either a string of characters or an enumeration that specifies any combination of predefined character sets. It represents individual characters, all of which are used to separate substrings, or as a string (see the Option parameter). If missing, ";" is used.
  830.  
  831. Punctuation! Separator characters are the set of punctuation characters.
  832.  
  833. WhiteSpace! Separator charactes are the set of whitespace characters.
  834.  
  835. Option: enumeration (optional)    Lets you specify how to interpret the Separators parameter. If missing, and Separators is a predefined character set, Characters! is used. Otherwise, Strings! is used.
  836.  
  837. Characters! Any number of individual characters separates substrings in String (see the Separator parameter). Ignores multiple separators.
  838.  
  839. Strings! An entire string of characters separates substrings in String.
  840.  
  841. Note
  842.  
  843.   In previous versions of PerfectScript, when there was no data to be returned, a single element array with either a numeric value of 0 or a string value of "" was returned. Now, when there is no data to be returned, an empty array is returned.
  844.   
  845. numeric := StrPos
  846.  
  847. Example
  848.  
  849. Syntax
  850.  
  851. (String: string; SubString: string; [Beginning: numeric])
  852.  
  853. Description
  854.  
  855. Determine whether a character string is also a substring.
  856.  
  857. Examples
  858.  
  859. vPos := StrPos("WordPerfect"; "Perfect")
  860.  
  861. Result: vPos = 5
  862.  
  863. vPos := StrPos("WordPerfect"; "Scott")
  864.  
  865. Result: vPos = 0
  866.  
  867. vPos := CharPos("WordPerfect"; "or"; 7)
  868.  
  869. Result: vPos = 8
  870.  
  871. Explanation: Search begins at character position 7, bypassing the first occurrence of the substring.
  872.  
  873. Return Value
  874.  
  875. The beginning position of a substring, or zero if a substring is not found.
  876.  
  877. Parameters
  878.  
  879. String: string    A character string to evaluate.
  880.  
  881. Substring: string    A substring to locate in String parameter.
  882.  
  883. Beginning: numeric (optional)
  884.  
  885. Default: 1. Begin looking for Substring at this character position (see the example above).
  886.  
  887. string := StrReverse
  888.  
  889. Syntax
  890.  
  891. (String: string)
  892.  
  893. Description
  894.  
  895. Reverse all characters in a string.
  896.  
  897. Return Value
  898.  
  899. The string in reverse character order.
  900.  
  901. Parameters
  902.  
  903. String: string    The original string.
  904.  
  905. string := StrRight
  906.  
  907. Syntax
  908.  
  909. (String: string; [Length: numeric])
  910.  
  911. Description
  912.  
  913. Get the right part of a string.
  914.  
  915. Examples
  916.  
  917. vStr := StrRight ("Corel Products"; 8)
  918.  
  919. MessageBox (x; "StrRight"; "..." + vStr + "...")
  920.  
  921. Result: ...Products...
  922.  
  923. vStr := StrRight (" Corel Products")
  924.  
  925. MessageBox (x; "StrRight"; "..." + vStr + "...")
  926.  
  927. Result: ...Corel Products...
  928.  
  929. Return Value
  930.  
  931. Right part of a string.
  932.  
  933. Parameters
  934.  
  935. String: string    The original string.
  936.  
  937. Length: numeric (optional)    The length of the string to return from the right side. If Length is greater than String length, the original string is returned. If Length is 0, an empty ("") string is returned. If Length is missing, or less than or equal to zero, leading whitespace is removed.
  938.  
  939. numeric := StrScan
  940.  
  941. Syntax
  942.  
  943. (String: string; [Beginning: numeric]; [Option: enumeration]; [CharSet: string or enumeration])
  944.  
  945. Description
  946.  
  947. Return the index (position) of the first matching or non-matching character.
  948.  
  949. Return Value
  950.  
  951. If no matching or non-matching characters are found, the length of String plus 1 is returned (or 0 if scan was reversed).
  952.  
  953. Parameters
  954.  
  955. String: string    The string to scan.
  956.  
  957. Beginning: numeric (optional)    The position at which to start the scan. If missing or zero, the starting position is 1. If less than zero, the starting position is the absolute value taken from the end of the string, scanning backwards.
  958.  
  959. Option: enumeration (optional)    Specify matching criteria. If missing, EqualTo! is used. If CharSet is also missing, NotEqualTo! is used and WhiteSpace! is used for CharSet.
  960.  
  961. EqualTo! Scan until a character in the specified character set is found.
  962.  
  963. NotEqualTo! Scan until a character not in the specified character set is found.
  964.  
  965. CharSet: any (optional)    The set of characters to match or skip over. If missing, WhiteSpace! is used. CharSet may be a user-defined character set, specified as a character string expression such as "abcdef," or any combination of the predefined character sets listed below. Type | between enumerations to combine character sets.
  966.  
  967. Alphabetic!
  968.  
  969. AlphaNumeric!
  970.  
  971. Numeric!
  972.  
  973. Punctuation!
  974.  
  975. WhiteSpace!
  976.  
  977. UpperCase!
  978.  
  979. LowerCase!
  980.  
  981. string := StrToChars
  982.  
  983. Syntax
  984.  
  985. (String: string; [Option: enumeration]; [CharSet: string or enumeration])
  986.  
  987. Description
  988.  
  989. Remove characters from a string.
  990.  
  991. Examples
  992.  
  993. vStr := StrToChars ("Win95!"; Remove!; Alphabetic! | Punctuation!)
  994.  
  995. MessageBox (x; "StrToChars"; vStr)
  996.  
  997. Result: vStr = 95
  998.  
  999. vStr := StrToChars ("Win95!"; Keep!; Alphabetic! | Punctuation!)
  1000.  
  1001. MessageBox (x; "StrToChars"; vStr)
  1002.  
  1003. Result: vStr = Win!
  1004.  
  1005. vStr := StrToChars ("Win95!"; Keep!; "95")
  1006.  
  1007. MessageBox (x; "StrToChars"; vStr)
  1008.  
  1009. Result: vStr = 95
  1010.  
  1011. Return Value
  1012.  
  1013. Transformed string.
  1014.  
  1015. Parameters
  1016.  
  1017. String: string    The original string.
  1018.  
  1019. Option: enumeration (optional)    Specify whether characters are to be kept or removed. If missing, Keep! is used. If CharSet is also missing, Remove! is used and WhiteSpace! is used for CharSet.
  1020.  
  1021. Keep! Keep specified characters, remove all others.
  1022.  
  1023. Remove! Remove specified characters.
  1024.  
  1025. CharSet: string or enumeration (optional)    The set of characters to keep or remove. If missing, WhiteSpace! is used. CharSet may be a user-defined character set, specified as a character string expression such as "abcdef," or any combination of the predefined character sets listed below. Type | between enumerations to combine character sets.
  1026.  
  1027. Alphabetic!
  1028.  
  1029. AlphaNumeric!
  1030.  
  1031. Numeric!
  1032.  
  1033. Punctuation!
  1034.  
  1035. WhiteSpace!
  1036.  
  1037. UpperCase!
  1038.  
  1039. LowerCase!
  1040.  
  1041. string := StrTransform
  1042.  
  1043. Syntax
  1044.  
  1045. (String: string; FromChars: string; [ToChars: string]; [Options: enumeration])
  1046.  
  1047. Description
  1048.  
  1049. Convert a string of characters into other characters.
  1050.  
  1051. Return Value
  1052.  
  1053. Transformed string.
  1054.  
  1055. Parameters
  1056.  
  1057. String: string    The string to transform.
  1058.  
  1059. FromChars: string    The characters in String to transform.
  1060.  
  1061. ToChars: string (optional)    The replacement characters. There is a one-to-one correspondence between FromChars and ToChars. Characters in String that are in FromChars are replaced by characters in ToChars in the equivalent positions. For example, the result of
  1062.  
  1063. vStr := StrTransform ("12345"; "2345"; "xxxx")
  1064.  
  1065. is that "1xxxx" is returned in vStr. If ToChars is missing or shorter than FromChars, all characters are removed from String that match characters in FromChars but have no corresponding character in ToChars.
  1066.  
  1067. Options: enumeration (optional)    Control the interpretation of FromChars and ToChars, and how many transformations are performed. Default: Characters! | All!
  1068.  
  1069. Characters! Transform characters independently.
  1070.  
  1071. Strings! Transform the string of characters as a whole.
  1072.  
  1073. FirstOnly! Transform only the first occurrence of characters in FromChars.
  1074.  
  1075. All! Transform all occurrences of characters in FromChars. Use a number to specify a specific number of occurrences to transform.
  1076.  
  1077. string := StrTrim
  1078.  
  1079. Syntax
  1080.  
  1081. (String: string; [Length: numeric]; [Option: enumeration]; [TrimChars: string or enumeration])
  1082.  
  1083. Description
  1084.  
  1085. Trim (remove) characters from a string.
  1086.  
  1087. Return Value
  1088.  
  1089. The string trimmed of characters to a specified length.
  1090.  
  1091. Parameters
  1092.  
  1093. String: string    The string to be trimmed.
  1094.  
  1095.  Length: numeric (optional)    The final length of the trimmed string. If Length is greater than the length of String, no trimming is done and the original string is returned. If Length is missing, or less than or equal to zero, String is trimmed until all matching characters are removed at specified locations (see Options). If the length of String after trimming exceeds Length, no further trimming is done.
  1096.  
  1097. Option: enumeration (optional)    Specify where String is to be trimmed. Characters matching TrimChars are removed from specified locations until Length is reached, or until no more matching characters are found. Default: TrimRight!
  1098.  
  1099. TrimRight! Trim characters from the end of the string.
  1100.  
  1101. TrimLeft! Trim characters from the front of the string.
  1102.  
  1103. TrimEnds! Trim characters from both ends, centering the string.
  1104.  
  1105. TrimWords! Trim multiple characters within String, reducing String to specified length. If the length of String still exceeds Length after trimming multiple characters, the ends are trimmed like TrimEnds!
  1106.  
  1107. TrimChars: string or enumeration (optional)    The characters to be trimmed from String (all matching characters are removed). If missing, WhiteSpace! is used. TrimChars may be a user-defined character set, specified as a character string expression such as "abcdef," or any combination of the predefined character sets listed below. If TrimChars is empty (""), no trimming is done. Type | between enumerations to combine character sets.
  1108.  
  1109. Alphabetic!
  1110.  
  1111. AlphaNumeric!
  1112.  
  1113. Numeric!
  1114.  
  1115. Punctuation!
  1116.  
  1117. WhiteSpace!
  1118.  
  1119. UpperCase!
  1120.  
  1121. LowerCase!
  1122.  
  1123. string := Structure
  1124.  
  1125. Syntax
  1126.  
  1127. (<Value> string)
  1128.  
  1129. Description
  1130.  
  1131. Pass a value as a C struct (DLL call in-line parameter function and OLE type casting function). See DLLCall and OLE Automation.
  1132.  
  1133. numeric := StrUnit
  1134.  
  1135. Example
  1136.  
  1137. Syntax
  1138.  
  1139. (String: string)
  1140.  
  1141. Description
  1142.  
  1143. Convert a string of numbers to a measurement.
  1144.  
  1145. The string may contain a number, an arithmetic expression that results in a number, or a character string of numbers. If a character string is used, alphabetic characters (except units of measure), operators, and punctuation marks are ignored. The default unit of measure is WordPerfect units. You can change the default using DefaultUnits, or by specifying a unit of measure as part of the character string.
  1146.  
  1147. Examples
  1148.  
  1149. DefaultUnits(Centimeters)
  1150.  
  1151. vUnit := STRunIT(9)
  1152.  
  1153. Result: vUnit equals 9.C
  1154.  
  1155. vUnit := "equals " + StrUnit(4+3)
  1156.  
  1157. Result: vUnit equals 7.C
  1158.  
  1159. vUnit := "equals " + StrUnit("10")
  1160.  
  1161. Result: vUnit equals 10.C
  1162.  
  1163. vUnit := "equals " + StrUnit("10abc")
  1164.  
  1165. Result: vUnit equals 10.C
  1166.  
  1167. vUnit := "equals " + StrUnit("10i")
  1168.  
  1169. Result: vUnit equals 10I
  1170.  
  1171. The units of measure are:
  1172.  
  1173. " inches
  1174.  
  1175. i inches
  1176.  
  1177. c centimeters
  1178.  
  1179. m millimeters
  1180.  
  1181. p points (72 per inch)
  1182.  
  1183. w WP units (1200 per inch)
  1184.  
  1185. Return Value
  1186.  
  1187. A unit of measure.
  1188.  
  1189. Parameters
  1190.  
  1191. String: string    A number or character string of numbers.
  1192.  
  1193. string := SubChar
  1194.  
  1195. Example
  1196.  
  1197. Syntax
  1198.  
  1199. (String: string; Beginning: numeric; [NumberOfChars: numeric])
  1200.  
  1201. Description
  1202.  
  1203. Extract a substring from a character string.
  1204.  
  1205. Use CharPos to locate a substring.
  1206.  
  1207. Return Value
  1208.  
  1209. A character string.
  1210.  
  1211. // vSub = "Word"
  1212.  
  1213. vSub := SubChar("WordPerfect"; 1; 4)
  1214.  
  1215. Parameters
  1216.  
  1217. String: string    A character string to evaluate.
  1218.  
  1219. Beginning: numeric    The starting position of a substring. Negative numbers begin from the end of the string (-1 is the last character).
  1220.  
  1221. NumberOfChars: numeric (optional)    The number of characters to extract. If missing, the rest of the string is extracted.
  1222.  
  1223. string := SubStr
  1224.  
  1225. Example
  1226.  
  1227. Syntax
  1228.  
  1229. (String: string; Beginning: numeric; [NumberOfChars: numeric])
  1230.  
  1231. Description
  1232.  
  1233. Extract a substring from a character string.
  1234.  
  1235. Use StrPos to locate a substring.
  1236.  
  1237. Return Value
  1238.  
  1239. A character string.
  1240.  
  1241. // vSub = "Word"
  1242.  
  1243. vSub := SubStr("WordPerfect"; 1; 4)
  1244.  
  1245. Parameters
  1246.  
  1247. String: string    A character string to evaluate.
  1248.  
  1249. Beginning: numeric    The starting position of a substring. Negative numbers begin from the end of the string (-1 is the last character).
  1250.  
  1251. NumberOfChars: numeric (optional)    The number of characters to extract. If missing, the rest of the string is extracted.
  1252.  
  1253. numeric := Sum
  1254.  
  1255. Syntax
  1256.  
  1257. ({Value: numeric})
  1258.  
  1259. Description
  1260.  
  1261. Get the sum of a list of values.
  1262.  
  1263. Example
  1264.  
  1265. x= Sum (2.3; 5 ;3.7)
  1266.  
  1267. MessageBox ( Caption:"Example"; Message: "Sum (2.3; 5; 3.7) = " + x; Style:OK!)
  1268.  
  1269. Return Value
  1270.  
  1271. Sum of a list of values.
  1272.  
  1273. Parameters
  1274.  
  1275. Value: numeric    The list of values. Separate multiple values with a semicolon.
  1276.  
  1277. Switch
  1278.  
  1279. Example
  1280.  
  1281. Syntax
  1282.  
  1283. (<Test> any)
  1284.  
  1285. Description
  1286.  
  1287. A conditional statement that tests for matching expressions. If a match is found, a statement (or statement block) is executed.
  1288.  
  1289. If Test matches Selector, the statement block that follows Selector is executed and no other evaluation is made. Test and Selector are case sensitive and must match exactly.
  1290.  
  1291. If Continue follows an executed statement block, the next statement block is automatically executed. Continue is optional.
  1292.  
  1293. The DEFAULT statement block is executed if no Selector matches Test. DEFAULT is optional. If no match is found and DEFAULT is not used, the macro continues to the first statement after EndSwitch.
  1294.  
  1295. If Break occurs in a state block, the macro continues to the first statement after EndSwitch.
  1296.  
  1297. EndSwitch closes a Switch statement.
  1298.  
  1299. The general form of a Switch statement is:
  1300.  
  1301. Switch (<Test>)
  1302.  
  1303. CaseOF <Selector>:
  1304.  
  1305. ...statement block...
  1306.  
  1307. Continue
  1308.  
  1309. CaseOF <Selector>; <Selector>:
  1310.  
  1311. ...statement block...
  1312.  
  1313. Default:
  1314.  
  1315. ...statement block...
  1316.  
  1317. EndSwitch
  1318.  
  1319. Parameters
  1320.  
  1321. <Test> any    The control expression. Variables are assigned values by commands such as GetString, GetNumber, or Menu.
  1322.  
  1323. <Selector> any    An expression (variable, constant, character) with a value that is usually assigned before the macro is compiled. It is possible to assign the value at run-time. Selector always follows a CaseOF statement.
  1324.  
  1325.  
  1326.  
  1327.  
  1328.  
  1329.  
  1330.