PageRenderTime 74ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/help/Strings.dtx

https://github.com/the-Arioch/jcl
Unknown | 3950 lines | 3883 code | 67 blank | 0 comment | 0 complexity | 01a9e65177b17ca7d571de1c5b8116a5 MD5 | raw file
Possible License(s): BSD-3-Clause
  1. @@StringManipulation.CharacterSearchandReplace
  2. <GROUP StringManipulation>
  3. <TITLE Character Search and Replace>
  4. <TOPICORDER 100>
  5. --------------------------------------------------------------------------------
  6. @@StringManipulation.CharacterTestRoutines
  7. <GROUP StringManipulation>
  8. <TITLE Character Test Routines>
  9. <TOPICORDER 200>
  10. --------------------------------------------------------------------------------
  11. @@StringManipulation.CharacterTransformationRoutines
  12. <GROUP StringManipulation>
  13. <TITLE Character Transformation Routines>
  14. <TOPICORDER 300>
  15. --------------------------------------------------------------------------------
  16. @@StringManipulation.Miscellaneous
  17. <GROUP StringManipulation>
  18. <TITLE Miscellaneous>
  19. <TOPICORDER 400>
  20. --------------------------------------------------------------------------------
  21. @@StringManipulation.MultiSz
  22. <GROUP StringManipulation>
  23. <TITLE MultiSz>
  24. <TOPICORDER 500>
  25. --------------------------------------------------------------------------------
  26. @@StringManipulation.PCharVector
  27. <GROUP StringManipulation>
  28. <TITLE PCharVector>
  29. <TOPICORDER 600>
  30. --------------------------------------------------------------------------------
  31. @@StringManipulation.StringExtraction
  32. <GROUP StringManipulation>
  33. <TITLE String Extraction>
  34. <TOPICORDER 700>
  35. --------------------------------------------------------------------------------
  36. @@StringManipulation.StringManagement
  37. <GROUP StringManipulation>
  38. <TITLE String Management>
  39. <TOPICORDER 800>
  40. --------------------------------------------------------------------------------
  41. @@StringManipulation.StringSearchandReplaceRoutines
  42. <GROUP StringManipulation>
  43. <TITLE String Search and Replace Routines>
  44. <TOPICORDER 900>
  45. --------------------------------------------------------------------------------
  46. @@StringManipulation.StringTestRoutines
  47. <GROUP StringManipulation>
  48. <TITLE String Test Routines>
  49. <TOPICORDER 1000>
  50. --------------------------------------------------------------------------------
  51. @@StringManipulation.StringTransformationRoutines
  52. <GROUP StringManipulation>
  53. <TITLE String Transformation Routines>
  54. <TOPICORDER 1100>
  55. --------------------------------------------------------------------------------
  56. @@StringManipulation.Tabulation
  57. <GROUP StringManipulation>
  58. <TITLE Tabulation>
  59. <TOPICORDER 1150>
  60. --------------------------------------------------------------------------------
  61. @@StringManipulation.TStringsManipulation
  62. <GROUP StringManipulation>
  63. <TITLE TStrings Manipulation>
  64. <TOPICORDER 1200>
  65. --------------------------------------------------------------------------------
  66. @@StrIsAlpha
  67. <GROUP StringManipulation.StringTestRoutines>
  68. Summary:
  69. Tests whether S contains only alpha characters.
  70. Description:
  71. StrIsAlpha tests whether the supplied string consists only of alpha characters.
  72. That is, whether or not all individual characters come from the ['a'..'z', 'A'..'Z']
  73. set.
  74. Parameters:
  75. S - The string to test
  76. Result:
  77. If S contains only alpha characters the result is True, otherwise the result is False.
  78. Notes:
  79. If S is an empty string the result is False.
  80. See also:
  81. StrConsistsOfNumberChars
  82. StrIsAlphaNum
  83. Donator:
  84. Nick Hodges
  85. --------------------------------------------------------------------------------
  86. @@StrIsAlphaNum
  87. <GROUP StringManipulation.StringTestRoutines>
  88. Summary:
  89. Tests whether S contains only alpha-numerical characters.
  90. Description:
  91. StrIsAlphaNum tests whether the supplied string consists only of alpha-numerical
  92. characters. That is, whether or not all individual characters come from
  93. the ['a'..'z', 'A'..'Z', '0'..'9'] set.
  94. Parameters:
  95. S - The string to test
  96. Result:
  97. If S contains only alpha-numerical characters the result is True, otherwise the result is False.
  98. Notes:
  99. If S is an empty string the result is False.
  100. See also:
  101. StrIsAlpha
  102. StrConsistsOfNumberChars
  103. StrIsAlphaNumUnderscore
  104. Donator:
  105. Marcel van Brakel
  106. --------------------------------------------------------------------------------
  107. @@StrIsAlphaNumUnderscore
  108. <GROUP StringManipulation.StringTestRoutines>
  109. Summary:
  110. Tests whether S contains only alpha-numerical and underscore characters.
  111. Description:
  112. StrIsAlphaNum tests whether the supplied string consists only of alpha-numerical
  113. and underscore characters. That is, whether or not all individual characters come
  114. from the ['a'..'z', 'A'..'Z', '0'..'9', '_'] set.
  115. Parameters:
  116. S - The string to test
  117. Result:
  118. If S contains only alpha-numerical and underscore characters the result is True,
  119. otherwise the result is False.
  120. Notes:
  121. If S is an empty string the result is False.
  122. See also:
  123. StrIsAlpha
  124. StrConsistsOfNumberChars
  125. Donator:
  126. Anthony Steele
  127. --------------------------------------------------------------------------------
  128. @@StrContainsChars
  129. <GROUP StringManipulation.StringTestRoutines>
  130. Summary:
  131. Determines whether a string contains a specified set of characters.
  132. Description:
  133. StrContainsChars checks whether the specified string contains at least one character
  134. that matches one of the characters in the Chars set. If CheckAll is True, the
  135. function checks whether all characters in the Chars set appear at least once in
  136. the specified string.
  137. Parameters:
  138. S - The string to test.
  139. Chars - The characters for which to test.
  140. CheckAll - If True, all characters from Chars must appear at least once in the specified string. If False, at least one of the characters in Chars must appear at least once in the specified string.
  141. Result:
  142. Returns True if the condition is met, otherwise it returns False.
  143. Donator:
  144. Petr Vones
  145. --------------------------------------------------------------------------------
  146. @@StrIsDigit
  147. <GROUP StringManipulation.StringTestRoutines>
  148. Summary:
  149. Tests whether S contains only numerical characters.
  150. Description:
  151. StrConsistsOfNumberChars tests whether the supplied string consists only of numerical characters.
  152. That is, whether or not all individual characters come from the ['0'..'9'] set.
  153. The test does not include the decimal separator. To include it in the test
  154. use StrConsistsOfNumberChars instead.
  155. Parameters:
  156. S - The string to test
  157. Result:
  158. If S contains only numerical characters the result is True, otherwise the result is False.
  159. Notes:
  160. If S is an empty string the result is False.
  161. See also:
  162. StrIsAlpha
  163. StrIsAlphaNum
  164. StrConsistsOfNumberChars
  165. Donator:
  166. Martin Kubecka
  167. --------------------------------------------------------------------------------
  168. @@StrConsistsOfNumberChars
  169. <GROUP StringManipulation.StringTestRoutines>
  170. Summary:
  171. Tests whether S contains only numerical characters.
  172. Description:
  173. StrConsistsOfNumberChars tests whether the supplied string consists only of numerical characters.
  174. That is, whether or not all individual characters come from the ['0'..'9'] set
  175. including the decimal separator. To test for numerical characters without the
  176. decimal separator, use StrIsDigit instead;
  177. Parameters:
  178. S - The string to test
  179. Result:
  180. If S contains only numerical characters the result is True, otherwise the result is False.
  181. Notes:
  182. If S is an empty string the result is False.
  183. See also:
  184. StrIsAlpha
  185. StrIsAlphaNum
  186. StrIsDigit
  187. Donator:
  188. Nick Hodges
  189. --------------------------------------------------------------------------------
  190. @@StrIsSubset
  191. <GROUP StringManipulation.StringTestRoutines>
  192. Summary:
  193. Tests whether S contains only characters from the supplied set.
  194. Description:
  195. StrIsSubset tests whether the supplied string contains only characters from the
  196. supplied character set. Keep in mind that the test is case-sensitive.
  197. Parameters:
  198. S - The string to test.
  199. ValidChars - The set of characters allowed in S.
  200. Result:
  201. If the string contains only characters from the supplied set the result is True,
  202. otherwise the result is False.
  203. Notes:
  204. If the supplied string is empty, the result is always True. If the supplied character
  205. set is empty, the result is always False. Empty string overules empty set.
  206. Donator:
  207. Marcel van Brakel
  208. --------------------------------------------------------------------------------
  209. @@StrSame
  210. <GROUP StringManipulation.StringTestRoutines>
  211. Summary:
  212. Tests two strings for equality.
  213. Description:
  214. StrSame compares the two supplied strings and returns whether or not they are
  215. identical.
  216. Parameters:
  217. S1 - First string to compare.
  218. S2 - Second string to compare.
  219. Result:
  220. If the two strings are identical the return value is True, if they are not the
  221. return value is False.
  222. See also:
  223. StrCompare
  224. Donator:
  225. Azret Botash
  226. --------------------------------------------------------------------------------
  227. @@StrCenter
  228. <GROUP StringManipulation.StringTransformationRoutines>
  229. Summary:
  230. Centers a string.
  231. Description:
  232. The StrCenter routine takes the specified string and pads it
  233. on both the left and right side with the specified character
  234. until the resulting string is of the specified length. While
  235. doing this the original string is kept centered. That is,
  236. there is the same amount of padding at the left side as there
  237. is on the right side.
  238. If the specified length is smaller than the length of the
  239. original the string remains unchanged. In cases where an odd
  240. number of padding chars have to be inserted there is always
  241. one more padding char on the right side than on the left
  242. side.
  243. Parameters:
  244. C - The character to use for padding.
  245. L - The desired length of the resulting string.
  246. S - The string to center.
  247. Result:
  248. Returns the centered string.
  249. Donator:
  250. Alexander Radchenko
  251. --------------------------------------------------------------------------------
  252. @@StrDoubleQuote
  253. <GROUP StringManipulation.StringTransformationRoutines>
  254. Summary:
  255. Returns a double-quoted version of the string.
  256. Description:
  257. StrDoubleQuote returns a copy of the string encapsulated in double quotes (").
  258. That is, if you pass in 'Project JEDI' you'll get '"Project JEDI"' back. If double
  259. quotes (") are already at the beginning and the end of the string they are added again.
  260. If they should be added only if they are not already there use StrQuote instead.
  261. Parameters:
  262. S - The string to encapsulate in quotes. Even an empty string.
  263. Result:
  264. The double-quoted version of the string.
  265. See also:
  266. StrQuote
  267. StrSingleQuote
  268. StrTrimQuotes
  269. Donator:
  270. Anthony Steele
  271. --------------------------------------------------------------------------------
  272. @@StrEnsurePrefix
  273. <GROUP StringManipulation.StringTransformationRoutines>
  274. Summary:
  275. Forces Text to start with Prefix.
  276. Description:
  277. StrEnsurePrefix tests whether the supplied text start with the supplied prefix.
  278. If it doesn't then the prefix is prepended to the string otherwise the function
  279. does nothing. Note that if Text is an empty string then the result will be Prefix.
  280. Parameters:
  281. Prefix - The prefix to test for and apply.
  282. Text - The string which must be forced to have a prefix.
  283. Result:
  284. The function result is a copy of the supplied Text, prefixed with Prefix.
  285. See also:
  286. StrEnsureNoPrefix
  287. StrEnsureSuffix
  288. Donator:
  289. Nick Hodges
  290. --------------------------------------------------------------------------------
  291. @@StrEnsureNoPrefix
  292. <GROUP StringManipulation.StringTransformationRoutines>
  293. Summary:
  294. Eventually removes Prefix from Text.
  295. Description:
  296. StrEnsureNoPrefix tests whether the supplied text start with the supplied prefix.
  297. If it does then the prefix is deleted from the string otherwise the function
  298. does nothing.
  299. Parameters:
  300. Prefix - The prefix to test for and apply.
  301. Text - The string which must not have a prefix.
  302. Result:
  303. The function result is a copy of the supplied Text, eventually minus the prefix.
  304. See also:
  305. StrEnsurePrefix
  306. StrEnsureNoSuffix
  307. Donator:
  308. Olivier Sannier
  309. --------------------------------------------------------------------------------
  310. @@StrEnsureSuffix
  311. <GROUP StringManipulation.StringTransformationRoutines>
  312. Summary:
  313. Forces Text to end with Suffix.
  314. Description:
  315. StrEnsureSuffix tests whether the supplied text ends in the supplied suffix.
  316. If it doesn't then the suffix is appended to the string otherwise the function
  317. does nothing. Note that if Text is an empty string then the result will be Suffix.
  318. Parameters:
  319. Suffix - The suffix to test for and apply.
  320. Text - The string which must be forced to have a suffix.
  321. Result:
  322. The function result is a copy of the supplied Text, with the suffix.
  323. See also:
  324. StrEnsureNoSuffix
  325. StrEnsurePrefix
  326. Donator:
  327. Marcel van Brakel
  328. --------------------------------------------------------------------------------
  329. @@StrEnsureNoSuffix
  330. <GROUP StringManipulation.StringTransformationRoutines>
  331. Summary:
  332. Eventually removes Suffix from Text.
  333. Description:
  334. StrEnsureSuffix tests whether the supplied text ends in the supplied suffix.
  335. If it does then the suffix is deleted from the string otherwise the function
  336. does nothing.
  337. Parameters:
  338. Suffix - The suffix to test for and apply.
  339. Text - The string which must not have a suffix.
  340. Result:
  341. The function result is a copy of the supplied Text, eventually minus the suffix.
  342. See also:
  343. StrEnsureSuffix
  344. StrEnsureNoPrefix
  345. Donator:
  346. Olivier Sannier
  347. --------------------------------------------------------------------------------
  348. @@StrEscapedToString
  349. <GROUP StringManipulation.StringTransformationRoutines>
  350. Summary:
  351. Converts an escaped string to a string.
  352. Description:
  353. StrEscapedToString converts a string which contains escape characters to a string
  354. without escape characters by replacing all escape characters with their string
  355. counterparts. For example, a string which contains a '\a' sequence will
  356. have the '\a' sequence replaced with the BELL character #7.
  357. The supported escape characters are:
  358. <TABLE>
  359. Character Value Constant Description
  360. --------- ----- --------- ------------------
  361. \a #7 BELL Bell
  362. \b #8 BACKSPACE Backspace
  363. \f #12 FF Form Feed
  364. \n #10 LR Line Feed
  365. \r #13 CR Carrage Return
  366. \t #9 TAB Tabulator
  367. \v #11 VT Vertical Tabulator
  368. \\ N/A N/A Backslash
  369. \" N/A N/A Double quotes
  370. </TABLE>
  371. In addition it supports hexadecimal escape sequences (sequences that start with \x)
  372. and octal escape sequences (sequences starting with '\0', '\1' ... '\9').
  373. The StrStringToEscaped is the "inverse" of this function.
  374. Parameters:
  375. S - The "escaped" string to convert to a "normal" string.
  376. Result:
  377. The string with all escape characters replaced with their string counterparts.
  378. See also:
  379. StrStringToEscaped
  380. Donator:
  381. Robert Marquardt
  382. --------------------------------------------------------------------------------
  383. @@StrLower
  384. <GROUP StringManipulation.StringTransformationRoutines>
  385. Summary:
  386. Lowercases all characters in a string.
  387. Description:
  388. StrLower returns a copy of the string, converted to lowercase. That is, if you pass in 'Project JEDI' you'll get 'project jedi'.
  389. Parameters:
  390. S - String to convert to lowercase.
  391. See also:
  392. StrLowerInPLace
  393. StrLowerBuff
  394. StrUpper
  395. StrUpperInPlace
  396. StrUpperBuff
  397. Donator:
  398. Pelle F. S. Liljendal
  399. --------------------------------------------------------------------------------
  400. @@StrLowerInPlace
  401. <GROUP StringManipulation.StringTransformationRoutines>
  402. Summary:
  403. Lowercases all characters in a string.
  404. Description:
  405. StrLower converts all characters in the supplied string to lowercase.
  406. Parameters:
  407. S - String to convert to lowercase.
  408. See also:
  409. StrLower
  410. StrLowerBuff
  411. StrUpper
  412. StrUpperInPlace
  413. StrUpperBuff
  414. Donator:
  415. Azret Botash
  416. --------------------------------------------------------------------------------
  417. @@StrLowerBuff
  418. <GROUP StringManipulation.StringTransformationRoutines>
  419. Summary:
  420. Lowercases all characters in a string.
  421. Description:
  422. StrLowerBuff converts all characters in the supplied string to lowercase.
  423. Parameters:
  424. P - String to convert to lowercase.
  425. See also:
  426. StrLower
  427. StrLowerInPlace
  428. StrUpper
  429. StrUpperInPlace
  430. StrUpperBuff
  431. Donator:
  432. Azret Botash
  433. --------------------------------------------------------------------------------
  434. @@StrMove
  435. <GROUP StringManipulation.StringTransformationRoutines>
  436. Summary:
  437. Copies a sub-string from one string to another.
  438. Description:
  439. StrMove copies Count characters starting at FromIndex in the source string to
  440. the destination string starting at ToIndex. The function checks the passed
  441. parameters and if any is illegal the function does nothing. This includes
  442. illegal indices and, for example, a zero-length destination string.
  443. Parameters:
  444. Dest - The destination string which the sub-string is copied to.
  445. Source - The source string from which the sub-string is copied.
  446. ToIndex - The index into the destination string at which the sub-string is copied.
  447. FromIndex - The starting index into the source string from which count characters are copied.
  448. Count - Length of the sub-string to copy in characters.
  449. Donator:
  450. Azret Botash
  451. --------------------------------------------------------------------------------
  452. @@StrPadLeft
  453. <GROUP StringManipulation.StringTransformationRoutines>
  454. Summary:
  455. Left pads a string with characters.
  456. Description:
  457. StrPadLeft left pads a string with the specified character until the resulting
  458. string is Len characters long. If the source string is already greater than or
  459. equal in length to Len the function does nothing.
  460. Parameters:
  461. S - Source string to left pad.
  462. Len - The length of the resulting string.
  463. C - The character to pad the string with.
  464. Result:
  465. The string left padded with the specified character.
  466. See also:
  467. StrPadRight
  468. StrCenter
  469. Donator:
  470. Marcel van Brakel
  471. --------------------------------------------------------------------------------
  472. @@StrPadRight
  473. <GROUP StringManipulation.StringTransformationRoutines>
  474. Summary:
  475. Right pads a string with characters.
  476. Description:
  477. StrPadRight right pads a string with the specified character until the resulting
  478. string is Len characters long. If the source string is already greater than or equal
  479. in length to Len the function does nothing.
  480. Parameters:
  481. S - Source string to right pad.
  482. Len - The length of the resulting string.
  483. C - The character to pad the string with.
  484. Result:
  485. The string right padded with the specified character.
  486. See also:
  487. StrPadLeft
  488. StrCenter
  489. Donator:
  490. Marcel van Brakel
  491. --------------------------------------------------------------------------------
  492. @@StrProper
  493. <GROUP StringManipulation.StringTransformationRoutines>
  494. Summary:
  495. Lowercases the supplied string and uppercases the first character.
  496. Description:
  497. The StrProper routine lowercases the entire string and subsequently uppercases
  498. the first character.
  499. Parameters:
  500. S - The string to transform.
  501. Result:
  502. The transformed string.
  503. Donator:
  504. Azret Botash
  505. --------------------------------------------------------------------------------
  506. @@StrProperBuff
  507. <GROUP StringManipulation.StringTransformationRoutines>
  508. Summary:
  509. Lowercases the supplied string and uppercases the first character.
  510. Description:
  511. The StrProper routine lowercases the entire string and subsequently uppercases
  512. the first character.
  513. Parameters:
  514. S - The string to transform.
  515. Donator:
  516. Azret Botash
  517. --------------------------------------------------------------------------------
  518. @@StrQuote
  519. <GROUP StringManipulation.StringTransformationRoutines>
  520. Summary:
  521. Quotes a string with a specific character.
  522. Description:
  523. StrQuote quotes the string with a specified character. Upon return the string is
  524. guarenteed to begin and end with the specified character. Note that if the string
  525. already starts or ends with this character, it is not added again.
  526. Parameters:
  527. S - The string to quote.
  528. C - The character with which to quote the string.
  529. Result:
  530. The quoted string.
  531. Donator:
  532. Azret Botash
  533. --------------------------------------------------------------------------------
  534. @@StrRemoveChars
  535. <GROUP StringManipulation.StringTransformationRoutines>
  536. Summary:
  537. Removes a set of characters from a string.
  538. Description:
  539. StrRemoveChars removes all instances of the characters in the set from the source
  540. string. For example, if you pass in 'Joint Endeavour of Delphi Innovators' and
  541. specify ['e', 'a', 'o', 'u', 'i'] the resulting string will be 'Jnt Endvr f Dlph Innvtrs'.
  542. Parameters:
  543. S - The source string from which to remove the characters.
  544. Chars - The set of characters which are removed from S.
  545. Result:
  546. The string with all characters from the supplied set removed.
  547. Notes:
  548. The function is case sensitive. That is, specifying 'e' will not remove 'E'.
  549. Donator:
  550. Marcel van Brakel
  551. --------------------------------------------------------------------------------
  552. @@StrRepeat
  553. <GROUP StringManipulation.StringTransformationRoutines>
  554. Summary:
  555. Repeats a string Count number of times.
  556. Description:
  557. The StrRepeat routine returns a string consisting of the specified string, repeated
  558. Count number of times. For example, StrRepeat('He', 3) returns 'HeHeHe'.
  559. Parameters:
  560. S - The string to repeat.
  561. Count - The number of times to repeat the specified string.
  562. Result:
  563. The specified string, repeated Count number of times.
  564. Donator:
  565. Marcel van Brakel
  566. --------------------------------------------------------------------------------
  567. @@StrReverse
  568. <GROUP StringManipulation.StringTransformationRoutines>
  569. Summary:
  570. Reverses a string.
  571. Description:
  572. StrReverse returns a reversed copy of S. That is, if you pass in 'Delphi' the
  573. function result will be 'ihpleD'. Note that the original string remains unmodified,
  574. as the const modifier indicates. If you don't need the original string after
  575. reversing it, then do not write code like S := StrReverse(S) but instead use
  576. the StrReverseInPlace function because it's much faster.
  577. Parameters:
  578. S - The string to reverse.
  579. Result:
  580. A reversed copy of the supplied string.
  581. See also:
  582. StrReverseInPlace
  583. Donator:
  584. Marcel van Brakel
  585. --------------------------------------------------------------------------------
  586. @@StrReverseInPlace
  587. <GROUP StringManipulation.StringTransformationRoutines>
  588. Summary:
  589. Reverses a string.
  590. Description:
  591. StrReverse reverses S. That is, if you pass in 'Delphi' then after the function
  592. returns S contains the string 'ihpleD'. If you need to retain the original
  593. string then use the StrReverse function instead.
  594. Parameters:
  595. S - The string to reverse.
  596. See also:
  597. StrReverse
  598. Donator:
  599. Marcel van Brakel
  600. --------------------------------------------------------------------------------
  601. @@StrSingleQuote
  602. <GROUP StringManipulation.StringTransformationRoutines>
  603. Summary:
  604. Returns a single-quoted version of the string.
  605. Description:
  606. StrSingleQuote returns a copy of the string encapsulated in single quotes (').
  607. That is, if you pass in 'Project JEDI' you'll get ''Project JEDI'' back.
  608. Parameters:
  609. S - The string to encapsulate in quotes. Even an empty string.
  610. Result:
  611. The single-quoted version of the string.
  612. See also:
  613. StrDoubleQuote
  614. StrTrimQuotes
  615. Donator:
  616. Anthony Steele
  617. --------------------------------------------------------------------------------
  618. @@StrSmartCase
  619. <GROUP StringManipulation.StringTransformationRoutines>
  620. Summary:
  621. Converts a string to 'smartcase' or 'camelcase'.
  622. Description:
  623. StrSmartCase converts specified characters within the supplied source string to
  624. uppercase. The characters that are uppercased are determined by the Delimiters
  625. character set. Each time the function finds a character in the source string that
  626. is also present in the Delimiters set it uppercases the next character
  627. in the source string. In addition, the function always converts the first character
  628. to uppercase. For example, if you call StrSmartCase('project jedi rules', [' '])
  629. the function returns 'Project Jedi Rules'. As you can see, all characters that
  630. immediately follow a space (as specified by Delimiters) are uppercased.
  631. Parameters:
  632. S - Source string.
  633. Delimiters - Set of characters to use as delimiters. These characters determine which other
  634. characters are uppercased. If you supply an empty set the function assumes you want to use a
  635. space only. That is, it sets Delimiters to [' '].
  636. Result:
  637. The string converted to smart case.
  638. Notes:
  639. Original author is John C Molyneux (jaymol@hotmail.com). Function was rewritten by
  640. Marcel van Brakel.
  641. Donator:
  642. Marcel van Brakel
  643. --------------------------------------------------------------------------------
  644. @@StrStringToEscaped
  645. <GROUP StringManipulation.StringTransformationRoutines>
  646. Summary:
  647. Converts a string to an escaped string.
  648. Description:
  649. StrStringToEscaped converts a string to an escaped string by replacing non-visual
  650. character sequences with their escape characters. For example, if a string contains
  651. the character #7 the resulting string will have the #7 character replaced with the '\a'
  652. sequence. This function is the inverse of StrEscapedToString.
  653. The function supports the following escape characters:
  654. <TABLE>
  655. Character Value Constant Description
  656. --------- ----- --------- ------------------
  657. \a #7 BELL Bell
  658. \b #8 BACKSPACE Backspace
  659. \f #12 FF Form Feed
  660. \n #10 LR Line Feed
  661. \r #13 CR Carrage Return
  662. \t #9 TAB Tabulator
  663. \v #11 VT Vertical Tabulator
  664. \\ N/A N/A Backslash
  665. \" N/A N/A Double quotes
  666. </TABLE>
  667. All other characters whose ordinal value are smaller than Ord(' ') are escaped
  668. as a hexadecimal sequence like '\x01'. The StrEscapedToString is the "inverse"
  669. of this function.
  670. Parameters:
  671. S - The string to convert to an escaped string.
  672. Result:
  673. The "escaped" string.
  674. See also:
  675. StrEscapedToString
  676. Donator:
  677. Robert Marquardt
  678. --------------------------------------------------------------------------------
  679. @@StrStripNonNumberChars
  680. <GROUP StringManipulation.StringTransformationRoutines>
  681. Summary:
  682. Removes all non-number characters from a string.
  683. Description:
  684. StrStripNonNumberChars removes all non-number characters from the specified string.
  685. Hence the resulting string will contain only number characters. Testing whether
  686. the individual characters are numbers is done using the CharIsNumberChar routine and
  687. therefore characters that qualify are all digits (0..9), signs (+, -) and decimal
  688. separators.
  689. Parameters:
  690. S - The string from which to remove non-number characters.
  691. Result:
  692. The string after all non-number characters are removed.
  693. Donator:
  694. Anthony Steele
  695. --------------------------------------------------------------------------------
  696. @@StrTrimQuotes
  697. <GROUP StringManipulation.StringTransformationRoutines>
  698. Summary:
  699. Removes surrounding quotes from the supplied string.
  700. Description:
  701. StrTrimQuotes removes surrounding quotes, either single or double-quotes, from
  702. the string. For example if you pass in ''Project JEDI'' you'll get 'Project JEDI'
  703. back. Note that this function only removes quotes if the string both begins and
  704. ends with the same quote character.
  705. Parameters:
  706. S - The string to unquote.
  707. Result:
  708. The unquoted string.
  709. See also:
  710. StrSingleQuote
  711. StrDoubleQuote
  712. Donator:
  713. Anthony Steele
  714. --------------------------------------------------------------------------------
  715. @@StrToHex
  716. <GROUP StringManipulation.StringTransformationRoutines>
  717. Summary:
  718. Converts a string of hex digit pairs to the corresponding bytes.
  719. Description:
  720. The Source string is expected to contain pairs of hex digit
  721. characters ['0'..'9', 'a'..'f', 'A'..'F']. Each pair is converted to a single
  722. byte thus converting '40' to '@'. Any character not from the hex set
  723. results in an empty string. If the string length of the Source is odd
  724. then a '0' is prepended internally to make up the first byte.
  725. Parameters:
  726. S - A string of hex digit pairs to be converted.
  727. Result:
  728. The string of converted bytes.
  729. Donator:
  730. Azret Botash
  731. --------------------------------------------------------------------------------
  732. @@StrTrimCharLeft
  733. <GROUP StringManipulation.StringTransformationRoutines>
  734. Summary:
  735. Removes leading characters from a string.
  736. Description:
  737. The StrTrimCharLeft routine removes leading characters from the specified string.
  738. For example, StrTrimCharLeft('000123', '0') returns '123'.
  739. Parameters:
  740. S - The source string from which the leading characters need to be removed.
  741. C - The character to remove.
  742. Result:
  743. The function returns the source string S without any leading characters C.
  744. See also:
  745. StrTrimCharRight
  746. Donator:
  747. Jack N.A. Bakker
  748. --------------------------------------------------------------------------------
  749. @@StrTrimCharRight
  750. <GROUP StringManipulation.StringTransformationRoutines>
  751. Summary:
  752. Removes trailing characters from a string.
  753. Description:
  754. The StrTrimCharRight routine removes trailing characters from the specified string.
  755. For example, StrTrimCharRight('123000', '0') returns '123'.
  756. Parameters:
  757. S - The source string from which the trailing characters need to be removed.
  758. C - The character to remove.
  759. Result:
  760. The function returns the source string S without any trailing characters C.
  761. See also:
  762. StrTrimCharLeft
  763. Donator:
  764. Jack N.A. Bakker
  765. --------------------------------------------------------------------------------
  766. @@StrUpper
  767. <GROUP StringManipulation.StringTransformationRoutines>
  768. Summary:
  769. Uppercases all characters in a string
  770. Description:
  771. StrUpper returns a copy of the string, converted to uppercase. That is, if you pass
  772. in 'Project JEDI' you'll get 'PROJECT JEDI'.
  773. Parameters:
  774. S - String to convert to uppercase.
  775. See also:
  776. StrUpperInPlace
  777. StrUpperBuff
  778. StrLower
  779. StrLowerInPlace
  780. StrLowerBuff
  781. Donator:
  782. Azret Botash
  783. --------------------------------------------------------------------------------
  784. @@StrUpperInPlace
  785. <GROUP StringManipulation.StringTransformationRoutines>
  786. Summary:
  787. Uppercases all characters in a string.
  788. Description:
  789. StrUpper converts all characters in the supplied string to uppercase.
  790. Parameters:
  791. S - String to convert to uppercase.
  792. See also:
  793. StrUpper
  794. StrUpperBuff
  795. StrLower
  796. StrLowerInPlace
  797. StrLowerBuff
  798. Donator:
  799. Azret Botash
  800. --------------------------------------------------------------------------------
  801. @@StrUpperBuff
  802. <GROUP StringManipulation.StringTransformationRoutines>
  803. Summary:
  804. Uppercases all characters in a string.
  805. Description:
  806. StrUpper converts all characters in the supplied string to uppercase.
  807. Parameters:
  808. S - String to convert to uppercase.
  809. See also:
  810. StrUpper
  811. StrUpperInPlace
  812. StrLower
  813. StrLowerInPlace
  814. StrLowerBuff
  815. Donator:
  816. Azret Botash
  817. --------------------------------------------------------------------------------
  818. @@StrAddRef
  819. <GROUP StringManipulation.StringManagement>
  820. Summary:
  821. Increments the reference count of a long string.
  822. Description:
  823. The StrAddRef routine increments the reference count of the specified long string.
  824. Explicitly incrementing a strings reference count forces Delphi to keep the string
  825. in memory even if the variable itself goes out of scope and all other references
  826. were removed already. Note that if the string points to a string constant this
  827. routine will call UniqueString on it forcing a string copy, after which the
  828. reference count becomes 1.
  829. Parameters:
  830. S - The long string whose reference count to increment.
  831. See also:
  832. StrDecRef
  833. Donator:
  834. Marcel van Brakel
  835. --------------------------------------------------------------------------------
  836. @@StrAllocSize
  837. <GROUP StringManipulation.StringManagement>
  838. Summary:
  839. Returns the memory allocated to store the string.
  840. Description:
  841. A long string variable is a 4 byte pointer to a dynamically allocated block of
  842. memory. This block of memory holds the actual string data, including a NULL
  843. character. In addition this block of memory has, at a negative offset, a number
  844. of 32 bit values used to manage the string. The StringAllocSize function looks
  845. at this negative offset to determine the total amount of dynamic memory reserved
  846. to hold the string and management data.
  847. Note that this function will always return 0 for string literals, string constants
  848. and string variables that are assigned to string constants, but haven't been
  849. modified yet. This is not a bug but a result of the way in which Delphi manages
  850. string constants.
  851. Parameters:
  852. S - The string for which to determine the total amount of used memory.
  853. Result:
  854. The amount of dynamic memory allocated for the string or 0 in the exceptions noted
  855. above. Note that, at least in Delphi 5, the result will always be a multiple of 4.
  856. Notes:
  857. This function relies on pseudo-undocumented knowledge and should only be used for
  858. debugging purposes.
  859. See also:
  860. StrRefCount
  861. Donator:
  862. Marcel van Brakel
  863. --------------------------------------------------------------------------------
  864. @@StrDecRef
  865. <GROUP StringManipulation.StringManagement>
  866. Summary:
  867. Decrements the reference count of a long string.
  868. Description:
  869. The StrDecRef routine decrements the reference count of the specified long string.
  870. Note that if decrementing the reference count will set it to 0 the string is
  871. released and the string pointer is set to nil. Therefore the string may be
  872. inaccessible after calling this routine.
  873. Parameters:
  874. S - The long string whose reference count to increment. Upon return the string may
  875. have been freed.
  876. See also:
  877. StrDecRef
  878. Donator:
  879. Marcel van Brakel
  880. --------------------------------------------------------------------------------
  881. @@StrLen
  882. <GROUP StringManipulation.StringManagement>
  883. Summary:
  884. Returns the length of the supplied string.
  885. Description:
  886. StrLen returns the length of the supplied string, in characters, excluding the
  887. null terminating character. This function is identical to the StrLen routine from
  888. SysUtils.pas except that it is much faster.
  889. Parameters:
  890. S - Pointer to the null terminated string for which to determine the length.
  891. Result:
  892. The length of the string, in characters.
  893. Donator:
  894. Robert Lee
  895. --------------------------------------------------------------------------------
  896. @@StrLength
  897. <GROUP StringManipulation.StringManagement>
  898. Summary:
  899. Returns the length of the supplied string.
  900. Description:
  901. StrLength returns the length of the supplied string. This is a duplication of the
  902. standard Delphi Length function and is only supplied for completeness. You should
  903. prefer the Length function over StrLength.
  904. Parameters:
  905. S - The string for which to determine the length.
  906. Result:
  907. The length of the string in characters.
  908. Notes:
  909. This function relies on pseudo undocumented knowledge.
  910. See also:
  911. StrAllocSize
  912. StrRefCount
  913. Donator:
  914. Marcel van Brakel
  915. --------------------------------------------------------------------------------
  916. @@StrRefCount
  917. <GROUP StringManipulation.StringManagement>
  918. Summary:
  919. Returns the reference count of the supplied string.
  920. Description:
  921. StrRefCount returns the reference count of the string. Note that this function
  922. will always return -1 for string literals, string constants and string variables
  923. that are assigned to string constants, but haven't been modified yet. This is
  924. not a bug but a result of the way in which Delphi manages string constants.
  925. Parameters:
  926. S - String for which to determine the reference count.
  927. Result:
  928. The reference count of the string or -1 if the string ultimately points to a
  929. string constant.
  930. Notes:
  931. This function relies on pseudo-undocumented knowledge and should only be used for
  932. debugging purposes.
  933. See also:
  934. StrAllocSize
  935. Donator:
  936. Marcel van Brakel
  937. --------------------------------------------------------------------------------
  938. @@StrResetLength
  939. <GROUP StringManipulation.StringManagement>
  940. Summary:
  941. Resets the length of the supplied string.
  942. Description:
  943. StrResetLength resets the length of the string to encompass only the actual number
  944. of used characters. This is particularly useful when passing strings to API
  945. functions which accept PChar's. These kind of functions do modify the string but
  946. since they are unaware of how Delphi manages strings, the length is not changed
  947. on return. Depending on how you use the string from that point on the results
  948. may be incorrect if you do not apply StrResetLength.
  949. The function resets the length to the C string length, i. e. the length up to the first #0 byte.
  950. Parameters:
  951. S - The string whose length to reset.
  952. Donator:
  953. Marcel van Brakel
  954. --------------------------------------------------------------------------------
  955. @@StrCharCount
  956. <GROUP StringManipulation.StringSearchandReplaceRoutines>
  957. Summary:
  958. Counts the occurrences of a character in a string.
  959. Description:
  960. StrCharCount returns the number of occurrences of the specified character in the
  961. supplied string.
  962. Parameters:
  963. S - Source string.
  964. C - The character whose occurrences to count.
  965. Result:
  966. The number of occurrences of C in S.
  967. Donator:
  968. Massimo Maria Ghisalberti
  969. --------------------------------------------------------------------------------
  970. @@StrCompare
  971. <GROUP StringManipulation.StringTestRoutines>
  972. Summary:
  973. Compares two strings.
  974. Description:
  975. StrCompare implements a case-insensitive comparison between the two supplied
  976. strings. If the two strings match the function returns 0 otherwise it returns
  977. the number of different characters. If the supplied strings are of equal length
  978. but are not identical the function returns the difference of the first mismatched
  979. character. The table below demonstrates this:
  980. <TABLE>
  981. S1 S2 Result
  982. ------------ ------------ ------------------------------
  983. jedi jedi 0
  984. jedi je 2
  985. di jedi -2
  986. project jedi jedi 8
  987. jedi project jedi -8
  988. jedi judi Ord('e') - Ord('u')
  989. JEDI Judi Ord(LowerCase('E')) - Ord('u')
  990. </TABLE>
  991. Parameters:
  992. S1 - First string to compare.
  993. S2 - Second string to compare.
  994. Result:
  995. StrCompare returns 0 if the two strings match or the number of different characters
  996. in case of a mismatch.
  997. Donator:
  998. Azret Botash
  999. --------------------------------------------------------------------------------
  1000. @@StrCompareRange
  1001. <GROUP StringManipulation.StringSearchandReplaceRoutines>
  1002. Description:
  1003. StrCompareRange compares, case-sensitive, a sub-string from the
  1004. first supplied string with the second string. If the two
  1005. strings are identical the function returns 0 otherwise it
  1006. returns an indication of difference between the two strings,
  1007. The result is equal to the result returned by StrCompare. This
  1008. function is particularly useful to avoid code such as: "if
  1009. Copy(S, 1, 4) = 'JEDI' then ..." which is quite inefficient.
  1010. This code would be rewritten to: "if StrCompareRange(S1,
  1011. 'JEDI', 1, 4) = 0 then ...".
  1012. Summary:
  1013. Compares two (sub) strings.
  1014. Parameters:
  1015. Count - Number of characters of the sub-string in S1 to compare to S2.
  1016. Index - Starting index of sub-string in S1 to.
  1017. S1 - First string to compare.
  1018. S2 - Second string to compare.
  1019. Result:
  1020. StrCompareRange returns 0 if the two strings match or the
  1021. number of different characters in case of a mismatch.
  1022. See also:
  1023. StrCompare
  1024. Donator:
  1025. Azret Botash
  1026. --------------------------------------------------------------------------------
  1027. @@StrFillChar
  1028. <GROUP StringManipulation.StringSearchandReplaceRoutines>
  1029. Summary:
  1030. Creates a string consisting of the specified character repeated Count times.
  1031. Description:
  1032. The StrFillChar routine returns a string consisting of the specified character
  1033. repeated Count number of times.
  1034. Parameters:
  1035. C - The character to repeat.
  1036. Count - The number of times to repeat the character.
  1037. Result:
  1038. A string consisting of the specified character repeated Count times.
  1039. Donator:
  1040. Marcel van Brakel
  1041. --------------------------------------------------------------------------------
  1042. @@StrFind
  1043. <GROUP StringManipulation.StringSearchandReplaceRoutines>
  1044. Summary:
  1045. Returns the index of the first character in a specified sub-string that occurs in a given string.
  1046. Description:
  1047. StrFind returns the index of the first character in a specified sub-string that
  1048. occurs in a given string. The search starts at the supplied index and is case-insensitive.
  1049. Parameters:
  1050. Substr - The sub-string to search for.
  1051. Str - The string in which to search.
  1052. Index - The index in Str at which to start the search.
  1053. Result:
  1054. One-based index of the first character of SubStr in Str or 0 if SubStr does not
  1055. occur in the supplied string.
  1056. See also:
  1057. StrSearch
  1058. Donator:
  1059. Azret Botash
  1060. --------------------------------------------------------------------------------
  1061. @@StrHasPrefix
  1062. <GROUP StringManipulation.StringSearchandReplaceRoutines>
  1063. Summary:
  1064. Returns whether a string is prefixed by one of the supplied strings.
  1065. Description:
  1066. StrHasPrefix returns whether the string is prefixed with at least one of the strings
  1067. supplied in the Prefixes array. In other words, for each string in the Prefixes
  1068. array it's determined if the supplied string starts with that prefix. Note that
  1069. the routine exits as soon as a match is found and matching is case-sensitive (use
  1070. StrIHasPrefix for a case-insensitive matching version).
  1071. Parameters:
  1072. S - The string to test.
  1073. Prefixes - Array of prefixes to test for.
  1074. Result:
  1075. If the supplied string is prefixed with one of the supplied prefixes the routine
  1076. returns True, otherwise it returns False.
  1077. See also:
  1078. StrIHasPrefix, StrPrefixIndex
  1079. Donator:
  1080. Anthony Steele
  1081. --------------------------------------------------------------------------------
  1082. @@StrIHasPrefix
  1083. <GROUP StringManipulation.StringSearchandReplaceRoutines>
  1084. Summary:
  1085. Returns whether a string is prefixed by one of the supplied strings.
  1086. Description:
  1087. StrHasPrefix returns whether the string is prefixed with at least one of the strings
  1088. supplied in the Prefixes array. In other words, for each string in the Prefixes
  1089. array it's determined if the supplied string starts with that prefix. Note that
  1090. the routine exits as soon as a match is found and matching is case-insensitive (use
  1091. StrHasPrefix for a case-sensitive matching version).
  1092. Parameters:
  1093. S - The string to test.
  1094. Prefixes - Array of prefixes to test for.
  1095. Result:
  1096. If the supplied string is prefixed with one of the supplied prefixes the routine
  1097. returns True, otherwise it returns False.
  1098. See also:
  1099. StrHasPrefix, StrIPrefixIndex
  1100. Donator:
  1101. Anthony Steele
  1102. --------------------------------------------------------------------------------
  1103. @@StrIndex
  1104. <GROUP StringManipulation.StringSearchandReplaceRoutines>
  1105. Summary:
  1106. Returns the index of a string in an array of strings.
  1107. Description:
  1108. StrIndex returns the index into the List array at which S is positioned. This is
  1109. particularly useful to create a case statement based on string labels. For example:
  1110. case StrIndex(S, ['zero', 'one', 'two']) of
  1111. 0: // handle case where S = 'zero'
  1112. 1: // handle case where S = 'one'
  1113. 2: // handle case where S = 'two'
  1114. else
  1115. //
  1116. end;
  1117. Parameters:
  1118. S - The string to test.
  1119. List - Array of strings to search in.
  1120. Result:
  1121. If the supplied string exists in the List array the zero based index of the position
  1122. at which it appears is returned. If the string doesn't exist in the array -1 is
  1123. returned. Note that the string comparison is case insensitive but is based on the
  1124. current locale (ie it uses AnsiSameText).
  1125. Donator:
  1126. Anthony Steele
  1127. --------------------------------------------------------------------------------
  1128. @@StrILastPos
  1129. <GROUP StringManipulation.StringSearchandReplaceRoutines>
  1130. Summary:
  1131. Returns the index of the last occurrence of SubStr in S.
  1132. Description:
  1133. StrILastPos scans the supplied string and returns the index of the first character
  1134. of the last occurrence of the supplied sub-string. The comparison is case-insensitive.
  1135. Parameters:
  1136. SubStr - The sub-string to find the last occurrence of.
  1137. S - The string in which to search.
  1138. Result:
  1139. The index of the last occurrence of SubStr in S. If the sub-string does not exist
  1140. at all the result is 0.
  1141. See also:
  1142. StrLastPos
  1143. Donator:
  1144. Anthony Steele
  1145. --------------------------------------------------------------------------------
  1146. @@StrLastPos
  1147. <GROUP StringManipulation.StringSearchandReplaceRoutines>
  1148. Summary:
  1149. Returns the index of the last occurrence of SubStr in S.
  1150. Description:
  1151. StrLastPos scans the supplied string and returns the index of the first character
  1152. of the last occurrence of the supplied sub-string. The comparison is case-sensitive.
  1153. Parameters:
  1154. SubStr - The sub-string to find the last occurrence of.
  1155. S - The string in which to search.
  1156. Result:
  1157. The index of the last occurrence of SubStr in S. If the sub-string does not exist
  1158. at all the result is 0.
  1159. See also:
  1160. StrILastPos
  1161. Donator:
  1162. Marcel van Brakel
  1163. --------------------------------------------------------------------------------
  1164. @@StrIPos
  1165. <GROUP StringManipulation.StringSearchandReplaceRoutines>
  1166. Summary:
  1167. Returns the index of the first occurrence of SubStr in S.
  1168. Description:
  1169. StrIPos scans the supplied string and returns the index of the first character
  1170. of the first occurrence of the supplied sub-string. The comparison is case-insensitive.
  1171. Parameters:
  1172. SubStr - The sub-string to find the first occurrence of.
  1173. S - The string in which to search.
  1174. Result:
  1175. The index of the first occurrence of SubStr in S. If the sub-string does not exist
  1176. at all the result is 0.
  1177. Donator:
  1178. Anthony Steele
  1179. --------------------------------------------------------------------------------
  1180. @@StrIPrefixIndex
  1181. <GROUP StringManipulation.StringSearchandReplaceRoutines>
  1182. Summary:
  1183. Returns the index at which a string appears which is used as a prefix.
  1184. Description:
  1185. StrPrefixIndex returns the index into the prefixes array at which a string appears
  1186. with which the supplied string is prefixed. For example,
  1187. StrPrefixIndex('banana', ['call', 'ban', 'bana']) will return 1. Note that as
  1188. can be seen from the example, as soon as a prefix is found the routine stops and
  1189. doesn't attempt to find a better (longer) match. Matching is case-insensitive; use
  1190. StrPrefixIndex for a case-insensitive version.
  1191. Parameters:
  1192. S - The string to test.
  1193. Prefixes - The list of prefixes.
  1194. Result:
  1195. The zero based index into Prefixes at which the first string appears that is used
  1196. as a prefix in the supplied string. If none of the Prefixes array strings qualifies
  1197. the result is -1.
  1198. See Also
  1199. StrIHasPrefix, StrPrefixIndex
  1200. Donator:
  1201. Anthony Steele
  1202. --------------------------------------------------------------------------------
  1203. @@StrIsOneOf
  1204. <GROUP StringManipulation.StringSearchandReplaceRoutines>
  1205. Summary:
  1206. Tests whether the supplied string exists in the list of strings.
  1207. Description:
  1208. StrIsOneOf tests whether the supplied string exists in the list of strings. Note
  1209. that the comparison is case-insensitive.
  1210. Parameters:
  1211. S - The string to test.
  1212. List - The list of string in which to search.
  1213. Result:
  1214. If the string exists in the supplied list the result is True, otherwise it's False.
  1215. Donator:
  1216. Anthony Steele
  1217. --------------------------------------------------------------------------------
  1218. @@StrNPos
  1219. <GROUP StringManipulation.StringSearchandReplaceRoutines>
  1220. Summary:
  1221. Returns the position of the N-th occurence of a sub-string within a string.
  1222. Description:
  1223. StrNPos returns the index into S of the N-th occurence of the specified sub-string.
  1224. This function is case-sensitive and does not work with multibyte character sets.
  1225. If the specified sub-string does not have N occurence in S the function returns 0.
  1226. Parameters:
  1227. S - The string in which to search for N occurences of SubStr.
  1228. SubStr - The sub-string to search for.
  1229. Index - The number of occurences of sub-string in S.
  1230. Result:
  1231. Index into S where the N-th occurence of SubStr is located. If SubStr has less
  1232. than N occurences in S the result is 0.
  1233. Notes:
  1234. This function was inspired by code submitted by George Tasker
  1235. See also:
  1236. StrNIPos
  1237. Donator:
  1238. Team JCL
  1239. --------------------------------------------------------------------------------
  1240. @@StrNIPos
  1241. <GROUP StringManipulation.StringSearchandReplaceRoutines>
  1242. Summary:
  1243. Returns the position of the N-th occurence of a sub-string within a string.
  1244. Description:
  1245. StrNPos returns the index into S of the N-th occurence of the specified sub-string.
  1246. This function is case-insensitive and does not work with multibyte character sets.
  1247. If the specified sub-string does not have N occurence in S the function returns 0.
  1248. Parameters:
  1249. S - The string in which to search for N occurences of SubStr.
  1250. SubStr - The sub-string to search for.
  1251. N - The number of occurences of sub-string in S.
  1252. Result:
  1253. Index into S where the N-th occurence of SubStr is located. If SubStr has less
  1254. than N occurences in S the result is 0.
  1255. Notes:
  1256. This function was inspired by code submitted by George Tasker
  1257. See also:
  1258. StrNPos
  1259. Donator:
  1260. Team JCL
  1261. --------------------------------------------------------------------------------
  1262. @@StrMatch
  1263. <GROUP StringManipulation.StringSearchandReplaceRoutines>
  1264. Summary:
  1265. Returns the index of the first character in a specified sub-string that occurs in a given string.
  1266. Description:
  1267. StrMatch returns the index of the first character in a specified sub-string that
  1268. occurs in a given string. The search starts at the supplied index and is case-insensitive.
  1269. The specified sub-string may contain wildcards. The '?' wildcard matches 1 character
  1270. while the '*' wildcard matches 0 or more occurrences of a character. For example, 'J?DI'
  1271. will find 'JEDI', 'JZDI' and 'JODI' (and more) while 'J*I' will find 'JEDI' and 'JI'.
  1272. Parameters:
  1273. Substr - The sub-string to search for. May contain wildcards.
  1274. Str - The string in which to search.
  1275. Index - The index in Str at which to start the search.
  1276. Result:
  1277. One-based index of the first character of SubStr in Str or 0 if SubStr does not
  1278. occur in the supplied string.
  1279. Notes:
  1280. The '*' wildcard currently doesn't work correctly, it produces the same result as '?'.
  1281. See also:
  1282. StrSearch
  1283. Donator:
  1284. Azret Botash
  1285. --------------------------------------------------------------------------------
  1286. @@StrPrefixIndex
  1287. <GROUP StringManipulation.StringSearchandReplaceRoutines>
  1288. Summary:
  1289. Returns the index at which a string appears which is used as a prefix.
  1290. Description:
  1291. StrPrefixIndex returns the index into the prefixes array at which a string appears
  1292. with which the supplied string is prefixed. For example,
  1293. StrPrefixIndex('banana', ['call', 'ban', 'bana']) will return 1. Note that as
  1294. can be seen from the example, as soon as a prefix is found the routine stops and
  1295. doesn't attempt to find a better (longer) match. Matching is case-sensitive; use
  1296. StrIPrefixIndex for a case-insensitive version.
  1297. Parameters:
  1298. S - The string to test.
  1299. Prefixes - The list of prefixes.
  1300. Result:
  1301. The zero based index into Prefixes at which the first string appears that is used
  1302. as a prefix in the supplied string. If none of the Prefixes array strings qualifies
  1303. the result is -1.
  1304. See Also
  1305. StrHasPrefix, StrIPrefixIndex
  1306. Donator:
  1307. Anthony Steele
  1308. --------------------------------------------------------------------------------
  1309. @@StrSearch
  1310. <GROUP StringManipulation.StringSearchandReplaceRoutines>
  1311. Summary:
  1312. Returns the index of the first character in a specified sub-string that occurs in a given string.
  1313. Description:
  1314. StrSearch returns the index of the first character in a specified sub-string that
  1315. occurs in a given string. The search starts at the supplied index and is case-sensitive.
  1316. Parameters:
  1317. Substr - The sub-string to search for.
  1318. Str - The string in which to search.
  1319. Index - The index in Str at which to start the search.
  1320. Result:
  1321. One-based index of the first character of SubStr in Str or 0 if SubStr does not
  1322. occur in the supplied string.
  1323. See also:
  1324. StrFind
  1325. Donator:
  1326. Azret Botash
  1327. --------------------------------------------------------------------------------
  1328. @@StrAfter
  1329. <GROUP StringManipulation.StringExtraction>
  1330. Summary:
  1331. Returns the portion of the string after a specific sub-string.
  1332. Description:
  1333. The StrAfter routine returns that portion of the specified string that appears
  1334. after a specified sub-string. For example, StrAfter('Hello', 'Hello world') returns
  1335. the string ' world'.
  1336. Parameters:
  1337. SubStr - The sub-string to search for.
  1338. S - The source string.
  1339. Result:
  1340. The portion of the string after the specified sub-string. If the sub-string does
  1341. not appear in the source string the result is an empty string.
  1342. See also:
  1343. StrBefore
  1344. Donator:
  1345. Anthony Steele
  1346. --------------------------------------------------------------------------------
  1347. @@StrBefore
  1348. <GROUP StringManipulation.StringExtraction>
  1349. Summary:
  1350. Returns the portion of the string before a specific sub-string.
  1351. Description:
  1352. The StrBefore routine returns that portion of the specified string that appears
  1353. before a specified sub-string. For example, StrBefore('world', 'Hello world') returns
  1354. the string 'Hello '.
  1355. Parameters:
  1356. SubStr - The sub-string to search for.
  1357. S - The source string.
  1358. Result:
  1359. The portion of the string before the specified sub-string. If the sub-string does
  1360. not appear in the source string the result is the source string.
  1361. See also:
  1362. StrAfter
  1363. Donator:
  1364. Anthony Steele
  1365. --------------------------------------------------------------------------------
  1366. @@StrBetween
  1367. <GROUP StringManipulation.StringExtraction>
  1368. Summary:
  1369. Returns the sub-string between the first occurences of Start and Stop.
  1370. Description:
  1371. The StrBetween routine returns the that portion of the string that appears between
  1372. the first occurences of the Start and Stop characters. For example,
  1373. StrBetween('Hello world', 'e', 'r') returns 'llo wo'. Note that if the position
  1374. of Start is greater than Stop, or either of these characters is not found in the
  1375. source string, the result is an empty string. If the Start and Stop symbols are
  1376. equal StrBetween returns the string between the first and second occurence of
  1377. that particular symbol.
  1378. Parameters:
  1379. S - The source string from which to extract the sub-string
  1380. Start - The character which denotes the start of the sub-string to extract.
  1381. Stop - The character which denotes the end of the sub-string to extract.
  1382. Result:
  1383. If the function succeeds, it returns the sub-string between the first occurence of
  1384. Start and Stop, not including either of these characters. If the function fails
  1385. it returns an empty string, for example if the Start and/or Stop character doesn't
  1386. appear in the sources string.
  1387. Donator:
  1388. Anthony Steele
  1389. --------------------------------------------------------------------------------
  1390. @@StrChopRight
  1391. <GROUP StringManipulation.StringExtraction>
  1392. Summary:
  1393. Removes the last N characters from the string.
  1394. Description:
  1395. StrChopRight removes the last N characters from the specified string and returns
  1396. the resulting string.
  1397. Parameters:
  1398. S - The source string from which the characters are removed.
  1399. N - The number of characters to remove from the end of the string.
  1400. Result:
  1401. The string with the last N characters cut off. Note that when N is larger than
  1402. the string length, the result is an empty string.
  1403. Donator:
  1404. Anthony Steele
  1405. --------------------------------------------------------------------------------
  1406. @@StrLeft
  1407. <GROUP StringManipulation.StringExtraction>
  1408. Summary:
  1409. Returns the Count leftmost characters from the string.
  1410. Description:
  1411. StrLeft returns the Count number of leftmost characters from the supplied string.
  1412. Note that if the supplied string contains fewer than Count characters, the function
  1413. returns the entire string.
  1414. Parameters:
  1415. S - The string from which to copy.
  1416. Count - The number of characters to copy.
  1417. Result:
  1418. The Count leftmost characters from S.
  1419. See also:
  1420. StrRight
  1421. Donator:
  1422. Anthony Steele
  1423. --------------------------------------------------------------------------------
  1424. @@StrMid
  1425. <GROUP StringManipulation.StringExtraction>
  1426. Summary:
  1427. Copies part of a string.
  1428. Description:
  1429. StrMid copies the part of the source string defined by Start and Count.
  1430. If Start exceeds the length of the string then an empty string is returned.
  1431. The extracted sub-string can be shorter than Count if Start+Count exceed the string length.
  1432. Parameters:
  1433. S - Source string.
  1434. Start - Index of the first character to copy.
  1435. Count - Number of characters to copy.
  1436. Result:
  1437. The string copied from S starting at offset Start and with length Count.
  1438. Donator:
  1439. John C Molyneux
  1440. --------------------------------------------------------------------------------
  1441. @@StrRestOf
  1442. <GROUP StringManipulation.StringExtraction>
  1443. Summary:
  1444. Returns the remainder of a string starting at the specified index.
  1445. Description:
  1446. StrRestOf returns the remainder of the the string starting at index N. For example,
  1447. StrRestOf('Project JEDI', 9) returns 'JEDI' (index 9 through Length(S)).
  1448. Parameters:
  1449. S - The source string from which to copy.
  1450. N - The starting index of the characters to copy.
  1451. Result:
  1452. The remainder of the string starting at the specified index.
  1453. Donator:
  1454. Anthony Steele
  1455. --------------------------------------------------------------------------------
  1456. @@StrRight
  1457. <GROUP StringManipulation.StringExtraction>
  1458. Summary:
  1459. Returns the Count rightmost characters from the string.
  1460. Description:
  1461. StrRight returns the Count number of rightmost characters from the supplied string.
  1462. Note that if the supplied string contains fewer than Count characters, the function
  1463. returns the entire string.
  1464. Parameters:
  1465. S - The string from which to copy.
  1466. Count - The number of characters to copy.
  1467. Result:
  1468. The Count of rightmost characters from S.
  1469. See also:
  1470. StrLeft
  1471. Donator:
  1472. Anthony Steele
  1473. --------------------------------------------------------------------------------
  1474. @@CharEqualNoCase
  1475. <GROUP StringManipulation.CharacterTestRoutines>
  1476. Summary:
  1477. Test whether two characters are equal except possibly for case.
  1478. Description:
  1479. CharEqualNoCase determines whether two characters are equal except possibly for
  1480. case differences. For example, 'a' and 'a' are obviously equal but so are 'a' and 'A'.
  1481. Parameters:
  1482. C1 - The first character to test.
  1483. C1 - The second character to test.
  1484. Result:
  1485. If the supplied characters are equal except for case, the result is True, otherwise
  1486. the result is False.
  1487. Donator:
  1488. Anthony Steele
  1489. --------------------------------------------------------------------------------
  1490. @@CharIsAlpha
  1491. <GROUP StringManipulation.CharacterTestRoutines>
  1492. Summary:
  1493. Tests whether C is an alpha character.
  1494. Description:
  1495. CharIsAlpha returns whether or not the supplied character is an alpha character.
  1496. That is, if C comes from the ['a'..'z', 'A'..'Z'] set.
  1497. Parameters:
  1498. C - The character to test
  1499. Result:
  1500. If C is an alpha character the return value is True, otherwise the return value is False.
  1501. See also:
  1502. CharIsDigit
  1503. CharIsNumberChar
  1504. CharIsAlphaNum
  1505. Donator:
  1506. Marcel van Brakel
  1507. --------------------------------------------------------------------------------
  1508. @@CharIsAlphaNum
  1509. <GROUP StringManipulation.CharacterTestRoutines>
  1510. Summary:
  1511. Test whether C is an alphanumeric character.
  1512. Description:
  1513. CharIsAlphaNum returns whether or not C is an alphanumerical character. That is,
  1514. if C comes from the ['a'..'z', 'A'..'Z', '0'..'9'] set.
  1515. Parameters:
  1516. C - The character to test.
  1517. Result:
  1518. If C is an alphanumerical character the return value is True, otherwise the return value is False.
  1519. See also:
  1520. CharIsAlpha
  1521. CharIsNumberChar
  1522. CharIsDigit
  1523. Donator:
  1524. Anthony Steele
  1525. --------------------------------------------------------------------------------
  1526. @@CharIsBlank
  1527. <GROUP StringManipulation.CharacterTestRoutines>
  1528. Summary:
  1529. Test whether C is a blank character.
  1530. Description:
  1531. CharIsBlank returns whether or not C is a blank character.
  1532. Parameters:
  1533. C - The character to test.
  1534. Result:
  1535. If C is a blank character the return value is True, otherwise the return value is False.
  1536. Donator:
  1537. Azret Botash
  1538. --------------------------------------------------------------------------------
  1539. @@CharIsControl
  1540. <GROUP StringManipulation.CharacterTestRoutines>
  1541. Summary:
  1542. Tests whether C is a control character.
  1543. Description:
  1544. CharIsControl tests whether C is a control character. That is, if it has an
  1545. ordinal value smaller than 32.
  1546. Parameters:
  1547. C - Character to test.
  1548. Result:
  1549. If C is a control character the result is True, otherwise the result is False.
  1550. Donator:
  1551. Anthony Steele
  1552. --------------------------------------------------------------------------------
  1553. @@CharIsDelete
  1554. <GROUP StringManipulation.CharacterTestRoutines>
  1555. Summary:
  1556. Tests whether C is a delete character.
  1557. Description:
  1558. CharIsDelete tests whether C is a delete character. That is, if it has an
  1559. ordinal value of 8.
  1560. Parameters:
  1561. C - Character to test.
  1562. Result:
  1563. If C is a delete character the result is True, otherwise the result is False.
  1564. Donator:
  1565. Anthony Steele
  1566. --------------------------------------------------------------------------------
  1567. @@CharIsDigit
  1568. <GROUP StringManipulation.CharacterTestRoutines>
  1569. Summary:
  1570. Test whether C is a digit.
  1571. Description:
  1572. CharIsDigit returns whether or not C is a digit. That is, if C comes from
  1573. the ['0'..'9'] set.
  1574. Parameters:
  1575. C - The character to test.
  1576. Result:
  1577. If C is a digit the return value is True, otherwise the return value is False.
  1578. See also:
  1579. CharIsAlpha
  1580. CharIsNumberChar
  1581. CharIsAlphaNum
  1582. Donator:
  1583. Marcel van Brakel
  1584. --------------------------------------------------------------------------------
  1585. @@CharIsLower
  1586. <GROUP StringManipulation.CharacterTestRoutines>
  1587. Summary:
  1588. Tests whether a character is lowercase.
  1589. Description:
  1590. CharIsLower returns whether the specified character is lowercase.
  1591. Parameters:
  1592. C - The character to test.
  1593. Result:
  1594. If C is lowercase the return value is True, otherwise the return value is False.
  1595. Donator:
  1596. Azret Botash
  1597. --------------------------------------------------------------------------------
  1598. @@CharIsNumberChar
  1599. <GROUP StringManipulation.CharacterTestRoutines>
  1600. Summary:
  1601. Tests whether C is a number.
  1602. Description:
  1603. CharIsNumberChar returns whether or not the supplied character can occur in a number. That is,
  1604. if it comes from the ['0'..'9', '+', '-', '.'] set where the dot is replaced by the
  1605. system's decimal separator character.
  1606. Parameters:
  1607. C - Character to test.
  1608. Result:
  1609. If C is a number the result is True, otherwise the result is False.
  1610. See also:
  1611. CharIsAlpha
  1612. CharIsAlphaNum
  1613. CharIsDigit
  1614. Platforms:
  1615. Windows NT/2000: Requires Windows NT 4 or later.
  1616. Windows 95/98: Requires Windows 95 or later.
  1617. Requirements:
  1618. Shell32 Version 4.00 or later.
  1619. Donator:
  1620. Anthony Steele
  1621. --------------------------------------------------------------------------------
  1622. @@CharIsPrintable
  1623. <GROUP StringManipulation.CharacterTestRoutines>
  1624. Summary:
  1625. Tests whether a character is printable.
  1626. Description:
  1627. CharIsPrintable returns whether the specified character is
  1628. printable. A printable character is any character which is
  1629. not a control character and as such has an ordinal value
  1630. larger than 31.
  1631. Parameters:
  1632. C - The character to test.
  1633. Result:
  1634. If C is printable the return value is True, otherwise the return value is False.
  1635. Donator:
  1636. Azret Botash
  1637. --------------------------------------------------------------------------------
  1638. @@CharIsPunctuation
  1639. <GROUP StringManipulation.CharacterTestRoutines>
  1640. Summary:
  1641. Tests whether a character is a punctuation character.
  1642. Description:
  1643. CharIsPunctuation returns whether the specified character is a punctuation character.
  1644. An example would be '.'.
  1645. Parameters:
  1646. C - The character to test.
  1647. Result:
  1648. If C is a punctuation character the return value is True, otherwise the return
  1649. value is False.
  1650. Donator:
  1651. Azret Botash
  1652. --------------------------------------------------------------------------------
  1653. @@CharIsReturn
  1654. <GROUP StringManipulation.CharacterTestRoutines>
  1655. Summary:
  1656. Tests whether C is a return character.
  1657. Description:
  1658. CharIsReturn returns whether C is a return character. In this context both the
  1659. carriage return (#13) as well as the linefeed (#10) are considered return.
  1660. characters.
  1661. Parameters:
  1662. C - Character to test.
  1663. Result:
  1664. If C is a return character the result is True, otherwise the result is False.
  1665. Donator:
  1666. Anthony Steele
  1667. --------------------------------------------------------------------------------
  1668. @@CharIsSpace
  1669. <GROUP StringManipulation.CharacterTestRoutines>
  1670. Summary:
  1671. Tests whether C represents space.
  1672. Description:
  1673. CharIsSpace returns whether or not the C character represents
  1674. space(s). In this context that means the character is tested
  1675. against the space (' '), tab (#9), line feed (#10), vertical tab
  1676. (#11), form feed (#12) and carriage return (#13) characters.
  1677. Parameters
  1678. C - Character to test.
  1679. Result:
  1680. If the character represents a space the result is True,
  1681. otherwise the result is False.
  1682. See also:
  1683. CharIsWhiteSpace
  1684. Donator:
  1685. Anthony Steele
  1686. --------------------------------------------------------------------------------
  1687. @@CharIsUpper
  1688. <GROUP StringManipulation.CharacterTestRoutines>
  1689. Summary:
  1690. Tests whether a character is uppercase.
  1691. Description:
  1692. CharIsUpper returns whether the specified character is uppercase.
  1693. Parameters:
  1694. C - The character to test.
  1695. Result:
  1696. If C is uppercase the return value is True, otherwise the return value is False.
  1697. Donator:
  1698. Azret Botash
  1699. --------------------------------------------------------------------------------
  1700. @@CharIsWhiteSpace
  1701. <GROUP StringManipulation.CharacterTestRoutines>
  1702. Summary:
  1703. Tests whether C represents space.
  1704. Description:
  1705. CharIsWhiteSpace returns whether or not the C character represents a space.
  1706. Unlike CharIsSpace this function returns True if the specified
  1707. character comes from the AnsiWhiteSpace set which is defined as:
  1708. AnsiWhiteSpace = [AnsiTab, AnsiLineFeed, AnsiVerticalTab, AnsiFormFeed, AnsiCarriageReturn,
  1709. AnsiSpace];
  1710. Parameters:
  1711. C - Character to test.
  1712. Result:
  1713. If the character represents a space the result is True, otherwise the result is False.
  1714. See also:
  1715. CharIsSpace
  1716. Donator:
  1717. Anthony Steele
  1718. --------------------------------------------------------------------------------
  1719. @@CharType
  1720. <GROUP StringManipulation.CharacterTestRoutines>
  1721. Summary:
  1722. Returns character type information.
  1723. Description:
  1724. The CharType function returns character type information about the specified
  1725. character. This routine returns the same information as routines such as IsCharControl.
  1726. For further information about character type information see the documentation for
  1727. the GetStringTypeEx routine in the Platform SDK.
  1728. Parameters:
  1729. C - The character for which to retriev type information.
  1730. Result:
  1731. The type of the character, this can be one of the following values.
  1732. <TABLE>
  1733. Name Value Meaning
  1734. --------- ------ ---------------------------------------------------------------
  1735. C1_UPPER 0x0001 Uppercase
  1736. C1_LOWER 0x0002 Lowercase
  1737. C1_DIGIT 0x0004 Decimal digits
  1738. C1_SPACE 0x0008 Space characters
  1739. C1_PUNCT 0x0010 Punctuation
  1740. C1_CNTRL 0x0020 Control characters
  1741. C1_BLANK 0x0040 Blank characters
  1742. C1_XDIGIT 0x0080 Hexadecimal digits
  1743. C1_ALPHA 0x0100 Any linguistic character: alphabetic, syllabary, or ideographic
  1744. </TABLE>
  1745. Notes:
  1746. In a future Linux version the values may differ.
  1747. Donator:
  1748. Azret Botash
  1749. --------------------------------------------------------------------------------
  1750. @@CharHex
  1751. <GROUP StringManipulation.CharacterTransformationRoutines>
  1752. Summary:
  1753. Converts a hex digit character to its binary value.
  1754. Description:
  1755. Converts a hex digit character to its binary value, ie $0 to $f.
  1756. If the character is no hex digit then $ff is returned.
  1757. Parameters:
  1758. C - A hex digit to convert
  1759. Result:
  1760. The binary value of the hex digit or $ff if it was no hex digit.
  1761. Donator:
  1762. Azret Botash
  1763. --------------------------------------------------------------------------------
  1764. @@CharLower
  1765. <GROUP StringManipulation.CharacterTransformationRoutines>
  1766. Summary:
  1767. Lowercases a character.
  1768. Description:
  1769. CharLower converts the supplied character to lowercase. For example 'A' becomes
  1770. 'a'. If the character is already lowercase the function does nothing.
  1771. Parameters:
  1772. C - Character to convert to lowercase.
  1773. Result:
  1774. Copy of character converted to lowercase.
  1775. See also:
  1776. CharUpper
  1777. CharToggleCase
  1778. Donator:
  1779. Azret Botash
  1780. --------------------------------------------------------------------------------
  1781. @@CharUpper
  1782. <GROUP StringManipulation.CharacterTransformationRoutines>
  1783. Summary:
  1784. Uppercases a character.
  1785. Description:
  1786. CharUpper converts the supplied character to uppercase. For example 'a' becomes
  1787. 'A'. If the character is already uppercase the function does nothing.
  1788. Parameters:
  1789. C - The character to convert to upper case.
  1790. Result:
  1791. Copy of the character converted to uppercase.
  1792. See also:
  1793. CharLower
  1794. CharToggleCase
  1795. Donator:
  1796. Azret Botash
  1797. --------------------------------------------------------------------------------
  1798. @@CharToggleCase
  1799. <GROUP StringManipulation.CharacterTransformationRoutines>
  1800. Summary:
  1801. Reverses the case of a character.
  1802. Description:
  1803. CharToggleCase reverses the case of the supplied character. That is, if you pass an
  1804. uppercase character the function converts it to lowercase, if you pass a lowercase
  1805. character the function converts it to uppercase.
  1806. Parameters:
  1807. C - Character whose case to reverse.
  1808. Result:
  1809. Copy of the character with the case reversed.
  1810. Donator:
  1811. Azret Botash
  1812. --------------------------------------------------------------------------------
  1813. @@CharPos
  1814. <GROUP StringManipulation.CharacterSearchandReplace>
  1815. Summary:
  1816. Finds the position of a character in a string.
  1817. Description:
  1818. CharPos returns the 1-based index of the first occurrence of the supplied character
  1819. in the string. The search starts at the supplied index and is case sensitive.
  1820. Parameters:
  1821. S - String to search.
  1822. C - The character to search for.
  1823. Index - The character index where CharPos begins searching.
  1824. Result:
  1825. The 1-based index of the first occurrence found, or 0 if the character was not found.
  1826. Donator:
  1827. Azret Botash
  1828. --------------------------------------------------------------------------------
  1829. @@CharIPos
  1830. <GROUP StringManipulation.CharacterSearchandReplace>
  1831. Summary:
  1832. Finds the position of a character in a string.
  1833. Description:
  1834. CharPos returns the 1-based index of the first occurrence of the supplied character
  1835. in the string. The search starts at the supplied index and is case insensitive.
  1836. Parameters:
  1837. S - String to search.
  1838. C - The character to search for.
  1839. Index - The character index where CharPos begins searching.
  1840. Result:
  1841. The 1-based index of the first occurrence found, or 0 if the character was not found.
  1842. Donator:
  1843. Azret Botash
  1844. --------------------------------------------------------------------------------
  1845. @@CharReplace
  1846. <GROUP StringManipulation.CharacterSearchandReplace>
  1847. Summary:
  1848. Replaces all occurrences of a character in a string.
  1849. Description:
  1850. CharReplace replaces all occurrences of the specified search character with the
  1851. supplied replace character. It returns the number of replacements performed.
  1852. Note that the replacement is case-sensitive.
  1853. Parameters:
  1854. S - The string in which to replace characters.
  1855. Search - The character to replace.
  1856. Replace - The character to use as a replacement of Search.
  1857. Result:
  1858. CharReplace returns the number of replacements performed.
  1859. Donator:
  1860. Azret Botash
  1861. --------------------------------------------------------------------------------
  1862. @@StringsToPCharVector
  1863. <GROUP StringManipulation.PCharVector>
  1864. Summary:
  1865. Converts a stringlist into a PCharVector.
  1866. Description:
  1867. A PCharVector is an array of PChar's where each PChar points to a null terminated
  1868. string. The array is delimited by a nil (NULL) pointer. In the Windows API this is
  1869. usually typed as a PPSTR. This function takes a string list and builds a
  1870. PCharVector from it. The memory allocated to store the PCharVector must eventually
  1871. be released by the caller, preferably using FreePCharVector.
  1872. Parameters:
  1873. Dest - On return receives a pointer to the PCharVector.
  1874. Source - String list to convert to a PCharVector.
  1875. Result:
  1876. The value placed in Dest to allow using the function on parameter position.
  1877. See also:
  1878. PCharVectorToStrings
  1879. PCharVectorCount
  1880. FreePCharVector
  1881. Donator:
  1882. Marcel van Brakel
  1883. --------------------------------------------------------------------------------
  1884. @@PCharVectorCount
  1885. <GROUP StringManipulation.PCharVector>
  1886. Summary:
  1887. Returns the number of elements in a PCharVector.
  1888. Description:
  1889. PCharVectorCount returns the number of items, PChar's, in the supplied PCharVector
  1890. excluding the NULL terminator.
  1891. Parameters:
  1892. PCharVector - The PCharVector to count the elements in.
  1893. Result:
  1894. The number of elements in the PCharVector excluding the NULL terminator.
  1895. See also:
  1896. PCharVectorToStrings
  1897. StringsToPCharVector
  1898. FreePCharVector
  1899. Donator:
  1900. Marcel van Brakel
  1901. --------------------------------------------------------------------------------
  1902. @@PCharVectorToStrings
  1903. <GROUP StringManipulation.PCharVector>
  1904. Summary:
  1905. Converts a PCharVector to a stringlist.
  1906. Description:
  1907. A PCharVector is an array of PChar's where each PChar points to a null terminated
  1908. string. The array is delimited by a nil (NULL) pointer. In the Windows API this is
  1909. usually typed as a PPSTR. This function takes such a PCharVector and converts it
  1910. to a stringlist. Note that the memory for the PCharVector is not freed by this
  1911. function.
  1912. Parameters:
  1913. Dest - List which recieves the elements in the PCharVector.
  1914. Source - PCharVector from which to retrieve the elements.
  1915. See also:
  1916. PCharVectorCount
  1917. StringsToPCharVector
  1918. FreePCharVector
  1919. Donator:
  1920. Marcel van Brakel
  1921. --------------------------------------------------------------------------------
  1922. @@FreePCharVector
  1923. <GROUP StringManipulation.PCharVector>
  1924. Summary:
  1925. Frees a PCharVector
  1926. Description:
  1927. FreePCharVector frees the memory pointed to by Dest and sets Dest to nil.
  1928. Only hand in memory allocated by StringsToPCharVector.
  1929. Freeing a PCharVector allocated by a Windows API function will crash your program.
  1930. Parameters:
  1931. Dest - The PCharVector whose memory to free.
  1932. See also:
  1933. PCharVectorCount
  1934. StringsToPCharVector
  1935. PCharVectorToStrings
  1936. Donator:
  1937. Marcel van Brakel
  1938. --------------------------------------------------------------------------------
  1939. @@StringsToMultiSz
  1940. <GROUP StringManipulation.MultiSz>
  1941. Summary:
  1942. Converts a stringlist to a list of null terminated strings.
  1943. Description:
  1944. StringsToMultiSz concatenates the strings in Source into a single PChar string,
  1945. terminating each individual string with a NULL character and the last string with
  1946. a double NULL character. For example, if Source contains the items 'Project',
  1947. 'JEDI' and 'Rules' Dest will point to a string with the contents 'Project#0JEDI#0Rules#0#0'
  1948. Parameters:
  1949. Dest - PChar receives a pointer to the resulting string.
  1950. Source - List of strings to pack into a single string. This list may not contain empty items
  1951. (items with the value '') or an EJclStringError is raised.
  1952. Result:
  1953. On success the function returns the value of Dest. If the function fails to allocate
  1954. memory for the result string it (implicitly) raises an EOutOfMemory exception. The
  1955. caller is responsible for releasing the memory pointed to by Dest.
  1956. See also:
  1957. MultiSzToStrings
  1958. FreeMultiSz
  1959. Donator:
  1960. Marcel van Brakel
  1961. --------------------------------------------------------------------------------
  1962. @@MultiSzToStrings
  1963. <GROUP StringManipulation.MultiSz>
  1964. Summary:
  1965. Converts a list of null terminated strings to a string list.
  1966. Description:
  1967. Source is assumed to be a list of strings, separated by a NULL character, terminated
  1968. by a double NULL character. For example 'Project#0JEDI#0Rules#0#0'. The function
  1969. takes this string and copies the individual strings to the string list. Thus,
  1970. after executing this function with the above string the Dest list will contain
  1971. the items 'Project', 'JEDI' and 'Rules'.
  1972. Parameters:
  1973. Dest - The string list to receive the individual strings.
  1974. Source - The source string to extract the items from.
  1975. Notes:
  1976. This function does not release the memory associated with Source.
  1977. See also:
  1978. StringsToMultiSz
  1979. FreeMultiSz
  1980. Donator:
  1981. Marcel van Brakel
  1982. --------------------------------------------------------------------------------
  1983. @@FreeMultiSz
  1984. <GROUP StringManipulation.MultiSz>
  1985. Summary:
  1986. Frees the memory pointed to by Dest.
  1987. Description:
  1988. FreeMultiSz frees the memory pointed to by Dest which is assumed to be a list
  1989. of strings, each terminated by a NULL character, terminated by a double NULL
  1990. character.
  1991. Parameters:
  1992. Dest - The memory to free. Is set to nil before return.
  1993. See also:
  1994. StringsToMultiSz
  1995. MultiSzToStrings
  1996. Donator:
  1997. Marcel van Brakel
  1998. --------------------------------------------------------------------------------
  1999. @@StringsToMultiString
  2000. <GROUP StringManipulation.MultiSz>
  2001. Summary:
  2002. Assembles a single string from multiple strings
  2003. Description:
  2004. StringsToMultiString concatenates the strings in Value into a single ANSI string,
  2005. terminating each individual string with a NULL character and the last string with
  2006. a double NULL character. For example, if Source contains the items 'Project',
  2007. 'JEDI' and 'Rules' the result will be a string with the contents 'Project#0JEDI#0Rules#0#0'.
  2008. Parameters:
  2009. Value - List resp. array of strings to pack into a single string. If assertions are enabled, an
  2010. EAssertionFailed exception is raised when an empty string is encountered; otherwise it will be
  2011. skipped.
  2012. Result:
  2013. The string concatenated from the list or array of strings.
  2014. See also:
  2015. StringsToMultiWideString
  2016. StringsToMultiSz
  2017. MultiStringToStrings
  2018. Donator:
  2019. Anonymous
  2020. --------------------------------------------------------------------------------
  2021. @@StringsToMultiWideString
  2022. <GROUP StringManipulation.MultiSz>
  2023. Summary:
  2024. Assembles a single string from multiple strings
  2025. Description:
  2026. StringsToMultiWideString concatenates the strings in Value into a single wide string,
  2027. terminating each individual string with a NULL character and the last string with
  2028. a double NULL character. For example, if Source contains the items 'Project',
  2029. 'JEDI' and 'Rules' the result will be a string with the contents 'Project#0JEDI#0Rules#0#0'.
  2030. Parameters:
  2031. Value - List resp. array of strings to pack into a single string. If assertions are enabled, an
  2032. EAssertionFailed exception is raised when an empty string is encountered; otherwise it will be
  2033. skipped.
  2034. Result:
  2035. The string concatenated from the list or array of strings.
  2036. See also:
  2037. StringsToMultiString
  2038. StringsToMultiSz
  2039. MultiWideStringToStrings
  2040. Donator:
  2041. Anonymous
  2042. --------------------------------------------------------------------------------
  2043. @@MultiStringToStrings
  2044. <GROUP StringManipulation.MultiSz>
  2045. Summary:
  2046. Parses a string by separating into substrings whenever a NULL character is encountered.
  2047. Description:
  2048. Value is assumed to be a list of strings, separated by a NULL character, terminated
  2049. by a double NULL character. For example 'Project#0JEDI#0Rules#0#0'. The function
  2050. takes this string and copies the individual strings to Dest. Thus, after executing
  2051. this function with the above string the Dest list/array will contain the items
  2052. 'Project', 'JEDI' and 'Rules'.
  2053. Parameters:
  2054. Dest - The string list resp. dynamic array to receive the individual strings.
  2055. Value - The source string to extract the items from.
  2056. See also:
  2057. MultiWideStringToStrings
  2058. StringsToMultiString
  2059. Donator:
  2060. Anonymous
  2061. --------------------------------------------------------------------------------
  2062. @@MultiWideStringToStrings
  2063. <GROUP StringManipulation.MultiSz>
  2064. Summary:
  2065. Parses a string by separating into substrings whenever a NULL character is encountered.
  2066. Description:
  2067. Value is assumed to be a list of strings, separated by a NULL character, terminated
  2068. by a double NULL character. For example 'Project#0JEDI#0Rules#0#0'. The function
  2069. takes this string and copies the individual strings to Dest. Thus, after executing
  2070. this function with the above string the Dest list/array will contain the items
  2071. 'Project', 'JEDI' and 'Rules'.
  2072. Parameters:
  2073. Dest - The string list resp. dynamic array to receive the individual strings.
  2074. Value - The source string to extract the items from.
  2075. See also:
  2076. MultiStringToStrings
  2077. StringsToMultiWideString
  2078. Donator:
  2079. Anonymous
  2080. --------------------------------------------------------------------------------
  2081. @@StrToStrings
  2082. <GROUP StringManipulation.TStringsManipulation>
  2083. Summary:
  2084. Converts a string into a list of strings using the specified
  2085. separator character.
  2086. Description:
  2087. StrToStrings converts the supplied string, which supposedly is
  2088. a list of strings packed into a single string variable, to a
  2089. TStrings. The function uses the supplied separator string to
  2090. separate the string into its individual elements.
  2091. For example, if you call the function like this:
  2092. StrToStrings('Project JEDI Rules', ' ', List) then on return
  2093. list will contain three items, namely 'Project', 'JEDI', and
  2094. 'Rules'. As this example shows, the last string doesn't have
  2095. to be terminated by the separator string although it is
  2096. allowed.
  2097. Notes:
  2098. The list will be cleared by this function before adding the
  2099. elements.
  2100. Parameters:
  2101. List - A TStrings derivative that receives the individual elements.
  2102. S - The string to split into elements.
  2103. Sep - The string that separates the individual elements.
  2104. See also:
  2105. StringsToStr
  2106. Donator:
  2107. Anthony Steele
  2108. --------------------------------------------------------------------------------
  2109. @@StringsToStr
  2110. <GROUP StringManipulation.TStringsManipulation>
  2111. Summary:
  2112. Converts a stringlist to a single string.
  2113. Description:
  2114. StringsToStr concatenates the items in List, separating them with the specified
  2115. separator string and returns the resulting string. The last element is not terminated
  2116. with the separator (its a separator not a terminator after all).
  2117. Parameters:
  2118. List - Stringlist which contains the strings to concatenate.
  2119. Sep - String to separate the individual strings with.
  2120. See also:
  2121. StrToStrings
  2122. Donator:
  2123. Marcel van Brakel
  2124. --------------------------------------------------------------------------------
  2125. @@TrimStrings
  2126. <GROUP StringManipulation.TStringsManipulation>
  2127. Summary:
  2128. Trims all strings in a string list.
  2129. Description:
  2130. TrimStrings trims all strings in the specified stringlist using the standard
  2131. Delphi Trim procedure. If an entry in the list is empty or trimming it causes
  2132. it to become empty, the entry is optionally deleted from the list depending the
  2133. DeleteIfEmpty parameter.
  2134. Parameters:
  2135. List - The stringlist whose contents to trim.
  2136. DeleteIfEmpty - If True and a list entry is empty, or trimming it results in an empty string, the entry is deleted from the list.
  2137. See also:
  2138. TrimStringsRight
  2139. TrimStringsLeft
  2140. Donator:
  2141. Anthony Steele
  2142. --------------------------------------------------------------------------------
  2143. @@TrimStringsRight
  2144. <GROUP StringManipulation.TStringsManipulation>
  2145. Summary:
  2146. Right trims all strings in a stringlist.
  2147. Description:
  2148. TrimStringsRight right trims all strings in the specified stringlist using the
  2149. standard Delphi TrimRight procedure. If an entry in the list is empty or trimming
  2150. it causes it to become empty, the entry is optionally deleted from the list
  2151. depending on the DeleteIfEmpty parameter.
  2152. Parameters:
  2153. List - The stringlist whose contents to right trim.
  2154. DeleteIfEmpty - If True and a list entry is empty, or trimming it results in an empty string, the entry is deleted from the list.
  2155. See also:
  2156. TrimStrings
  2157. TrimStringsLeft
  2158. Donator:
  2159. Anthony Steele
  2160. --------------------------------------------------------------------------------
  2161. @@TrimStringsLeft
  2162. <GROUP StringManipulation.TStringsManipulation>
  2163. Summary:
  2164. Left trims all strings in a stringlist.
  2165. Description:
  2166. TrimStringsLeft left trims all strings in the specified stringlist using the
  2167. standard Delphi TrimLeft procedure. If an entry in the list is empty or trimming
  2168. it causes it to become empty, the entry is optionally deleted from the list
  2169. depending on the DeleteIfEmpty parameter.
  2170. Parameters:
  2171. List - The stringlist whose contents to left trim.
  2172. DeleteIfEmpty - If True and a list entry is empty, or trimming it results in an empty string, the entry is deleted from the list.
  2173. See also:
  2174. TrimStrings
  2175. TrimStringsRight
  2176. Donator:
  2177. Anthony Steele
  2178. --------------------------------------------------------------------------------
  2179. @@StrTokenToStrings
  2180. <GROUP StringManipulation.Miscellaneous>
  2181. Summary:
  2182. Breaks apart S using a specified delimiter into a StringList.
  2183. Description:
  2184. Use StrTokenToStrings for breaking apart a string with parts delimited by a
  2185. separator. For example, if you passed 'C:\Windows;C:\Delphi;C:\JEDI;' List would
  2186. contain 'C:\Windows', 'C:\Delphi', 'C:\JEDI'.
  2187. You must create the StringList prior to passing it to StrTokenToString and
  2188. Free the StringList once finished with it.
  2189. Parameters:
  2190. S - A string which contains one or more Separators (see List parameter).
  2191. Separator - Any character you want to use to separate S.
  2192. List - Returns separated parts or the entire string if no separator occurs.
  2193. See also:
  2194. StrToken
  2195. Donator:
  2196. Huanlin Tsai
  2197. --------------------------------------------------------------------------------
  2198. @@StrToken
  2199. <GROUP StringManipulation.Miscellaneous>
  2200. Summary:
  2201. Returns a sub-string from S which is followed by Separator and deletes the sub-string from S including the separator.
  2202. Description:
  2203. Splits a string into the part preceding the separator, which is returned
  2204. as function result, and the part following the separator which is placed
  2205. in S.
  2206. If no separator is contained in the string then the string is returned
  2207. as the function result and S becomes an empty string.
  2208. Parameters:
  2209. S - The string you want to return the part after the Separator.
  2210. Separator - A character which determines where to break the string up at.
  2211. Result:
  2212. Any part of S in front of Separator, or the original string if Separator
  2213. was not located in S.
  2214. S returns the remaining portion of the string after (but not including) Separator.
  2215. If Separator was not found, S is an empty string.
  2216. See also:
  2217. StrTokenToStrings
  2218. Donator:
  2219. Huanlin Tsai
  2220. --------------------------------------------------------------------------------
  2221. @@StrTokens
  2222. <GROUP StringManipulation.Miscellaneous>
  2223. Summary:
  2224. TODO
  2225. Description:
  2226. TODO
  2227. Parameters:
  2228. S - TODO
  2229. List - TODO
  2230. Result:
  2231. TODO
  2232. Donator:
  2233. Azret Botash
  2234. --------------------------------------------------------------------------------
  2235. @@StrWord
  2236. <GROUP StringManipulation.Miscellaneous>
  2237. Summary:
  2238. TODO
  2239. Description:
  2240. TODO
  2241. Parameters:
  2242. TODO
  2243. Result:
  2244. TODO
  2245. Donator:
  2246. Azret Botash
  2247. --------------------------------------------------------------------------------
  2248. @@FileToString
  2249. <GROUP StringManipulation.Miscellaneous>
  2250. Summary:
  2251. Reads the contents of a file into a string.
  2252. Description:
  2253. The FileToString routine reads the contents of the specified file into a string
  2254. and returns it as the function result. Note that the function doesn't care about
  2255. the contents of the file, it simply treats the string as a buffer and copies the
  2256. entire file contents into it.
  2257. Parameters:
  2258. FileName - Full qualified name of the file whose contents to read.
  2259. Result:
  2260. The contents of the file as a string buffer. Note that if the file contains
  2261. null terminating characters, the string will contain the entire contents but
  2262. for example displaying the string will only show the part of the string up to
  2263. the first null terminator.
  2264. See also:
  2265. StringToFile
  2266. Donator:
  2267. Anthony Steele
  2268. --------------------------------------------------------------------------------
  2269. @@StringToFile
  2270. <GROUP StringManipulation.Miscellaneous>
  2271. Summary:
  2272. Writes a string to a file.
  2273. Description:
  2274. The StringToFile routine writes the contents of the specified string to a file.
  2275. Note that the full content is written to the file, including any null terminating
  2276. characters. The string is considered a generic buffer and can contains anything.
  2277. Parameters:
  2278. FileName - Fully qualified name of the file.
  2279. Contents - The string whose contents to write to the file.
  2280. See also:
  2281. FileToString
  2282. Donator:
  2283. Anthony Steele
  2284. --------------------------------------------------------------------------------
  2285. @@StrRepeatLength@AnsiString@Integer
  2286. <GROUP StringManipulation.StringTransformationRoutines>
  2287. Summary:
  2288. Repeats a string until a specified length L has been reached.
  2289. Description:
  2290. The StrRepeatLength routine returns a string consisting of
  2291. the specified string, repeated until the length of the string
  2292. is exactly L. For example StrRepeatLength('JEDI!', 12) returns
  2293. 'JEDI!JEDI!JE'.
  2294. Parameters:
  2295. S - The string to repeat.
  2296. L - Length of the resulting string.
  2297. Returns:
  2298. A string consisting of the specified string, repeated until
  2299. the length of the string is exactly L.
  2300. Donator:
  2301. Anonymous
  2302. --------------------------------------------------------------------------------
  2303. @@StrCharPosLower@AnsiString@Integer
  2304. <GROUP StringManipulation.StringTransformationRoutines>
  2305. Summary:
  2306. Lowercases a character within a string.
  2307. Description:
  2308. The StrCharPosLower routine returns a string with the specified character in lowercase.
  2309. If the character is already lowercase the function does nothing.
  2310. Parameters:
  2311. S - The string which contains the character.
  2312. CharPos - The position of the character within the string to convert.
  2313. Donator:
  2314. Jean-Fabien Connault
  2315. --------------------------------------------------------------------------------
  2316. @@StrCharPosUpper@AnsiString@Integer
  2317. <GROUP StringManipulation.StringTransformationRoutines>
  2318. Summary:
  2319. Uppercases a character within a string.
  2320. Description:
  2321. The StrCharPosUpper routine returns a string with the specified character in uppercase.
  2322. If the character is already uppercase the function does nothing.
  2323. Parameters:
  2324. S - The string which contains the character.
  2325. CharPos - The position of the character within the string to convert.
  2326. Donator:
  2327. Jean-Fabien Connault
  2328. --------------------------------------------------------------------------------
  2329. @@StrTrimCharsLeft
  2330. <GROUP StringManipulation.StringTransformationRoutines>
  2331. Summary:
  2332. Removes characters from the left side of supplied string.
  2333. Description:
  2334. StrTrimCharsLeft removes all characters defined in the "Chars" set from
  2335. the left side of the string.
  2336. Parameters:
  2337. S - The string to trim.
  2338. Result:
  2339. The trimmed string.
  2340. Donator:
  2341. Leonard Wennekers
  2342. --------------------------------------------------------------------------------
  2343. @@StrTrimCharsRight
  2344. <GROUP StringManipulation.StringTransformationRoutines>
  2345. Summary:
  2346. Removes characters from the right side of supplied string.
  2347. Description:
  2348. StrTrimCharsLeft removes all characters defined in the "Chars" set from
  2349. the right side of the string.
  2350. Parameters:
  2351. S - The string to trim.
  2352. Result:
  2353. The trimmed string.
  2354. Donator:
  2355. Leonard Wennekers
  2356. --------------------------------------------------------------------------------
  2357. @@AnsiSameText
  2358. <GROUP StringManipulation.Miscellaneous>
  2359. Summary:
  2360. AnsiSameText compares two strings.
  2361. Description:
  2362. AnsiSameText compares the two supplied ANSI strings and returns whether or not they are
  2363. identical. AnsiSameText is case insensitive and uses the users local settings for
  2364. comparisation. For more information please refer to the Windows API CompareString function.
  2365. Parameters:
  2366. S1 - First string to compare.
  2367. S2 - Second string to compare.
  2368. Result:
  2369. AnsiSameText returns 0 (CSTR_EQUAL) if the two strings match.
  2370. Donator:
  2371. Team JCL
  2372. --------------------------------------------------------------------------------
  2373. @@StrCharsCount
  2374. <GROUP StringManipulation.StringTransformationRoutines>
  2375. Summary:
  2376. Counts the occurrences of characters in a string.
  2377. Description:
  2378. StrCharsCount returns the number of occurrences of the specified characters in the
  2379. supplied string.
  2380. Parameters:
  2381. S - Source string.
  2382. Chars - The characters which occurrences to count.
  2383. Result:
  2384. The number of occurrences of Chars in S.
  2385. Donator:
  2386. Anonymous
  2387. --------------------------------------------------------------------------------
  2388. @@StrKeepChars
  2389. <GROUP StringManipulation.StringSearchandReplaceRoutines>
  2390. Summary:
  2391. Keeps all occurences of specified characters within a string and removes the
  2392. others.
  2393. Description:
  2394. StrKeepChars keeps all occurences of the characters specified in the Chars set
  2395. and removes any other characters from the string.
  2396. For example, if you pass in 'Joint Endeavour of Delphi Innovators' and specify
  2397. ['e', 'a', 'o', 'u', 'i', ' '] the resulting string will be 'oi eaou o ei oao'.
  2398. Parameters:
  2399. S - The source string from which to remove the characters.
  2400. Chars - The set of characters to keep within S.
  2401. Result:
  2402. A string containing only characters which are within Chars.
  2403. Donator:
  2404. Anonymous
  2405. --------------------------------------------------------------------------------
  2406. @@StrReplace
  2407. <GROUP StringManipulation.StringSearchandReplaceRoutines>
  2408. Summary:
  2409. StrReplace replaces one or all occurrences of the specified search pattern with
  2410. the supplied replace string.
  2411. Description:
  2412. StrReplace replaces one or all occurrences of the specified search pattern with
  2413. the supplied replace string. The flags determine how the search is done and if
  2414. only one or if all occurrences should be replaced.
  2415. TReplaceFlags = [rfIgnoreCase, rfReplaceAll]
  2416. If rfIgnoreCase is is within the flags the search is performed case insenitive, otherwise
  2417. it is case sensitive. If rfReplaceAll is specified StrReplace replaces all occurrences otherwise
  2418. only the first one.
  2419. Parameters:
  2420. S - The source string.
  2421. Search - The substring to replace.
  2422. Replace - The string to use as a replacement of Search.
  2423. Donator:
  2424. Robert Lee
  2425. Contributor:
  2426. Robert Rossmair
  2427. --------------------------------------------------------------------------------
  2428. @@StrReplaceChar
  2429. <GROUP StringManipulation.StringSearchandReplaceRoutines>
  2430. Summary:
  2431. Replaces all occurrences of a character with another character
  2432. Description:
  2433. StrReplaceChar replaces all occurrences of the specified search character with the supplied
  2434. replace character. Note that the replacement is case-sensitive.
  2435. Parameters:
  2436. S - The source string.
  2437. Search - The character to replace.
  2438. Replace - The character to use as a replacement of Search.
  2439. Result:
  2440. The string with all replacements performed.
  2441. Donator:
  2442. Anonymous
  2443. --------------------------------------------------------------------------------
  2444. @@StrReplaceChars
  2445. <GROUP StringManipulation.StringSearchandReplaceRoutines>
  2446. Summary:
  2447. Replaces all occurrences of one or more characters with another character.
  2448. Description:
  2449. StrReplaceChars replaces all occurrences of the specified search character(s) with the
  2450. supplied replace character. Note that the replacement is case-sensitive.
  2451. Parameters:
  2452. S - The string in which to replace characters.
  2453. Chars - The character(s) to replace.
  2454. Replace - The character to use as a replacement of the characters definied in Chars.
  2455. Result:
  2456. The string with all replacements performed.
  2457. Donator:
  2458. Anonymous
  2459. --------------------------------------------------------------------------------
  2460. @@StrReplaceButChars
  2461. <GROUP StringManipulation.StringSearchandReplaceRoutines>
  2462. Summary:
  2463. Replaces all occurrences of one or more characters with another character.
  2464. Description:
  2465. StrReplaceButChars replaces all occurrences of characters which are not within the specified
  2466. search character(s) with the supplied replace character. Note that the replacement is case-sensitive.
  2467. Parameters:
  2468. S - The string in which to replace characters.
  2469. Chars - The characters which should not be replaced.
  2470. Replace - The character to use as replacement.
  2471. Result:
  2472. The string with all replacements performed.
  2473. Donator:
  2474. Anonymous
  2475. --------------------------------------------------------------------------------
  2476. @@StrMatches
  2477. <GROUP StringManipulation.StringTestRoutines>
  2478. Summary:
  2479. Compares two strings.
  2480. Description:
  2481. StrMatches compares two given strings. The search starts at the supplied index and is case-sensitive.
  2482. The specified sub-string may contain wildcards. The '?' wildcard matches 1 character
  2483. while the '*' wildcard matches 0 or more occurrences of a character. For example, 'J?DI'
  2484. will find 'JEDI', 'JZDI' and 'JODI' (and more) while 'J*I' will find 'JEDI' and 'JI'.
  2485. Parameters:
  2486. Substr - The sub-string to search for. May contain wildcards.
  2487. Str - The string in which to search.
  2488. Index - The index in Str at which to start the search.
  2489. Result:
  2490. True if Str and Substr are equal.
  2491. See also:
  2492. StrSearch
  2493. Donator:
  2494. Michael Winter
  2495. --------------------------------------------------------------------------------
  2496. @@StrNormIndex
  2497. <GROUP StringManipulation.Miscellaneous>
  2498. Summary:
  2499. Normalizes Index and count parameter.
  2500. Description:
  2501. StrNormIndex is a auxiliary function for normalizations of Index
  2502. and Count parameters transfered in string functions.
  2503. Index and Count parameters are normalized as in standard Delphi
  2504. function System.Delete.
  2505. Str Index Count => Index Count
  2506. '12345' 2 3 2 3
  2507. '12345' 2 <0 2 0
  2508. '12345' 2 >4 2 4
  2509. '12345' <1 3 1 3
  2510. '12345' <1 <0 1 0
  2511. '12345' <1 >5 1 5
  2512. '12345' >5 Any 6 0
  2513. Donator:
  2514. Alexander Radchenko
  2515. --------------------------------------------------------------------------------
  2516. @@StrStrCount
  2517. <GROUP StringManipulation.StringSearchandReplaceRoutines>
  2518. Summary:
  2519. Counts the occurrences of a substring in a string.
  2520. Description:
  2521. StrStrCount returns the number of occurrences of the specified substring in the
  2522. supplied string.
  2523. Parameters:
  2524. S - Source string.
  2525. SubS - The character whose occurrences to count.
  2526. Result:
  2527. The number of occurrences of SubS in S.
  2528. Donator:
  2529. Anonymous
  2530. --------------------------------------------------------------------------------
  2531. @@AnsiNull
  2532. JclStrings defines several often used character definitions. They are symbolic
  2533. representations of their corresponding ANSI character. They can, for instance,
  2534. be used to achieve self explaining code.
  2535. <TABLE>
  2536. Symbol Description Char
  2537. --------------------- ---------------------------- ------
  2538. AnsiNull No character #0
  2539. AnsiSoh Start of header #1
  2540. AnsiStx Start of Text #2
  2541. AnsiEtx End of Text #3
  2542. AnsiEot End of Transmission #4
  2543. AnsiEnq Enquiry #5
  2544. AnsiAck Acknowledgment #6
  2545. AnsiBell Bell #7
  2546. AnsiBackspace Backspace #8
  2547. AnsiTab Horizontal Tab #9
  2548. AnsiLineFeed Line Feed #10
  2549. AnsiVerticalTab Vertical Tab #11
  2550. AnsiFormFeed Form Feed #12
  2551. AnsiCarriageReturn Carriage Return #13
  2552. AnsiCrLf Carriage Return and LineFeed #1310
  2553. AnsiSo Shift Out #14
  2554. AnsiSi Shift In #15
  2555. AnsiDle Data Link Escape #16
  2556. AnsiDc1 Device Control 1 #17
  2557. AnsiDc2 Device Control 2 #18
  2558. AnsiDc3 Device Control 3 #19
  2559. AnsiDc4 Device Control 4 #20
  2560. AnsiNak Negative Acknowledgement #21
  2561. AnsiSyn Synchronous Idle #22
  2562. AnsiEtb End of Transmission Block #23
  2563. AnsiCan Cancel #24
  2564. AnsiEm End of Medium #25
  2565. AnsiEndOfFile Substitute #26
  2566. AnsiEscape Escape #27
  2567. AnsiFs File Separator #28
  2568. AnsiGs Group Separator #29
  2569. AnsiRs Request to Send #30
  2570. AnsiUs Unit Separator #31
  2571. AnsiSpace Space #32
  2572. AnsiComma Comma #44
  2573. AnsiBackslash Backslash #92
  2574. AnsiForwardSlash Forward Slash #47
  2575. AnsiDoubleQuote Double Quote #34
  2576. AnsiSingleQuote Single Quote #39
  2577. </TABLE>
  2578. --------------------------------------------------------------------------------
  2579. @@AnsiSoh
  2580. <ALIAS AnsiNull>
  2581. @@AnsiStx
  2582. <ALIAS AnsiNull>
  2583. @@AnsiEtx
  2584. <ALIAS AnsiNull>
  2585. @@AnsiEot
  2586. <ALIAS AnsiNull>
  2587. @@AnsiEnq
  2588. <ALIAS AnsiNull>
  2589. @@AnsiAck
  2590. <ALIAS AnsiNull>
  2591. @@AnsiBell
  2592. <ALIAS AnsiNull>
  2593. @@AnsiBackspace
  2594. <ALIAS AnsiNull>
  2595. @@AnsiTab
  2596. <ALIAS AnsiNull>
  2597. @@AnsiLineFeed
  2598. <ALIAS AnsiNull>
  2599. @@AnsiVerticalTab
  2600. <ALIAS AnsiNull>
  2601. @@AnsiFormFeed
  2602. <ALIAS AnsiNull>
  2603. @@AnsiCarriageReturn
  2604. <ALIAS AnsiNull>
  2605. @@AnsiCrLf
  2606. <ALIAS AnsiNull>
  2607. @@AnsiSo
  2608. <ALIAS AnsiNull>
  2609. @@AnsiSi
  2610. <ALIAS AnsiNull>
  2611. @@AnsiDle
  2612. <ALIAS AnsiNull>
  2613. @@AnsiDc1
  2614. <ALIAS AnsiNull>
  2615. @@AnsiDc2
  2616. <ALIAS AnsiNull>
  2617. @@AnsiDc3
  2618. <ALIAS AnsiNull>
  2619. @@AnsiDc4
  2620. <ALIAS AnsiNull>
  2621. @@AnsiNak
  2622. <ALIAS AnsiNull>
  2623. @@AnsiSyn
  2624. <ALIAS AnsiNull>
  2625. @@AnsiEtb
  2626. <ALIAS AnsiNull>
  2627. @@AnsiCan
  2628. <ALIAS AnsiNull>
  2629. @@AnsiEm
  2630. <ALIAS AnsiNull>
  2631. @@AnsiEndOfFile
  2632. <ALIAS AnsiNull>
  2633. @@AnsiEscape
  2634. <ALIAS AnsiNull>
  2635. @@AnsiFs
  2636. <ALIAS AnsiNull>
  2637. @@AnsiGs
  2638. <ALIAS AnsiNull>
  2639. @@AnsiRs
  2640. <ALIAS AnsiNull>
  2641. @@AnsiUs
  2642. <ALIAS AnsiNull>
  2643. @@AnsiSpace
  2644. <ALIAS AnsiNull>
  2645. @@AnsiComma
  2646. <ALIAS AnsiNull>
  2647. @@AnsiBackslash
  2648. <ALIAS AnsiNull>
  2649. @@AnsiForwardSlash
  2650. <ALIAS AnsiNull>
  2651. @@AnsiDoubleQuote
  2652. <ALIAS AnsiNull>
  2653. @@AnsiSingleQuote
  2654. <ALIAS AnsiNull>
  2655. @@AnsiLineBreak
  2656. <ALIAS AnsiNull>
  2657. --------------------------------------------------------------------------------
  2658. @@StrToFloatSafe@string
  2659. Summary:
  2660. The function StrToFloatSafe attempts to convert the
  2661. string passed as a parameter to its float value.
  2662. Description:
  2663. The function StrToFloatSafe attempts to convert the
  2664. string passed as a parameter to its float value. It handles
  2665. correctly decimal and float separators as well as negative
  2666. sign. Function also handles national settings for thousand
  2667. separator (see ThousandSeparator variable).
  2668. Parameters:
  2669. S - String to be converted to float value.
  2670. Result:
  2671. Returns the float value of the string S passed as a parameter.
  2672. If error occurs, the function returns 0.00.
  2673. Donator:
  2674. Azret Botash
  2675. Contributor:
  2676. Robert Rossmair
  2677. --------------------------------------------------------------------------------
  2678. @@StrIToStrings@string@string@TStrings@Boolean
  2679. Summary:
  2680. Converts a string into a list of strings using the specified
  2681. separator character.
  2682. Description:
  2683. StrIToStrings converts the supplied string, which
  2684. supposedly is a list of strings packed into a single string
  2685. variable, to a TStrings. The function uses the supplied
  2686. separator string to separate the string into its individual
  2687. elements.
  2688. For example, if you call the function like this:
  2689. StrIToStrings('Project JEDI Rules', ' ', List) then on return
  2690. list will contain three items, namely 'Project', 'JEDI', and
  2691. 'Rules'. As this example shows, the last string doesn't have
  2692. to be terminated by the separator string although it is
  2693. allowed.
  2694. Notes:
  2695. The function differs from StrToString since it does not
  2696. perform any case conversion of the string passed as the
  2697. parameter.
  2698. The list will be cleared by this function before adding the
  2699. elements.
  2700. Parameters:
  2701. S - The string to split into elements.
  2702. Sep - The string that separates the individual elements.
  2703. List - A TStrings derivative that receives the individual elements.
  2704. AllowEmptyString - Specifies whether empty strings can be added to the list or not.
  2705. See also:
  2706. StrToStrings
  2707. Donator:
  2708. Anthony Steele
  2709. --------------------------------------------------------------------------------
  2710. @@StrToIntSafe@string
  2711. Summary:
  2712. The function StrToIntSafe attempts to convert the
  2713. string passed as a parameter to its integer value.
  2714. Description:
  2715. The function StrToIntSafe attempts to convert the
  2716. string passed as a parameter to its integer value. The
  2717. function handles correctly national settings ofr thousand
  2718. separator (see ThousandSeparator variable) as well as
  2719. negative sign.
  2720. Parameters:
  2721. S - String to be converted to integer value.
  2722. Result:
  2723. Integer value of the string S passed as a parameter.
  2724. If error occurs, the function returns 0.
  2725. Donator:
  2726. Azret Botash
  2727. --------------------------------------------------------------------------------
  2728. @@EJclStringError
  2729. Summary:
  2730. Class of exceptions that are risen by JclStrings unit's routines.
  2731. --------------------------------------------------------------------------------
  2732. @@PCharVector
  2733. Summary:
  2734. PCharVector type represents an array of pointers to PChars.
  2735. Description:
  2736. A PCharVector is an array of PChar's where each PChar points
  2737. to a null terminated string. The array is delimited by a nil
  2738. (NULL) pointer. In the Windows API this is usually typed as a
  2739. PPSTR.
  2740. See also:
  2741. StringsToPCharVector
  2742. PCharVectorCount
  2743. PCharVectorToStrings
  2744. FreePCharVector
  2745. Donator:
  2746. Marcel van Brakel
  2747. --------------------------------------------------------------------------------
  2748. @@AnsiDecDigits
  2749. Summary:
  2750. Specifies the enumeration type containing digits from 0 to 9.
  2751. Description:
  2752. The enumeration AnsiDecDigits contains all valid
  2753. digits for decimal number representation.
  2754. --------------------------------------------------------------------------------
  2755. @@AnsiHexDigits
  2756. Summary:
  2757. Specifies enumeration typcontaining all valid characters for
  2758. hexadecimal numbers representation.
  2759. Description:
  2760. The enumeration AnsiHexDigits contains all valid
  2761. digits from 0 to 9 and letters of latin alphabet from A to F
  2762. in both lower and upper cases for hexadecimal numbers
  2763. representation.
  2764. --------------------------------------------------------------------------------
  2765. @@AddStringToStrings@string@TStrings@Boolean
  2766. Summary:
  2767. Add a string to TStrings instance if conditions met.
  2768. Description:
  2769. Add a string to an object of TStrings. If a string already
  2770. exists in the list and there is a uniqueness requirement in
  2771. place, the string is not added.
  2772. Parameters:
  2773. S - String to be added.
  2774. Strings - TStrings object to which the string specified by S should be added.
  2775. Unique - Determines whether the the uniqueness check should be performed before adding the string.
  2776. Result:
  2777. The function returns True if the string was added, False otherwise.
  2778. Platforms:
  2779. Windows NT/2000/Vista: Requires Windows NT 3.1 or later.
  2780. Windows 95/98: Requires Windows 95 or later.
  2781. Donator:
  2782. Jean-Fabien Connault
  2783. --------------------------------------------------------------------------------
  2784. @@StrExpandTabs@string
  2785. <GROUP StringManipulation.Tabulation>
  2786. Summary:
  2787. Expands tabs to spaces in the provided string.
  2788. Description:
  2789. StrExpandTabs expands tab characters in the provided string into sequences of
  2790. spaces while preserving the formatting. StrExpandTabs will assume a tab width
  2791. of 2.
  2792. Multi-line strings, ie. strings containing one or more newline sequences (eg.
  2793. CrLf, but also single Cr of Lf characters are treated as newlines), are
  2794. handled properly.
  2795. The reverse operation (collapse sequences of spaces into tab characters) can
  2796. be achieved by the <LINK StrOptimizeTabs@string, StrOptimizeTabs> method.
  2797. Parameters:
  2798. S - The string to expand tabs in.
  2799. Result:
  2800. If S contains tabs, they will have been converted to 1 or more space characters,
  2801. depending on the column the tab character is in. Otherwise, the string is
  2802. unmodified.
  2803. Example:
  2804. <code>x := StrExpandTabs('Abc'#9'de'#9'fg');</code>
  2805. The above call will result in <i>x</i> containing the string (? represents a
  2806. space character): <code>Abc?????de??????fg</code>. In this case the first tab
  2807. character (ASCII code 9) was transformed into a single space and the second
  2808. tab character into two spaces.
  2809. See also:
  2810. TJclTabSet
  2811. StrExpandTabs@string@Integer
  2812. StrExpandTabs@string@TJclTabSet
  2813. Donator:
  2814. Marcel Bestebroer
  2815. --------------------------------------------------------------------------------
  2816. @@StrExpandTabs@string@Integer
  2817. <GROUP StringManipulation.Tabulation>
  2818. Summary:
  2819. Expands tabs to spaces in the provided string.
  2820. Description:
  2821. StrExpandTabs expands tab characters in the provided string into sequences of
  2822. spaces while preserving the formatting. StrExpandTabs will use the provided
  2823. tab width.
  2824. Multi-line strings, ie. strings containing one or more newline sequences (eg.
  2825. CrLf, but also single Cr of Lf characters are treated as newlines), are
  2826. handled properly.
  2827. The reverse operation (collapse sequences of spaces into tab characters) can
  2828. be achieved by the <LINK StrOptimizeTabs@string@Integer, StrOptimizeTabs>
  2829. method.
  2830. Parameters:
  2831. S - The string to expand tabs in.
  2832. TabWidth - The width of each tab.
  2833. Result:
  2834. If S contains tabs, they will have been converted to 1 or more space characters,
  2835. depending on the column the tab character is in. Otherwise, the string is
  2836. unmodified.
  2837. Example:
  2838. <code>x := StrExpandTabs('Abc'#9'de'#9'fg', 8);</code>
  2839. The above call will result in <i>x</i> containing the string (? represents a
  2840. space character): <code>Abc?????de??????fg</code>. In this case the first tab
  2841. character (ASCII code 9) was transformed into five spaces and the second tab
  2842. character into six spaces.
  2843. See also:
  2844. TJclTabSet
  2845. StrExpandTabs@string
  2846. StrExpandTabs@string@TJclTabSet
  2847. Donator:
  2848. Marcel Bestebroer
  2849. --------------------------------------------------------------------------------
  2850. @@StrExpandTabs@string@TJclTabSet
  2851. <GROUP StringManipulation.Tabulation>
  2852. Summary:
  2853. Expands tabs to spaces in the provided string.
  2854. Description:
  2855. StrExpandTabs expands tab characters in the provided string into sequences of
  2856. spaces while preserving the formatting. StrExpandTabs will use the provided
  2857. tab set.
  2858. Multi-line strings, ie. strings containing one or more newline sequences (eg.
  2859. CrLf, but also single Cr of Lf characters are treated as newlines), are
  2860. handled properly.
  2861. The reverse operation (collapse sequences of spaces into tab characters) can
  2862. be achieved by the <LINK StrOptimizeTabs@string@TJclTabSet, StrOptimizeTabs>
  2863. method.
  2864. Parameters:
  2865. S - The string to expand tabs in.
  2866. TabSet - The tab set to use.
  2867. Result:
  2868. If S contains tabs, they will have been converted to 1 or more space characters,
  2869. depending on the column the tab character is in. Otherwise, the string is
  2870. unmodified.
  2871. Example:
  2872. <code>
  2873. <i>// initiate a tab set with (zero-based) stops at 15, 20 and 30, and a tab width of 2 for
  2874. // tabs beyond the column 30</i>
  2875. tabs := TJclTabSet.Create([15, 20, 30], True, 2);
  2876. <b>try</b>
  2877. x := StrExpandTabs('MyLabel:'#9'LD'#9'A,(HL)'#9'; Initialize A register', tabs);
  2878. <b>finally</b>
  2879. tabs.Free;
  2880. <b>end</b>;
  2881. </code>
  2882. The above snippet will result in <i>x</i> containing the string (? represents a
  2883. space character): <code>MyLabel:???????LD???A,(HL)????;?Initialize?A?register</code>.
  2884. In this case the first tab character (ASCII code 9) was transformed into seven
  2885. spaces, the second tab character into three spaces and the third tab character
  2886. into four spaces.
  2887. See also:
  2888. TJclTabSet
  2889. StrExpandTabs@string
  2890. StrExpandTabs@string@Integer
  2891. Donator:
  2892. Marcel Bestebroer
  2893. --------------------------------------------------------------------------------
  2894. @@StrOptimizeTabs@string
  2895. <GROUP StringManipulation.Tabulation>
  2896. Summary:
  2897. Collapses a string to the optimal tab and space character sequences.
  2898. Description:
  2899. StrOptimizeTabs reduces tab and space character sequences in the provided
  2900. string into an optimized (shortest) sequences of tab and space characters
  2901. while preserving the formatting. A tab width of 2 is assumed.
  2902. Multi-line strings, ie. strings containing one or more newline sequences (eg.
  2903. CrLf, but also single Cr of Lf characters are treated as newlines), are
  2904. handled properly.
  2905. The reverse operation (expand sequences of tab characters into spaces) can
  2906. be achieved by the <LINK StrExpandTabs@string, StrExpandTabs> method.
  2907. Parameters:
  2908. S - The string to collapse tabs and spaces in.
  2909. Result:
  2910. Any tab and/or space character sequences in S will have been reduced to their
  2911. shortest form; no other item in the string is modified.
  2912. See also:
  2913. TJclTabSet
  2914. StrOptimizeTabs@string@Integer
  2915. StrOptimizeTabs@string@TJclTabSet
  2916. Donator:
  2917. Marcel Bestebroer
  2918. --------------------------------------------------------------------------------
  2919. @@StrOptimizeTabs@string@Integer
  2920. <GROUP StringManipulation.Tabulation>
  2921. Summary:
  2922. Collapses a string to the optimal tab and space character sequences.
  2923. Description:
  2924. StrOptimizeTabs reduces tab and space character sequences in the provided
  2925. string into an optimized (shortest) sequences of tab and space characters
  2926. while preserving the formatting. The provided tab width is used.
  2927. Multi-line strings, ie. strings containing one or more newline sequences (eg.
  2928. CrLf, but also single Cr of Lf characters are treated as newlines), are
  2929. handled properly.
  2930. The reverse operation (expand sequences of tab characters into spaces) can
  2931. be achieved by the <LINK StrExpandTabs@string@Integer, StrExpandTabs> method.
  2932. Parameters:
  2933. S - The string to collapse tabs and spaces in.
  2934. TabWidth - The tab width to use
  2935. Result:
  2936. Any tab and/or space character sequences in S will have been reduced to their
  2937. shortest form; no other item in the string is modified.
  2938. See also:
  2939. TJclTabSet
  2940. StrOptimizeTabs@string
  2941. StrOptimizeTabs@string@TJclTabSet
  2942. Donator:
  2943. Marcel Bestebroer
  2944. --------------------------------------------------------------------------------
  2945. @@StrOptimizeTabs@string@TJclTabSet
  2946. <GROUP StringManipulation.Tabulation>
  2947. Summary:
  2948. Collapses a string to the optimal tab and space character sequences.
  2949. Description:
  2950. StrOptimizeTabs reduces tab and space character sequences in the provided
  2951. string into an optimized (shortest) sequences of tab and space characters
  2952. while preserving the formatting. The provided tab width is used.
  2953. Multi-line strings, ie. strings containing one or more newline sequences (eg.
  2954. CrLf, but also single Cr of Lf characters are treated as newlines), are
  2955. handled properly.
  2956. The reverse operation (expand sequences of tab characters into spaces) can
  2957. be achieved by the <LINK StrExpandTabs@string@TJclTabSet, StrExpandTabs>
  2958. method.
  2959. Parameters:
  2960. S - The string to collapse tabs and spaces in.
  2961. TabSet - The tab set to use
  2962. Result:
  2963. Any tab and/or space character sequences in S will have been reduced to their
  2964. shortest form; no other item in the string is modified.
  2965. See also:
  2966. TJclTabSet
  2967. StrOptimizeTabs@string
  2968. StrOptimizeTabs@string@Integer
  2969. Donator:
  2970. Marcel Bestebroer
  2971. --------------------------------------------------------------------------------
  2972. @@TabSetFormattingOptions
  2973. <GROUP StringManipulation.Tabulation>
  2974. <TITLE TJclTabSet string formatting options>
  2975. <ALIASOF TabSetFormatting_SurroundStopsWithBrackets,TabSetFormatting_EmptyBracketsIfNoStops>
  2976. <ALIASOF TabSetFormatting_NoTabStops,TabSetFormatting_NoTabWidth,TabSetFormatting_AlwaysUseBrackets>
  2977. <ALIASOF TabSetFormatting_Default,TabSetFormatting_StopsWithoutBracketsAndTabWidth>
  2978. <ALIASOF TabSetFormatting_StopsOnly,TabSetFormatting_TabWidthOnly>
  2979. <ALIASOF TabSetFormatting_Full,TabSetFormatting_AutoTabWidth>
  2980. Summary:
  2981. Available formatting options for the
  2982. <LINK TJclTabSet.ToString@Integer, TJclTabSet.ToString> method.
  2983. Description
  2984. The <LINK TJclTabSet.ToString@Integer, TJclTabSet.ToString@Integer> method
  2985. allows for a number of formatting options to be specified. Options can be
  2986. or'd with each other to specify exact formatting. Below is the list of
  2987. available formatting options:
  2988. <TABLE>
  2989. Constant Meaning
  2990. -------- -------
  2991. TabSetFormatting_SurroundStopsWithBrackets The fixed tabulation positions are surrounded with brackets
  2992. TabSetFormatting_EmptyBracketsIfNoStops If no fixed tabulation positions are specified, but the
  2993. TabSetFormatting_SurroundStopsWithBrackets option is specified,
  2994. output the opening and closing brackets anyway.
  2995. TabSetFormatting_NoTabStops Do not output the fixed tabulation positions.
  2996. TabSetFormatting_NoTabWidth Do not output the additional tab width.
  2997. TabSetFormatting_AutoTabWidth Include tab width even if its determined by the tabulation
  2998. positions.
  2999. ?
  3000. TabSetFormatting_AlwaysUseBrackets Combines the TabSetFormatting_SurroundStopsWithBrackets and
  3001. TabSetFormatting_EmptyBracketsIfNoStops options.
  3002. TabSetFormatting_Default Specifies none of the formatting options.
  3003. TabSetFormatting_Full Combines the TabSetFormatting_SurroundStopsWithBrackets,
  3004. TabSetFormatting_EmptyBracketsIfNoStops and
  3005. TabSetFormatting_AutoTabWidth options.
  3006. ?
  3007. TabSetFormatting_StopsWithoutBracketsAndTabWidth An alias for the TabSetFormatting_Default option.
  3008. TabSetFormatting_StopsOnly An alias for the TabSetFormatting_NoTabWidth option.
  3009. TabSetFormatting_TabWidthOnly An alias for the TabSetFormatting_NoTabStops option.
  3010. </TABLE>
  3011. --------------------------------------------------------------------------------
  3012. @@TJclTabSet
  3013. <GROUP StringManipulation.Tabulation>
  3014. Summary:
  3015. Represents a tab set that can be used to expand tabs to spaces, or vice versa.
  3016. Description:
  3017. The TJclTabSet class represents tabulation information. Each instance can
  3018. specify:
  3019. * Whether the column positions are <LINK TJclTabSet.ZeroBased, zero-based>
  3020. * Individual <LINK TJclTabSet.TabStops, tabulation positions>
  3021. * <LINK TJclTabSet.TabWidth, Tabulation width> for columns beyond those
  3022. specified by the individual tabulation positions.
  3023. The class then provides functionality to:
  3024. * Determine the <LINK TJclTabSet.TabFrom, next tabulation position> from a
  3025. given starting column
  3026. * Determine the
  3027. <LINK TJclTabSet.OptimalFillInfo, optimal tab and space characters needed>
  3028. to get from one column to another
  3029. * <LINK TJclTabSet.Expand@string, Expand> tab characters into a sequence of
  3030. spaces, optionally
  3031. <LINK TJclTabSet.Expand@string@Integer, starting at an arbitrary column>
  3032. * <LINK TJclTabSet.Optimize@string, Collapse> a sequence of space and tab
  3033. characters into an optimized sequence of tab and space characters,
  3034. optionally
  3035. <LINK TJclTabSet.Optimize@string@Integer, starting at an arbitrary column>
  3036. The class contains logic to allow automatic tab width determination by setting
  3037. the <LINK TJclTabSet.TabWidth, tabulation width> to zero or a negative value;
  3038. in this case the tab width is determined by the provided
  3039. <LINK TJclTabSet.TabStops, tabulation positions> in the following manner:
  3040. <TABLE>
  3041. Situation ActualTabWidth
  3042. ---------- --------------------------
  3043. No tabulation positions defined 2
  3044. One tabulation position defined the defined tabulation position
  3045. Two or more tabulation positions defined the distance between the last
  3046. two tabulation positions
  3047. </TABLE>
  3048. * nil - safety *
  3049. The public methods and properties that do not modify the tab set are
  3050. <i><b>nil</b>-safe</i>, meaning they will work when used on a <b>nil</b>
  3051. reference. A <b>nil</b> tab set will behave as if explicitly set to:
  3052. * assume <LINK TJclTabSet.ZeroBased, zero-based> column positions
  3053. * no defined <LINK TJclTabSet.TabStops, tabulation positions>
  3054. * a <LINK TJclTabSet.TabWidth, tabulation width> of 2
  3055. Note that reading any of the public properties on a <b>nil</b> instance will
  3056. work properly.
  3057. Example:
  3058. <code>
  3059. <i>// initiate a tab set with (zero-based) stops at 15, 20 and 30, and a tab width of 2 for
  3060. // tabs beyond the column 30</i>
  3061. tabs := TJclTabSet.Create([15, 20, 30], True, 2);
  3062. <b>try</b>
  3063. x := tabs.Expand('MyLabel:'#9'LD'#9'A,(HL)'#9'; Initialize A register');
  3064. <b>finally</b>
  3065. tabs.Free;
  3066. <b>end;</b>
  3067. </code>
  3068. The above snippet will result in <i>x</i> containing the string (? represents a
  3069. space character): <code>MyLabel:???????LD???A,(HL)????;?Initialize?A?register</code>.
  3070. In this case the first tab character (ASCII code 9) was transformed into seven
  3071. spaces, the second tab character into three spaces and the third tab character
  3072. into four spaces.
  3073. Donator:
  3074. Marcel Bestebroer
  3075. --------------------------------------------------------------------------------
  3076. @@TJclTabSet.ActualTabWidth
  3077. Summary:
  3078. Indicates the actual tabulation width being used.
  3079. Description:
  3080. ActualTabWidth indicates the actual tabulation width being used for columns
  3081. beyond those specified by the <LINK TJclTabSet.TabStops, TabStops> property.
  3082. If the <LINK TJclTabSet.TabWidth, TabWidth> property is set to a positive,
  3083. non-zero value, ActualTabWidth will hold the same value as TabWidth; otherwise
  3084. it will hold a value calculated according to the following table:
  3085. <TABLE>
  3086. Situation ActualWidthActualTabWidth
  3087. ---------- --------------------------
  3088. No tabulation positions defined 2
  3089. One tabulation position defined the defined tabulation position
  3090. Two or more tabulation positions defined the distance between the last
  3091. two tabulation positions
  3092. </TABLE>
  3093. Notes:
  3094. This property is <i><b>nil</b>-safe</i>; when read from on a
  3095. <b>nil</b>-reference, this property will return 2.
  3096. See also:
  3097. TJclTabSet.Count
  3098. TJclTabSet.TabStops
  3099. TJclTabSet.TabWidth
  3100. Donator:
  3101. Marcel Bestebroer
  3102. --------------------------------------------------------------------------------
  3103. @@TJclTabSet.Add@SizeInt
  3104. Summary:
  3105. Adds a fixed tabulation position.
  3106. Description:
  3107. Add will add a fixed tabulation position to the tab set. The provided
  3108. tabulation position is inserted at the correct index in the TabStops array.
  3109. Duplicate tabulation positions are not allowed and will result in an
  3110. EJclStringError.
  3111. Parameters:
  3112. Column - The column to add to the tab set.
  3113. Result:
  3114. The index at which the tabulation position was inserted into the TabStops
  3115. array
  3116. Exceptions:
  3117. <TABLE>
  3118. NullReferenceException Add was called on a <b>nil</b>-reference.
  3119. EJclStringError The specified Column already existed in the TabStops
  3120. array.
  3121. </TABLE>
  3122. See also:
  3123. TJclTabSet
  3124. TJclTabSet.Delete
  3125. TJclTabSet.TabStops
  3126. Donator:
  3127. Marcel Bestebroer
  3128. --------------------------------------------------------------------------------
  3129. @@TJclTabSet.Clone
  3130. Summary:
  3131. Initializes a new tab set instance equal to the current instance.
  3132. Description:
  3133. The Clone method initializes a new instance of the TJclTabSet class and
  3134. copies the contents of the current instance to the new one.
  3135. Result:
  3136. <b>nil</b> if Clone is called on a <b>nil</b> instance<p>
  3137. <i>- or -</i><p>
  3138. A new TJclTabSet instance identical to the instance Close was called on
  3139. Notes:
  3140. This method is <i><b>nil</b>-safe</i>; when invoked on a
  3141. <b>nil</b>-reference, this method will return <b>nil</b>.
  3142. See Also
  3143. NewReference
  3144. Donator:
  3145. Marcel Bestebroer
  3146. --------------------------------------------------------------------------------
  3147. @@TJclTabSet.Count
  3148. Summary:
  3149. Indicates the number of tabulation positions specified.
  3150. Description:
  3151. Count indicates the number of <LINK TJclTabSet.TabStops, tabulation positions>
  3152. that are defined on this instance.
  3153. Notes:
  3154. This property is <i><b>nil</b>-safe</i>. When read from on a
  3155. <b>nil</b>-reference, this property will return 0.
  3156. See also:
  3157. TJclTabSet.TabStops
  3158. Donator:
  3159. Marcel Bestebroer
  3160. --------------------------------------------------------------------------------
  3161. @@TJclTabSet.Create
  3162. Summary:
  3163. Initializes a new, empty tab set instance.
  3164. Description:
  3165. The constructor initializes a new instance of the TJclTabSet class. The
  3166. parameterless overload simply initializes it to a zero-based tab set, with
  3167. automatic tab width calculation.
  3168. Donator:
  3169. Marcel Bestebroer
  3170. --------------------------------------------------------------------------------
  3171. @@TJclTabSet.Create@SizeInt
  3172. Summary:
  3173. Initializes a new tab set instance with the specified tab width.
  3174. Description:
  3175. The constructor initializes a new instance of the TJclTabSet class, setting the
  3176. TabWidth property to the specified tab width.
  3177. Parameters:
  3178. \TabWidth - The value to initialize the TabWidth property to.
  3179. Donator:
  3180. Marcel Bestebroer
  3181. --------------------------------------------------------------------------------
  3182. @@TJclTabSet.Create@array of SizeInt@Boolean
  3183. Summary:
  3184. Initializes a new tab set instance with the specified fixed tabulation
  3185. positions and automatic tab width calculation.
  3186. Description:
  3187. The constructor initializes a new instance of the TJclTabSet class, adding the
  3188. specified tab stops to the TabStops array.
  3189. Parameters:
  3190. \Tabstops - The fixed tabulation position(s) to initialize the tab set to.
  3191. \ZeroBased - The value to initialize the ZeroBased property to.
  3192. Donator:
  3193. Marcel Bestebroer
  3194. --------------------------------------------------------------------------------
  3195. @@TJclTabSet.Create@array of SizeInt@Boolean@SizeInt
  3196. Summary:
  3197. Initializes a new tab set instance with the specified fixed tabulation
  3198. positions and tab width.
  3199. Description:
  3200. The constructor initializes a new instance of the TJclTabSet class, adding the
  3201. specified tab stops to the TabStops array and setting the TabWidth property to
  3202. the specified tab width.
  3203. Parameters:
  3204. \Tabstops - The fixed tabulation position(s) to initialize the tab set to.
  3205. \ZeroBased - The value to initialize the ZeroBased property to.
  3206. \TabWidth - The value to initialize the TabWidth property to.
  3207. Donator:
  3208. Marcel Bestebroer
  3209. --------------------------------------------------------------------------------
  3210. @@TJclTabSet.Delete@SizeInt
  3211. Summary:
  3212. Removes a fixed tabulation position.
  3213. Description:
  3214. Delete will remove the specified column from the list of fixed tabulation
  3215. positions.
  3216. Parameters:
  3217. Column - The column to remove from the tab set.
  3218. Result:
  3219. The index from which the tabulation position was removed from the TabStops
  3220. array<p>
  3221. ?<i>- or -</i><p>
  3222. A negative value if the tabulation position was not found
  3223. Exceptions:
  3224. <TABLE>
  3225. NullReferenceException Delete was called on a <b>nil</b>-reference.
  3226. </TABLE>
  3227. See also:
  3228. TJclTabSet
  3229. TJclTabSet.Add
  3230. TJclTabSet.TabStops
  3231. Donator:
  3232. Marcel Bestebroer
  3233. --------------------------------------------------------------------------------
  3234. @@TJclTabSet.Expand@string
  3235. Summary:
  3236. Expands tabs to spaces in the provided string.
  3237. Description:
  3238. Expand expands tab characters in the provided string into sequences of
  3239. spaces while preserving the formatting. Expand will assume the string starts
  3240. at column 0 (<LINK TJclTabSet.ZeroBased, zero-based> set to <code>True</code>) or 1
  3241. (<LINK TJclTabSet.ZeroBased, zero-based> set to <code>False</code>).
  3242. Multi-line strings, ie. strings containing one or more newline sequences (eg.
  3243. CrLf, but also single Cr of Lf characters are treated as newlines), are
  3244. handled properly, with each line starting at column 0
  3245. (<LINK TJclTabSet.ZeroBased, zero-based> set to <code>True</code>) or 1
  3246. (<LINK TJclTabSet.ZeroBased, zero-based> set to <code>False</code>).
  3247. The reverse operation (collapse sequences of spaces into tab characters) can
  3248. be achieved by the <LINK TJclTabSet.Optimize@string, Optimize> method.
  3249. Parameters:
  3250. S - The string to expand tabs in.
  3251. Result:
  3252. If S contains tabs, they will have been converted to 1 or more space characters,
  3253. depending on the column the tab character is in. Otherwise, the string is
  3254. unmodified.
  3255. Notes:
  3256. This method is <i><b>nil</b>-safe</i>; when invoked on a
  3257. <b>nil</b>-reference, this method will assume a tab width of two on a
  3258. zero-based tab set.
  3259. Example:
  3260. See the <LINK TJclTabSet, TJclTabSet> help for an example.
  3261. See also:
  3262. TJclTabSet
  3263. TJclTabSet.Expand@string@SizeInt
  3264. Donator:
  3265. Marcel Bestebroer
  3266. --------------------------------------------------------------------------------
  3267. @@TJclTabSet.Expand@string@SizeInt
  3268. Summary:
  3269. Expands tabs to spaces in the provided string.
  3270. Description:
  3271. Expand expands tab characters in the provided string into sequences of
  3272. spaces while preserving the formatting. Expand will assume the string starts
  3273. at the provided column.
  3274. Multi-line strings, ie. strings containing one or more newline sequences (eg.
  3275. CrLf, but also single Cr of Lf characters are treated as newlines), are
  3276. handled properly, with all but the first line starting at column 0
  3277. (<LINK TJclTabSet.ZeroBased, zero-based> set to <code>True</code>) or 1
  3278. (<LINK TJclTabSet.ZeroBased, zero-based> set to <code>False</code>).
  3279. The reverse operation (collapse sequences of spaces into tab characters) can
  3280. be achieved by the <LINK TJclTabSet.Optimize@string@SizeInt, Optimize> method.
  3281. Parameters:
  3282. S - The string to expand tabs in.
  3283. Column - The starting column to use when expanding the tabs.
  3284. Result:
  3285. If S contains tab character, they will have been converted to 1 or more space
  3286. characters, depending on the column the tab character is in. Otherwise, the
  3287. string is unmodified.
  3288. Notes:
  3289. This method is <i><b>nil</b>-safe</i>; when invoked on a
  3290. <b>nil</b>-reference, this method will assume a tab width of two on a
  3291. zero-based tab set.
  3292. Example:
  3293. See the <LINK TJclTabSet, TJclTabSet> help for an example.
  3294. See also:
  3295. TJclTabSet
  3296. TJclTabSet.Expand@string
  3297. TJclTabSet.TabFrom
  3298. Donator:
  3299. Marcel Bestebroer
  3300. --------------------------------------------------------------------------------
  3301. @@TJclTabSet.FindStop
  3302. Summary:
  3303. Locates a tabulation position in the TabStops array.
  3304. Description:
  3305. FindStop returns the index in the TabStops array of the specified column. If
  3306. the specified column does not exist the 2-complement of the index at which
  3307. it should've been found will be returned, resulting in a negative value. You
  3308. could use the <b>not</b>-operator to determine the actual index.
  3309. Parameters:
  3310. Column - The tabulation column to locate.
  3311. Returns:
  3312. The index of the column specified by the <i>Column</i> parameter in the
  3313. TabStops array<p>
  3314. ?<i>- or -</i><p>
  3315. <b>A negative value</b> if the specified column could not be found. Use the
  3316. <b>not</b>-operator to retrieve the index at which it should've been found.
  3317. Exceptions:
  3318. <TABLE>
  3319. ArgumentOutOfRangeException The <i>Column</i> parameter is less than
  3320. 0 (<LINK TJclTabSet.ZeroBased, zero-based>)
  3321. or 1 (not zero-based).
  3322. </TABLE>
  3323. Donator:
  3324. Marcel Bestebroer
  3325. --------------------------------------------------------------------------------
  3326. @@TJclTabSet.FromString
  3327. Summary
  3328. Converts a string into a tab set.
  3329. Description
  3330. The FromString class method returns a tab set setup according to the provided
  3331. string represention.
  3332. The string should be formatted according to the same rules as outlined in the
  3333. <LINK TJclTabSet.ToString, ToString> method documentation:
  3334. <TABLE>
  3335. '0' Optional: flag to set the tab set to
  3336. zero-based mode.
  3337. '[' Optional: opening bracket for the fixed
  3338. tabulation positions. When present, the
  3339. closing bracket must be present or an
  3340. exception will be raised.
  3341. comma-separated list of Optional: The individual fixed tabulation
  3342. tabulation positions positions of this tab set. <b>Note:</b>
  3343. if the zero-based flag is present but no
  3344. opening bracket, an exception will be
  3345. raised.
  3346. ']' Closing bracket for the fixed tabulation
  3347. positions. Required if an opening bracket
  3348. is present earlier.
  3349. '+' Optional: indicates the following number as
  3350. the tab width property.
  3351. tab width Optional: the tab width property. Required if
  3352. the plus character is present.
  3353. </TABLE>
  3354. Parameters
  3355. S - A string describing the tab set. It should be formatted according to the
  3356. rules outlined in the <LINK TJclTabSet.ToString, ToString>
  3357. documentation.
  3358. Returns:
  3359. A TJclTabSet representated by the string parameter.
  3360. --------------------------------------------------------------------------------
  3361. @@TJclTabSet.InternalTabStops
  3362. Summary:
  3363. Provides <b>nil</b>-safe access to the tab stops array.
  3364. Description:
  3365. InternalTabStops provides <b>nil</b>-safe access to the actual tab stops
  3366. array.
  3367. Returns:
  3368. A TDynSizeIntArray holding each individual tab position<p>
  3369. ?<i>- or -</i><p>
  3370. <b>nil</b> if the method is called on a <b>nil</b>-reference
  3371. Donator:
  3372. Marcel Bestebroer
  3373. --------------------------------------------------------------------------------
  3374. @@TJclTabSet.InternalTabWidth
  3375. Summary:
  3376. Provides <b>nil</b>-safe access to the specified tab width.
  3377. Description:
  3378. InternalTabWidth provides <b>nil</b>-safe access to the specified tab width
  3379. (not to be confused with the actual tab width).
  3380. Returns:
  3381. The value of the TabWidth property<p>
  3382. ?<i>- or -</i><p>
  3383. <b>2</b> if the method is called on a <b>nil</b>-reference
  3384. Donator:
  3385. Marcel Bestebroer
  3386. --------------------------------------------------------------------------------
  3387. @@TJclTabSet.NewReference
  3388. Summary:
  3389. Initializes a new tab set instance referencing the current instance.
  3390. Description:
  3391. The NewReference method initializes a new instance of the TJclTabSet class and
  3392. sets a reference in the new instance to the current instance.
  3393. NewReference allows several tabset instances to hold the same tab set
  3394. settings, regardless of which instance changes them. Only when the last
  3395. tab set instance is destroyed, will the actual tab set data be disposed of.
  3396. Contrast this to Clone, which will simply copy the data from the original
  3397. instance to the new one. Whenever you change the settings in one instance,
  3398. the other will remain unaffected.
  3399. Result:
  3400. <b>nil</b> if NewReference is called on a <b>nil</b> instance<p>
  3401. <i>- or -</i><p>
  3402. A new TJclTabSet instance identical to the instance Close was called on
  3403. Notes:
  3404. This method is <i><b>nil</b>-safe</i>; when invoked on a
  3405. <b>nil</b>-reference, this method will return <b>nil</b>.
  3406. See Also
  3407. Clone
  3408. Donator:
  3409. Marcel Bestebroer
  3410. --------------------------------------------------------------------------------
  3411. @@TJclTabSet.OptimalFillInfo
  3412. Summary:
  3413. Determines the optimal number of tab and space characters needed to fill the
  3414. room between two columns.
  3415. Description:
  3416. OptimalFillInfo will determine the ideal amount of tab characters and/or
  3417. space characters required to get from the first provided column to the second.
  3418. Parameters:
  3419. \StartColumn - The starting column to use.
  3420. TargetColumn - The required column to end at.
  3421. TabsNeeded - Will hold the amount of tab characters needed to get to the
  3422. destination column.
  3423. SpacesNeeded - Will hold the amount of space characters needed to get to the
  3424. destination column.
  3425. Exceptions:
  3426. <TABLE>
  3427. ArgumentOutOfRangeException The <i>\StartColumn</i> parameter is less than
  3428. 0 (<LINK TJclTabSet.ZeroBased, zero-based>)
  3429. or 1 (not zero-based).<p>
  3430. <i>?- or -</i><p>
  3431. The <i>TargetColumn</i> parameter is less
  3432. than the <i>\StartColumn</i> parameter.
  3433. </TABLE>
  3434. Example:
  3435. <b>Note:</b>This example assumes a tab set instance set up as in the example
  3436. given in the <LINK TJclTabSet, TJclTabSet> help.
  3437. <CODE>
  3438. tabs.OptimalFillInfo(5, 21, TabsNeeded, SpacesNeeded);
  3439. <i>// TabsNeeded will be 2 (taking us only to column 20), SpacesNeeded will be 1.</i>
  3440. </CODE>
  3441. See also:
  3442. TJclTabSet
  3443. TJclTabSet.Optimize@string
  3444. Donator:
  3445. Marcel Bestebroer
  3446. --------------------------------------------------------------------------------
  3447. @@TJclTabSet.Optimize@string
  3448. Summary:
  3449. Collapses a string to the optimal tab and space character sequences.
  3450. Description:
  3451. Optimize reduces tab and space character sequences in the provided string into
  3452. an optimized (shortest) sequences of tab and space characters while preserving
  3453. the formatting. Optimize will assume the string starts at column 0
  3454. (<LINK TJclTabSet.ZeroBased, zero-based> set to <code>True</code>) or 1
  3455. (<LINK TJclTabSet.ZeroBased, zero-based> set to <code>False</code>).
  3456. Multi-line strings, ie. strings containing one or more newline sequences (eg.
  3457. CrLf, but also single Cr of Lf characters are treated as newlines), are
  3458. handled properly, with each line starting at column 0
  3459. (<LINK TJclTabSet.ZeroBased, zero-based> set to <code>True</code>) or 1
  3460. (<LINK TJclTabSet.ZeroBased, zero-based> set to <code>False</code>).
  3461. The reverse operation (expand sequences of tab characters into spaces) can
  3462. be achieved by the <LINK TJclTabSet.Expand@string, Expand> method.
  3463. Parameters:
  3464. S - The string to collapse tabs and spaces in.
  3465. Result:
  3466. Any tab and/or space character sequences in S will have been reduced to their
  3467. shortest form; no other item in the string is modified.
  3468. Notes:
  3469. This method is <i><b>nil</b>-safe</i>; when invoked on a
  3470. <b>nil</b>-reference, this method will assume a tab width of two on a
  3471. zero-based tab set.
  3472. See also:
  3473. TJclTabSet
  3474. TJclTabSet.OptimalFillInfo
  3475. TJclTabSet.Optimize@string@SizeInt
  3476. Donator:
  3477. Marcel Bestebroer
  3478. --------------------------------------------------------------------------------
  3479. @@TJclTabSet.Optimize@string@SizeInt
  3480. Summary:
  3481. Expands tabs to spaces in the provided string.
  3482. Description:
  3483. Optimize reduces tab and space character sequences in the provided string into
  3484. an optimized (shortest) sequences of tab and space characters while preserving
  3485. the formatting. Optimize will assume the string starts at the provided column.
  3486. Multi-line strings, ie. strings containing one or more newline sequences (eg.
  3487. CrLf, but also single Cr of Lf characters are treated as newlines), are
  3488. handled properly, with all but the first line starting at column 0
  3489. (<LINK TJclTabSet.ZeroBased, zero-based> set to <code>True</code>) or 1
  3490. (<LINK TJclTabSet.ZeroBased, zero-based> set to <code>False</code>).
  3491. The reverse operation (expand sequences of tab characters into spaces) can
  3492. be achieved by the <LINK TJclTabSet.Expand@string@SizeInt, Expand> method.
  3493. Parameters:
  3494. S - The string to expand tabs in.
  3495. Column - The starting column to use when expanding the tabs.
  3496. Result:
  3497. Any tab and/or space character sequences in S will have been reduced to their
  3498. shortest form; no other item in the string is modified.
  3499. Notes:
  3500. This method is <i><b>nil</b>-safe</i>; when invoked on a
  3501. <b>nil</b>-reference, this method will assume a tab width of two on a
  3502. zero-based tab set.
  3503. See also:
  3504. TJclTabSet
  3505. TJclTabSet.OptimalFillInfo
  3506. TJclTabSet.Optimize@string
  3507. Donator:
  3508. Marcel Bestebroer
  3509. --------------------------------------------------------------------------------
  3510. @@TJclTabSet.StartColumn
  3511. Summary:
  3512. Indicates the starting column used when none is specified.
  3513. Description:
  3514. StartColumn indicates which column is used as the start of a line.
  3515. Returns:
  3516. <b>0</b> if ZeroBased is set to <code>True</code> or if this method is called on a
  3517. <b>nil</b>-reference
  3518. ?<i>- or -</i><p>
  3519. <b>1</b> if ZeroBased is set to <code>False</code>
  3520. Donator:
  3521. Marcel Bestebroer
  3522. --------------------------------------------------------------------------------
  3523. @@TJclTabSet.TabFrom
  3524. Summary:
  3525. Determines the next column when tabbing from the specified column.
  3526. Description:
  3527. TabFrom will determine the next column if a tab character would occur at the
  3528. specified column.
  3529. Parameters:
  3530. Column - The starting column to use when determine the next column.
  3531. Result:
  3532. An Integer representing the next tabulation position.
  3533. Exceptions:
  3534. <TABLE>
  3535. ArgumentOutOfRangeException The <i>Column</i> parameter is less than
  3536. 0 (<LINK TJclTabSet.ZeroBased, zero-based>)
  3537. or 1 (not zero-based).
  3538. </TABLE>
  3539. Example:
  3540. <b>Note:</b>This example assumes a tab set instance set up as in the example
  3541. given in the <LINK TJclTabSet, TJclTabSet> help.
  3542. <CODE>
  3543. a := tabs.TabFrom(0); <i>// a will be 15</i>
  3544. b := tabs.TabFrom(24); <i>// b will be 30</i>
  3545. c := tabs.TabFrom(34); <i>// c will be 36</i>
  3546. d := tabs.TabFrom(35); <i>// d will be 36</i>
  3547. </CODE>
  3548. See also:
  3549. TJclTabSet
  3550. TJclTabSet.Expand@string
  3551. Donator:
  3552. Marcel Bestebroer
  3553. --------------------------------------------------------------------------------
  3554. @@TJclTabSet.TabStops
  3555. Summary:
  3556. Specifies the tabulation positions to use.
  3557. Description:
  3558. TabStops indicates which fixed tabulation positions this set will use. The
  3559. array is guaranteed in column order, with the smallest tabulation position
  3560. being at index 0. As a consequence, writing a new value at any index of the
  3561. array is internally handled as a <LINK TJclTabSet.Delete, delete>, followed
  3562. by an <TLINK TJclTabSet.Add, add> operation, to preserve this ordered
  3563. property.
  3564. Notes:
  3565. This property is <i><b>nil</b>-safe</i>. However, since a <b>nil</b> tab set
  3566. has no fixed tabulation positions, any read or write operation will result in
  3567. an EJclStringError (argument out of range).
  3568. See also:
  3569. TJclTabSet.ActualTabWidth
  3570. TJclTabSet.Count
  3571. TJclTabSet.TabStops
  3572. TJclTabSet.TabWidth
  3573. Donator:
  3574. Marcel Bestebroer
  3575. --------------------------------------------------------------------------------
  3576. @@TJclTabSet.TabWidth
  3577. Summary:
  3578. Specifies the tabulation width this instance will use.
  3579. Description:
  3580. TabWidth indicates the tabulation width to use for columns beyond those
  3581. specified by the <LINK TJclTabSet.TabStops, TabStops> property.
  3582. If this property is set to zero or a negative value, the instance will
  3583. calculate the <LINK TJclTabSet.ActualTabWidth, actual tabulation width> to use
  3584. according to the following table:
  3585. <TABLE>
  3586. Situation ActualTabWidth
  3587. ---------- --------------------------
  3588. No tabulation positions defined 2
  3589. One tabulation position defined the defined tabulation position
  3590. Two or more tabulation positions defined the distance between the last
  3591. two tabulation positions
  3592. </TABLE>
  3593. Notes:
  3594. This property is <i><b>nil</b>-safe</i>. When read from on a
  3595. <b>nil</b>-reference, this property will return 2. When written to on a
  3596. <b>nil</b>-reference, a NullReferenceException will be raised.
  3597. See also:
  3598. TJclTabSet.ActualTabWidth
  3599. TJclTabSet.Count
  3600. TJclTabSet.TabStops
  3601. Donator:
  3602. Marcel Bestebroer
  3603. --------------------------------------------------------------------------------
  3604. @@TJclTabSet.ToString
  3605. Summary
  3606. Converts the tab set into its string representation.
  3607. Description
  3608. The ToString method returns a string representing this tab set, containing
  3609. each individual tabulation position and the tab width used beyond those
  3610. fixed positions.
  3611. Using this overload is the same as using the one with the
  3612. <LINK TJclTabSet.ToString@SizeInt, formatting options>, specifying the
  3613. TabSetFormatting_Full option.
  3614. The resulting string will be composed of the following items:
  3615. <TABLE>
  3616. '0' Outputted only when the tabset is zero-based.
  3617. 0 or more whitespaces Used to separate the zero-based flag from
  3618. the tabulation positions; at least one
  3619. whitespace is used if no opening bracket is
  3620. used.
  3621. '[' Opening bracket for the fixed tabulation
  3622. positions.
  3623. comma-separated list of The individual fixed tabulation positions of
  3624. tabulation positions this tab set.
  3625. ']' Closing bracket for the fixed tabulation
  3626. positions.
  3627. 0 or more whitespaces Used to separate the zero-based flag and/or
  3628. tabulation positions from the tab width.
  3629. '+' Outputted to mark the tab width property.
  3630. Value of ActualTabWidth The tab width.
  3631. </TABLE>
  3632. Returns:
  3633. A string representation of this tab set.
  3634. Notes:
  3635. This method is <i><b>nil</b>-safe</i>.
  3636. --------------------------------------------------------------------------------
  3637. @@TJclTabSet.ToString@SizeInt
  3638. Summary
  3639. Converts the tab set into its string representation using the specified
  3640. formatting.
  3641. Description
  3642. The ToString method returns a string representing this tab set, containing
  3643. each individual tabulation position and the tab width used beyond those
  3644. fixed positions.
  3645. The FormattingOptions parameter indicates whether and how the tabulation
  3646. positions are handled and whether the tab width will be in the string.
  3647. The resulting string will be composed of the following items:
  3648. <TABLE>
  3649. '0' Outputted only when the tabset is zero-based.
  3650. 0 or more whitespaces Used to separate the zero-based flag from
  3651. the tabulation positions; at least one
  3652. whitespace is used if no opening bracket is
  3653. used.
  3654. '[' Opening bracket for the fixed tabulation
  3655. positions, outputted when the formatting
  3656. options specify it.
  3657. comma-separated list of The individual fixed tabulation positions of
  3658. tabulation positions this tab set, outputted when tab stops are
  3659. not disabled by the options.
  3660. ']' Closing bracket for the fixed tabulation
  3661. positions, outputted when the formatting
  3662. options specify it.
  3663. 0 or more whitespaces Used to separate the zero-based flag and/or
  3664. tabulation positions from the tab width.
  3665. '+' Outputted to mark the tab width property.
  3666. Value of ActualTabWidth The tab width.
  3667. </TABLE>
  3668. Parameters:
  3669. FormattingOptions - the formatting options to use. See
  3670. <LINK TabSetFormattingOptions, TJclTabSet formatting options> for the
  3671. available options.
  3672. Returns:
  3673. A string representation of this tab set, formatted according to the provided
  3674. formatting options.
  3675. Notes:
  3676. This method is <i><b>nil</b>-safe</i>.
  3677. --------------------------------------------------------------------------------
  3678. @@TJclTabSet.UpdatePosition@string
  3679. Summary:
  3680. Calculates the ending column after expanding tabs in the provided
  3681. string.
  3682. Description:
  3683. Calculate will simulate the Expand method, calculating the ending column
  3684. only.
  3685. Multi-line strings, ie. strings containing one or more newline sequences (eg.
  3686. CrLf, but also single Cr of Lf characters are treated as newlines), are
  3687. handled properly, with all but the first line starting at column 0
  3688. (<LINK TJclTabSet.ZeroBased, zero-based> set to <code>True</code>) or 1
  3689. (<LINK TJclTabSet.ZeroBased, zero-based> set to <code>False</code>).
  3690. Parameters:
  3691. S - The string to expand tabs in.
  3692. Result:
  3693. The ending column after expanding tabs in the provided string.
  3694. Notes:
  3695. This method is <i><b>nil</b>-safe</i>; when invoked on a
  3696. <b>nil</b>-reference, this method will assume a tab width of two on a
  3697. zero-based tab set.
  3698. Example:
  3699. See the <LINK TJclTabSet, TJclTabSet> help for an example.
  3700. See also:
  3701. TJclTabSet
  3702. TJclTabSet.Expand@string@SizeInt
  3703. TJclTabSet.TabFrom
  3704. Donator:
  3705. Marcel Bestebroer
  3706. --------------------------------------------------------------------------------
  3707. @@TJclTabSet.UpdatePosition@string@SizeInt
  3708. Summary:
  3709. Calculates the ending column after expanding tabs in the provided
  3710. string.
  3711. Description:
  3712. Calculate will simulate the Expand method, calculating the ending column
  3713. only.
  3714. Multi-line strings, ie. strings containing one or more newline sequences (eg.
  3715. CrLf, but also single Cr of Lf characters are treated as newlines), are
  3716. handled properly, with all but the first line starting at column 0
  3717. (<LINK TJclTabSet.ZeroBased, zero-based> set to <code>True</code>) or 1
  3718. (<LINK TJclTabSet.ZeroBased, zero-based> set to <code>False</code>).
  3719. Parameters:
  3720. S - The string to expand tabs in.
  3721. Column - The starting column to use when expanding the tabs.
  3722. Result:
  3723. The ending column after expanding tabs in the provided string.
  3724. Notes:
  3725. This method is <i><b>nil</b>-safe</i>; when invoked on a
  3726. <b>nil</b>-reference, this method will assume a tab width of two on a
  3727. zero-based tab set.
  3728. Example:
  3729. See the <LINK TJclTabSet, TJclTabSet> help for an example.
  3730. See also:
  3731. TJclTabSet
  3732. TJclTabSet.Expand@string@SizeInt
  3733. TJclTabSet.TabFrom
  3734. Donator:
  3735. Marcel Bestebroer
  3736. --------------------------------------------------------------------------------
  3737. @@TJclTabSet.UpdatePosition@string@SizeInt@SizeInt
  3738. Summary:
  3739. Calculates the ending line and column after expanding tabs in the provided
  3740. string.
  3741. Description:
  3742. Calculate will simulate the Expand method, updating the line and column
  3743. variables only. For convenience, the ending column is also the method's result
  3744. value.
  3745. Multi-line strings, ie. strings containing one or more newline sequences (eg.
  3746. CrLf, but also single Cr of Lf characters are treated as newlines), are
  3747. handled properly, with all but the first line starting at column 0
  3748. (<LINK TJclTabSet.ZeroBased, zero-based> set to <code>True</code>) or 1
  3749. (<LINK TJclTabSet.ZeroBased, zero-based> set to <code>False</code>).
  3750. Parameters:
  3751. S - The string to expand tabs in.
  3752. Column - On entry: The starting column to use when expanding the tabs.
  3753. On return: The ending column after expanding the tabs.
  3754. Line - On entry: The starting line to use when expanding the tabs.
  3755. On return: The ending line after expanding the tabs.
  3756. Result:
  3757. The ending column after expanding tabs in the provided string.
  3758. Notes:
  3759. This method is <i><b>nil</b>-safe</i>; when invoked on a
  3760. <b>nil</b>-reference, this method will assume a tab width of two on a
  3761. zero-based tab set.
  3762. Example:
  3763. See the <LINK TJclTabSet, TJclTabSet> help for an example.
  3764. See also:
  3765. TJclTabSet
  3766. TJclTabSet.Expand@string@SizeInt
  3767. TJclTabSet.TabFrom
  3768. Donator:
  3769. Marcel Bestebroer
  3770. --------------------------------------------------------------------------------
  3771. @@TJclTabSet.ZeroBased
  3772. Summary:
  3773. Specifies whether the columns are zero-based.
  3774. Description:
  3775. ZeroBased indicates whether specified
  3776. <LINK TJclTabSet.TabStops, tabulation positions> and other column references
  3777. are zero based.
  3778. If this property is set to <code>True</code>, all columns are considered to be
  3779. zero-based (the first column index is zero); otherwise columns references are
  3780. one-based (the first column index is one).
  3781. If this flag is toggled, any stored
  3782. <LINK TJclTabSet.TabStops, tabulation positions> are automatically converted
  3783. to the new state (ie. values are incremented when setting to <code>False</code> or
  3784. decremented when setting to <code>True</code>).
  3785. Notes:
  3786. This property is <i><b>nil</b>-safe</i>. When read from on a
  3787. <b>nil</b>-reference, this property will return <code>True</code>. When written to
  3788. on a <b>nil</b>-reference, a NullReferenceException will be raised.
  3789. See also:
  3790. TJclTabSet.Expand@string@SizeInt
  3791. TJclTabSet.TabStops
  3792. TJclTabSet.TabFrom
  3793. Donator:
  3794. Marcel Bestebroer
  3795. --------------------------------------------------------------------------------
  3796. @@AnsiCompareNaturalStr
  3797. <GROUP StringManipulation.StringTestRoutines>
  3798. Summary:
  3799. Compares strings based on the current locale with case sensitivity and using a
  3800. 'natural order' algorithm.
  3801. Description:
  3802. AnsiCompareNaturalStr implements a case-sensitive, 'natural' comparison
  3803. between the two supplied strings. It performs identical to the AnsiCompareStr
  3804. function but compares number components numerically, instead of
  3805. alphabetically.
  3806. Leading spaces are ignored when comparing numbers, but leading zeroes aren't.
  3807. This gives more sensible order when comparing and sorting fractional numbers.
  3808. The table below shows the behaviour of both AnsiCompareNaturalStr and
  3809. AnsiCompareStr:
  3810. <TABLE>
  3811. S1 S2 AnsiCompareNaturalStr AnsiCompareStr
  3812. ------------ ------------ --------------------- --------------
  3813. Delphi 5 Delphi 2005 negative positive
  3814. Delphi 5 Delphi 2005 negative negative
  3815. Delphi 5 Delphi 6 negative negative
  3816. Delphi 5 Delphi 6 negative positive
  3817. Delphi Highlander Delphi 2005 positive positive
  3818. Delphi Highlander Delphi Highlander positive positive
  3819. Foobar v0.9.4 Foobar v0.10.3 negative positive
  3820. Foobar v0.9.4 Foobar V0.9.4 negative negative
  3821. ?
  3822. 0002 1 negative negative
  3823. 1.5 1.06 positive negative
  3824. ?
  3825. 0 -5 positive positive
  3826. -5 +2 negative positive
  3827. </TABLE>
  3828. Parameters:
  3829. S1 - First string to compare.
  3830. S2 - Second string to compare.
  3831. Result:
  3832. <code>0</code> if S1 is identical to S2
  3833. ?<i>- or -</i><p>
  3834. <code>a negative value</code> if S1 is less than S2
  3835. ?<i>- or -</i><p>
  3836. <code>a positive value</code> if S1 is greater than S2
  3837. Donator:
  3838. Marcel Bestebroer
  3839. --------------------------------------------------------------------------------
  3840. @@AnsiCompareNaturalText
  3841. <GROUP StringManipulation.StringTestRoutines>
  3842. Summary:
  3843. Compares strings based on the current locale with case insensitivity and using
  3844. a 'natural order' algorithm.
  3845. Description:
  3846. AnsiCompareNaturalText implements a case-insensitive, 'natural' comparison
  3847. between the two supplied strings. It performs identical to the AnsiCompareText
  3848. function but compares number components numerically, instead of
  3849. alphabetically.
  3850. Leading spaces are ignored when comparing numbers, but leading zeroes aren't.
  3851. This gives more sensible order when comparing and sorting fractional numbers.
  3852. The table below shows the behaviour of both AnsiCompareNaturalText and
  3853. AnsiCompareText:
  3854. <TABLE>
  3855. S1 S2 AnsiCompareNaturalText AnsiCompareText
  3856. ------------ ------------ ---------------------- ---------------
  3857. Delphi 5 Delphi 2005 negative positive
  3858. Delphi 5 Delphi 2005 negative negative
  3859. Delphi 5 Delphi 6 negative negative
  3860. Delphi 5 Delphi 6 negative positive
  3861. Delphi Highlander Delphi 2005 positive positive
  3862. Delphi Highlander Delphi Highlander positive positive
  3863. Foobar v0.9.4 Foobar v0.10.3 negative positive
  3864. Foobar v0.9.4 Foobar V0.9.4 zero zero
  3865. ?
  3866. 0002 1 negative negative
  3867. 1.5 1.06 positive negative
  3868. ?
  3869. 0 -5 positive positive
  3870. -5 +2 negative positive
  3871. </TABLE>
  3872. Parameters:
  3873. S1 - First string to compare.
  3874. S2 - Second string to compare.
  3875. Result:
  3876. <code>0</code> if S1 is identical to S2
  3877. ?<i>- or -</i><p>
  3878. <code>a negative value</code> if S1 is less than S2
  3879. ?<i>- or -</i><p>
  3880. <code>a positive value</code> if S1 is greater than S2
  3881. Donator:
  3882. Marcel Bestebroer
  3883. --------------------------------------------------------------------------------