TextCruncher Xtra TEXTCRUNCHER XTRA HELP: METHODS AT A GLANCE  
 
Method and arguments Purpose
TC_Register (registrationCodeString) Prevents the demo dialog from coming up after purchase.

 

Search

FindFirst (sourceString, findString) Returns the integer character position in sourceString of the first occurence of findString.
FindNext (sourceString, findString) Returns the integer character position in sourceString of the occurence of findString after the current search position.
FindPrevious (sourceString, findString) Returns the integer character position in sourceString of the occurence of findString before the current search position.
FindAll (sourceString, findString) Returns a list of the starting character positions of all occurrences of findString in sourceString.

 

Character Position

GetWordOfCharPosition (sourceString, characterNumber) Returns the integer word number of sourceString containing the specified character position.
GetLineOfCharPosition (sourceString, characterNumber) Returns the integer line number of sourceString containing the specified character position.
GetItemOfCharPosition (sourceString, characterNumber, itemDelimiterASCIICod) Returns the integer item number of sourceString containing the specified character position.

 

Replace

ReplaceFirst (sourceString, replaceString, findString) Replaces the first occurrence of findString found in sourceString with replaceString. Returns the modified sourceString.
ReplaceNext (sourceString, replaceString, findString) Replaces the occurrence of findString found in sourceString on or after the current search position with replaceString. Returns the modified sourceString.
ReplaceAll (sourceString, replaceString, findString) Replaces all occurrences of findString found in sourceString with replaceString. Returns the modified sourceString.

 

Search/Replace Properties

SetPosition (characterNumber) Sets the integer character position in the string from where the next find or replace will start. Affects FindNext, FindPrevious and ReplaceNext.
GetPosition ( ) Returns the integer character position from which the next find or replace will start. Affects FindNext, FindPrevious and ReplaceNext.
SetCaseSensitivity (boolean) Determines whether the found string must match the case of the search string. (deprecated in D11)

 

Indexing

GetListOfWords (sourceString) Returns a list of character chunks delimited by white space.
GetListOfLines (sourceString) Returns a list of lines delimited by either CR only (Mac) or CR/LF (PC)
GetListOfItems (sourceString, itemDelimiterASCIICode) Returns a list of items delimited by the itemDelimiter specified.

 

Case

ToUpperCase (sourceString) Converts characters with upper case counterparts in sourceString to upper case. Leaves other characters unchanged. Returns the modified string. (deprecated in D11)
ToLowerCase (sourceString) Converts characters with lower case counterparts in sourceString to lower case. Leaves other characters unchanged. Returns the modified string. (deprecated in D11)

 

Formatting

HardWrapText (sourceString, charsPerLine) Limits the length of each line to the specified characters per line. Returns the modified string.
HardCenterText (sourceString, charsPerLine) Limits the length of each line to the specified characters per line. Centers the text of each line by padding it with spaces on either end. Returns the modified string.
HardAlignTextRight (sourceString, charsPerLine) Limits the length of each line to the specified characters per line. Right-justifies the text of each line by padding it with spaces on the left. Returns the modified string.

 

URL Encoding

TC_URLEncode (sourceString) Hex-encodes some punctuation and characters above ASCII 127 to the web standard Latin-1 character set. Returns the modified string. (deprecated in D11)
TC_URLDecode (sourceString) Decodes URL-encoded text. Returns the modified string. (deprecated in D11)

 

Error Reporting

TC_GetLastError ( ) Returns the error status code for the last TextCruncher operation
TC_ErrorCodeToString (errorCodeNumber) Returns a text description of the error number.