<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.den4b.com/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Prologician</id>
	<title>den4b Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://www.den4b.com/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Prologician"/>
	<link rel="alternate" type="text/html" href="https://www.den4b.com/wiki/Special:Contributions/Prologician"/>
	<updated>2026-06-25T16:30:12Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.10</generator>
	<entry>
		<id>https://www.den4b.com/w/index.php?title=ReNamer:Pascal_Script:Functions&amp;diff=1076</id>
		<title>ReNamer:Pascal Script:Functions</title>
		<link rel="alternate" type="text/html" href="https://www.den4b.com/w/index.php?title=ReNamer:Pascal_Script:Functions&amp;diff=1076"/>
		<updated>2009-08-03T04:33:32Z</updated>

		<summary type="html">&lt;p&gt;Prologician: /* Unicode String Handling Routines */ Noted case insensitivity for WideSameText()&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction  ==&lt;br /&gt;
&lt;br /&gt;
ReNamer has many [http://www.taoyue.com/tutorials/pascal/pas4a.html procedures] and [http://www.taoyue.com/tutorials/pascal/pas4c.html functions] to manipulate the entities related to file names. These entities may be derived from the existing filename, path, system date, meta tags from the file, strings entered by the user, etc.&lt;br /&gt;
&lt;br /&gt;
A common prefix &#039;&#039;&#039;Wide&#039;&#039;&#039; in the function name indicates that the function deals with [http://en.wikipedia.org/wiki/Unicode Unicode] strings (WideString). The prefix is used because there are similar functions which deal with Ansi strings and in some cases simply for internal consistency. For example: &#039;&#039;&#039;ShowMessage&#039;&#039;&#039; and &#039;&#039;&#039;WideShowMessage&#039;&#039;&#039; procedures.&lt;br /&gt;
&lt;br /&gt;
*??? What is T prefix? &lt;br /&gt;
*??? What is UTF8?&lt;br /&gt;
&lt;br /&gt;
== Basic String Handling Routines  ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Routine&lt;br /&gt;
! Remarks&lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;Insert&#039;&#039;&#039;(Source: String; var S: String; Index: Integer); &lt;br /&gt;
| Inserts the string &#039;&#039;&#039;S&#039;&#039;&#039; into string &#039;&#039;&#039;Source&#039;&#039;&#039; at position &#039;&#039;&#039;Index&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;Delete&#039;&#039;&#039;(var S: String; Index, Count: Integer); &lt;br /&gt;
| Deletes &#039;&#039;&#039;Count&#039;&#039;&#039; characters from the string &#039;&#039;&#039;S&#039;&#039;&#039;, starting from position &#039;&#039;&#039;Index&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;Copy&#039;&#039;&#039;(S: String; Index, Count: Integer): String; &lt;br /&gt;
| Copies &#039;&#039;&#039;Count&#039;&#039;&#039; characters from string &#039;&#039;&#039;S&#039;&#039;&#039;, starting at position &#039;&#039;&#039;Index&#039;&#039;&#039;, and returns them as a new string.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;Pos&#039;&#039;&#039;(Substr: String; S: String): Integer; &lt;br /&gt;
| Returns the position of a string &#039;&#039;&#039;Substr&#039;&#039;&#039; in another string &#039;&#039;&#039;S&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Indexes of characters in strings are 1 based, so first character in string S would be S[1].&lt;br /&gt;
&lt;br /&gt;
== Length Managing Routines  ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Routine&lt;br /&gt;
! Remarks&lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;SetLength&#039;&#039;&#039;(var S: Array; NewLength: Integer); &lt;br /&gt;
| Sets the length of array variable &#039;&#039;&#039;S&#039;&#039;&#039; to &#039;&#039;&#039;NewLength&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;SetLength&#039;&#039;&#039;(var S: String; NewLength: Integer); &lt;br /&gt;
| Sets the length of string variable &#039;&#039;&#039;S&#039;&#039;&#039; to &#039;&#039;&#039;NewLength&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;SetLength&#039;&#039;&#039;(var S: WideString; NewLength: Integer); &lt;br /&gt;
| Sets the length of widestring &#039;&#039;&#039;S&#039;&#039;&#039; to &#039;&#039;&#039;NewLength&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;Length&#039;&#039;&#039;(const S: Array): Integer; &lt;br /&gt;
| Returns the length of array &#039;&#039;&#039;S &#039;&#039;&#039; (number of elements).&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;Length&#039;&#039;&#039;(const S: String): Integer; &lt;br /&gt;
| Returns the length of string &#039;&#039;&#039;S&#039;&#039;&#039; (number of characters).&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;Length&#039;&#039;&#039;(const S: WideString): Integer;&lt;br /&gt;
| Returns the length of WideString &#039;&#039;&#039;S&#039;&#039;&#039; (number of characters).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Unicode String Handling Routines ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Routine&lt;br /&gt;
! Remarks&lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;WideInsert&#039;&#039;&#039;(const Substr: WideString; var Dest: WideString; Index: Integer); &lt;br /&gt;
| Inserts &#039;&#039;&#039;Substr&#039;&#039;&#039; in &#039;&#039;&#039;Dest&#039;&#039;&#039; at position &#039;&#039;&#039;Index&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;WideDelete&#039;&#039;&#039;(var S: WideString; Index, Count: Integer); &lt;br /&gt;
| Deletes &#039;&#039;&#039;Count&#039;&#039;&#039; characters from &#039;&#039;&#039;S&#039;&#039;&#039;, starting from the &#039;&#039;&#039;Index&#039;&#039;&#039; position.&lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;WideSetLength&#039;&#039;&#039;(var S: WideString; NewLength: Integer); &lt;br /&gt;
| Change the length of string &#039;&#039;&#039;S&#039;&#039;&#039; to a new length specified by &#039;&#039;&#039;NewLength&#039;&#039;&#039;. If new length is smaller than original, the string is truncated. If new length is greater than original, the string will be expanded but additional characters will not be initialized and can be anything.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideLength&#039;&#039;&#039;(const S: WideString): Integer; &lt;br /&gt;
| Returns the length of WideString &#039;&#039;&#039;S&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideCopy&#039;&#039;&#039;(const S: WideString; Index, Count: Integer): WideString; &lt;br /&gt;
| Returns &#039;&#039;&#039;Count&#039;&#039;&#039; characters from WideString &#039;&#039;&#039;S&#039;&#039;&#039;, starting at position &#039;&#039;&#039;Index&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WidePos&#039;&#039;&#039;(const SubStr, S: WideString): Integer; &lt;br /&gt;
| Find and occurrence of &#039;&#039;&#039;SubStr&#039;&#039;&#039; in &#039;&#039;&#039;S&#039;&#039;&#039;. Returns the position of first occurrence, or &#039;&#039;&#039;0&#039;&#039;&#039; if nothing was found.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WidePosEx&#039;&#039;&#039;(const SubStr, S: WideString; Offset: Cardinal): Integer; &lt;br /&gt;
| Find and occurrence of &#039;&#039;&#039;SubStr&#039;&#039;&#039; in &#039;&#039;&#039;S&#039;&#039;&#039; but start searching from position specified by &#039;&#039;&#039;Offset&#039;&#039;&#039;. Returns the position of first occurrence, or &#039;&#039;&#039;0&#039;&#039;&#039; if nothing was found.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideUpperCase&#039;&#039;&#039;(const S: WideString): WideString; &lt;br /&gt;
| Returns the ALLCAPS version of the WideString &#039;&#039;&#039;S&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideLowerCase&#039;&#039;&#039;(const S: WideString): WideString; &lt;br /&gt;
| Returns the lowercase version of the WideString &#039;&#039;&#039;S&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideCompareStr&#039;&#039;&#039;(const S1, S2: WideString): Integer; &lt;br /&gt;
| Compares two WideStrings &#039;&#039;&#039;S1&#039;&#039;&#039; and &#039;&#039;&#039;S2&#039;&#039;&#039;, case-sensitive, and returns an integer based on the result. The return value is less than 0 if S1 is less than S2, 0 if S1 equals S2, or greater than 0 if S1 is greater than S2.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideCompareText&#039;&#039;&#039;(const S1, S2: WideString): Integer; &lt;br /&gt;
| Compares two WideStrings &#039;&#039;&#039;S1&#039;&#039;&#039; and &#039;&#039;&#039;S2&#039;&#039;&#039;, case-insensitive, and returns an integer based on the result. The return value is less than 0 if S1 is less than S2, 0 if S1 equals S2, or greater than 0 if S1 is greater than S2.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideSameText&#039;&#039;&#039;(const S1, S2: WideString): Boolean; &lt;br /&gt;
| Compares two WideStrings &#039;&#039;&#039;S1&#039;&#039;&#039; and &#039;&#039;&#039;S2&#039;&#039;&#039;, case-insensitive. Returns TRUE if both are identical, otherwise returns FALSE.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideTextPos&#039;&#039;&#039;(const SubStr, S: WideString): Integer; &lt;br /&gt;
| Behaves like &#039;&#039;&#039;WidePos&#039;&#039;&#039; function, except text if processed in case-insensitive manner.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideTrim&#039;&#039;&#039;(const S: WideString): WideString; &lt;br /&gt;
| Removes leading and trailing spaces and control characters from the given string &#039;&#039;&#039;S&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideReplaceStr&#039;&#039;&#039;(const S, OldPattern, NewPattern: WideString): WideString; &lt;br /&gt;
| &amp;amp;nbsp;???&amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideReplaceText&#039;&#039;&#039;(const S, OldPattern, NewPattern: WideString): WideString; &lt;br /&gt;
| &amp;amp;nbsp;???&amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideSplitString&#039;&#039;&#039;(const Input, Delimiter: WideString): TStringsArray; &lt;br /&gt;
| &lt;br /&gt;
Splits the WideString &#039;&#039;&#039;Input &#039;&#039;&#039;wherever &#039;&#039;&#039;Delimiter&#039;&#039;&#039; occurs, and returns an array that contains the split parts. &lt;br /&gt;
&lt;br /&gt;
*The &#039;&#039;&#039;Delimiter&#039;&#039;&#039; itself can be a multi-character WideString. &amp;lt;br&amp;gt;(Unlike the usual comma, hyphen or space that is used for this purpose) &lt;br /&gt;
*The split parts (returned as elements of the array) do not contain the &#039;&#039;&#039;Delimiter&#039;&#039;&#039; WideString&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideCaseCapitalize&#039;&#039;&#039;(const S: WideString): WideString; &lt;br /&gt;
| &lt;br /&gt;
Returns the &#039;&#039;Sentence case&#039;&#039; version of the WideString &#039;&#039;&#039;S&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
Only the first alphabetic character is capitalized. All other alphabetic characters are converted to lowercase.&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*If &#039;&#039;&#039;S&#039;&#039;&#039; begins with numeric characters, the first alphabetic character that follows will be capitalized.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideCaseInvert&#039;&#039;&#039;(const S: WideString): WideString; &lt;br /&gt;
| Inverts the case of all characters in the WideString &#039;&#039;&#039;S&#039;&#039;&#039; and returns the WideString.&amp;lt;br&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Meta Tags Extraction  ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Function&lt;br /&gt;
! Remarks&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;CalculateMetaTag&#039;&#039;&#039;(const FilePath: WideString; const MetaTagName String): String; &lt;br /&gt;
| Extracts and returns the value of a metatag specified by &#039;&#039;&#039;MetaTagName&#039;&#039;&#039; from the file specified by the complete absolute path &#039;&#039;&#039;FilePath&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For example, to extract &#039;&#039;&#039;EXIF_Date&#039;&#039;&#039; tag from an image and set it to the filename, one can use something like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
begin&lt;br /&gt;
  FileName := CalculateMetaTag(FilePath, &#039;EXIF_Date&#039;);&lt;br /&gt;
end.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The full list of meta tags can be found in [[ReNamer:Meta Tags|Meta Tags]] article.&lt;br /&gt;
&lt;br /&gt;
== Regular Expressions  ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Function&lt;br /&gt;
! Remarks&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;ReplaceRegEx&#039;&#039;&#039;(const Input, Find, Replace: WideString;const CaseSensitive, UseSubstitution: Boolean): WideString; &lt;br /&gt;
| Find-and-replace function using RegEx. Works like [[ReNamer:Rules:RegEx|RegEx rule]].&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;MatchesRegEx&#039;&#039;&#039;(const Input, Find: WideString;const CaseSensitive: Boolean): TStringsArray; &lt;br /&gt;
| Returns a list of RegEx matches as an array. Function returns an array of full matches, which matched the entire expression, not the sub-patterns.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;SubMatchesRegEx&#039;&#039;&#039;(const Input, Find: WideString;const CaseSensitive: Boolean): TStringsArray; &lt;br /&gt;
| This function is very similar to &#039;&#039;&#039;MatchesRegEx&#039;&#039;&#039;, but instead of returning full expression matches it will return an array of sub-expression matches for the first full expression match. For example, &#039;&#039;&#039;SubMatchesRegEx(&#039;one two three&#039;, &#039;(.*) (.*) (.*)&#039;)&#039;&#039;&#039; will return an array &#039;&#039;&#039;[&#039;one&#039;, &#039;two&#039;, &#039;three&#039;]&#039;&#039;&#039;. In this way, it can easily be combined with &#039;&#039;&#039;MatchesRegEx&#039;&#039;&#039; function, to allow users to find all global matches, and then parse those matches through &#039;&#039;&#039;SubMatchesRegEx&#039;&#039;&#039; function to find individual sub-expression matches of each global match.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
General parameters of the functions: &lt;br /&gt;
&lt;br /&gt;
* Input - The WideString that is input to the function. &lt;br /&gt;
* Find - RegEx pattern to be found (same as &#039;&#039;&#039;Expression&#039;&#039;&#039; field in the [[ReNamer:Rules:RegEx|RegEx rule]]).&lt;br /&gt;
* Replace - Replacement string (same as the &#039;&#039;&#039;Replace&#039;&#039;&#039; field in the [[ReNamer:Rules:RegEx|RegEx rule]]).&lt;br /&gt;
* CaseSensitive - Specifies whether to process in a case-sensitive mode.&lt;br /&gt;
* UseSubstitution - Determines whether use [[ReNamer:Regular Expressions#Backreferences|backreferences]] in the result.&lt;br /&gt;
&lt;br /&gt;
== Unicode Character Handling Routines  ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Function&lt;br /&gt;
! Remarks&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IsWideCharUpper&#039;&#039;&#039;(WC: WideChar): Boolean; &lt;br /&gt;
| Checks a Unicode character &#039;&#039;&#039;WC&#039;&#039;&#039; and returns TRUE if it is in UPPERCASE.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IsWideCharLower&#039;&#039;&#039;(WC: WideChar): Boolean; &lt;br /&gt;
| Checks a Unicode character &#039;&#039;&#039;WC&#039;&#039;&#039; and returns TRUE if it is in lowercase.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IsWideCharDigit&#039;&#039;&#039;(WC: WideChar): Boolean; &lt;br /&gt;
| Checks a Unicode character &#039;&#039;&#039;WC&#039;&#039;&#039; and returns TRUE if it is a digit (numeric character 0-9). &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IsWideCharSpace&#039;&#039;&#039;(WC: WideChar): Boolean; &lt;br /&gt;
| Checks a Unicode character &#039;&#039;&#039;WC&#039;&#039;&#039; and returns TRUE if it is a white-space character, such as: space, form-feed, newline, carriage-return, tab and vertical-tab (characters classified as C1_SPACE).&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IsWideCharPunct&#039;&#039;&#039;(WC: WideChar): Boolean; &lt;br /&gt;
| Checks a Unicode character &#039;&#039;&#039;WC&#039;&#039;&#039; and returns TRUE if it is a punctuation mark (characters classified as C1_PUNCT).&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IsWideCharCntrl&#039;&#039;&#039;(WC: WideChar): Boolean; &lt;br /&gt;
| Checks a Unicode character &#039;&#039;&#039;WC&#039;&#039;&#039; and returns TRUE if it is a control character (characters classified as C1_CNTRL).&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IsWideCharBlank&#039;&#039;&#039;(WC: WideChar): Boolean; &lt;br /&gt;
| Checks a Unicode character &#039;&#039;&#039;WC&#039;&#039;&#039; and returns TRUE if it is a blank, such as: space and tab (characters classified as C1_BLANK).&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IsWideCharXDigit&#039;&#039;&#039;(WC: WideChar): Boolean; &lt;br /&gt;
| Checks a Unicode character &#039;&#039;&#039;WC&#039;&#039;&#039; and returns TRUE if it is a hexadecimal digit (0-9 or A-F).&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IsWideCharAlpha&#039;&#039;&#039;(WC: WideChar): Boolean; &lt;br /&gt;
| Checks a Unicode character &#039;&#039;&#039;WC&#039;&#039;&#039; and returns TRUE if it is a alphanumeric character (a-z or A-Z).&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IsWideCharAlphaNumeric&#039;&#039;&#039;(WC: WideChar): Boolean; &lt;br /&gt;
| Checks a Unicode character &#039;&#039;&#039;WC&#039;&#039;&#039; and returns TRUE if it is a alphanumeric character or a numeric character (a-z, A-Z or 0-9).&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideCharUpper&#039;&#039;&#039;(const WC: WideChar): WideChar; &lt;br /&gt;
| Returns a UPPERCASE version of the input Unicode character. In case of non-alphabetic character, it returns the same character.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideCharLower&#039;&#039;&#039;(const WC: WideChar): WideChar; &lt;br /&gt;
| Returns a lowercase version of the input Unicode character. In case of non-alphabetic character, it returns the same character.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Character classifications, such as C1_UPPER, C1_LOWER, C1_DIGIT, C1_SPACE, C1_PUNCT, C1_CNTRL, C1_BLANK, C1_XDIGIT, C1_ALPHA - are part of Unicode definitions. More information regarding classification can be found on the internet. For example: [http://www.fileformat.info/info/unicode/ http://www.fileformat.info/info/unicode/].&lt;br /&gt;
&lt;br /&gt;
== Unicode Conversion Routines  ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Function&lt;br /&gt;
! Remarks&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideToAnsi&#039;&#039;&#039;(const WS: WideString): String; &lt;br /&gt;
| Converts a Unicode string to its ANSI version.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;AnsiToWide&#039;&#039;&#039;(const S: String): WideString; &lt;br /&gt;
| Converts a ANSI string to its Unicode version.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;UTF8Encode&#039;&#039;&#039;(const WS: WideString): String; &lt;br /&gt;
| Convert Unicode string to the UTF-8 encoded string. Useful to storing Unicode strings in files.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;UTF8Decode&#039;&#039;&#039;(const S: String): WideString;&lt;br /&gt;
| Convert UTF-8 encoded string to its full Unicode representation.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Basic Conversion Routines  ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Function&lt;br /&gt;
! Remarks&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IntToStr&#039;&#039;&#039;(Value: Integer): String; &lt;br /&gt;
| Converts an integer to a string. The following assumptions are correct:&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-family: monospace&amp;quot;&amp;gt;&lt;br /&gt;
* IntToStr(123) = &#039;123&#039;&lt;br /&gt;
* IntToStr(0123) = &#039;123&#039;&lt;br /&gt;
* IntToStr(123) &amp;lt;&amp;gt; &#039;0123&#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;StrToInt&#039;&#039;&#039;(const S: String): Integer; &lt;br /&gt;
| Converts a string to an integer. The following equality is correct:&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-family: monospace&amp;quot;&amp;gt;&lt;br /&gt;
* StrToInt(&#039;123&#039;) = 123&lt;br /&gt;
* StrToInt(&#039;123&#039;) = 0123&lt;br /&gt;
* StrToInt(&#039;0123&#039;) = 123&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Warning:&#039;&#039;&#039; An error will occur if the parameter to this function cannot be converted to an integer!&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;StrToIntDef&#039;&#039;&#039;(const S: String; const Default: Integer): Integer; &lt;br /&gt;
| Behaves like &#039;&#039;&#039;StrToInt&#039;&#039;&#039; function, but instead of producing an error on incorrect input function allows the &#039;&#039;&#039;Default&#039;&#039;&#039; value to be specified, which will be returned if the input cannot be converted to an integer.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;DateToStr&#039;&#039;&#039;(D: TDateTime): String; &lt;br /&gt;
| Converts a date to a string, using system format for the short date, for example: &#039;&#039;&#039;dd/mm/yyyy&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;StrToDate&#039;&#039;&#039;(const S: String): TDateTime; &lt;br /&gt;
| Converts a date string to a proper TDateTime value, using system format for the short date, for example: &#039;&#039;&#039;dd/mm/yyyy&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IntToHex&#039;&#039;&#039;(Value: Integer; Digits: Integer): String; &lt;br /&gt;
| Converts an integer to its hexadecimal representation. Here are samples:&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-family: monospace&amp;quot;&amp;gt;&lt;br /&gt;
* IntToHex(1234, 1) = &#039;4D2&#039;&lt;br /&gt;
* IntToHex(1234, 8) = &#039;000004D2&#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;HexToInt&#039;&#039;&#039;(const HexNum: String): Integer; &lt;br /&gt;
| Converts a hexadecimal value to its decimal representation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning:&#039;&#039;&#039; An error will occur if the parameter to this function cannot be converted to an integer!&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;HexToIntDef&#039;&#039;&#039;(const HexNum: String; Default: Integer): Integer; &lt;br /&gt;
| Behaves like &#039;&#039;&#039;HexToInt&#039;&#039;&#039; function, but instead of producing an error on incorrect input function allows the &#039;&#039;&#039;Default&#039;&#039;&#039; value to be specified, which will be returned if the input cannot be converted to an integer.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;Ord&#039;&#039;&#039;(X: Char): Byte; &lt;br /&gt;
| Return an ordinal value (byte representation) of a character.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;Chr&#039;&#039;&#039;(X: Byte): Char; &lt;br /&gt;
| Return a character by its ordinal value (byte representation).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Date And Time Routines ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Function&lt;br /&gt;
! Remarks&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;Date&#039;&#039;&#039;: TDateTime; &lt;br /&gt;
| Returns the current system date.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;Time&#039;&#039;&#039;: TDateTime; &lt;br /&gt;
| Returns the current system time.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;Now&#039;&#039;&#039;: TDateTime; &lt;br /&gt;
| Returns the current system date and time.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;EncodeDate&#039;&#039;&#039;(Year, Month, Day: Word): TDateTime; &lt;br /&gt;
| Generates date value for the specified &#039;&#039;&#039;Year&#039;&#039;&#039;, &#039;&#039;&#039;Month&#039;&#039;&#039;, &#039;&#039;&#039;Day&#039;&#039;&#039;. Parameters must be within a valid date range: Year = 0..9999, Month = 1..12, Day = 1..31 (depending on month/year). An error will be raised if parameters are invalid.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;EncodeTime&#039;&#039;&#039;(Hour, Min, Sec, MSec: Word): TDateTime; &lt;br /&gt;
| Generates time value for the specified &#039;&#039;&#039;Hour&#039;&#039;&#039;, &#039;&#039;&#039;Min&#039;&#039;&#039;, &#039;&#039;&#039;Sec&#039;&#039;&#039;, &#039;&#039;&#039;MSec&#039;&#039;&#039;. Parameters must be within a valid time range: Hour = 0..23, Min = 0..59, Sec = 0..59, MSec = 0..999. An error will be raised if parameters are invalid.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;TryEncodeDate&#039;&#039;&#039;(Year, Month, Day: Word; var Date: TDateTime): Boolean; &lt;br /&gt;
| Behaves exactly like &#039;&#039;&#039;EncodeDate&#039;&#039;&#039; function, except this function returns the TRUE or FALSE depending on the success of the operation. If operation was successful, function will return TRUE and the generated date value will be written in the &#039;&#039;&#039;Date&#039;&#039;&#039; variable.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;TryEncodeTime&#039;&#039;&#039;(Hour, Min, Sec, MSec: Word; var Time: TDateTime): Boolean; &lt;br /&gt;
| Behaves exactly like &#039;&#039;&#039;EncodeTime&#039;&#039;&#039; function, except this function returns the TRUE or FALSE depending on the success of the operation. If operation was successful, function will return TRUE and the generated time value will be written in the &#039;&#039;&#039;Time&#039;&#039;&#039; variable.&lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;DecodeDate&#039;&#039;&#039;(const DateTime: TDateTime; var Year, Month, Day: Word); &lt;br /&gt;
| Extracts &#039;&#039;&#039;Year&#039;&#039;&#039;, &#039;&#039;&#039;Month&#039;&#039;&#039; and &#039;&#039;&#039;Day&#039;&#039;&#039; components from a given &#039;&#039;&#039;DateTime&#039;&#039;&#039; value.&lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;DecodeTime&#039;&#039;&#039;(const DateTime: TDateTime; var Hour, Min, Sec, MSec: Word); &lt;br /&gt;
| Extracts &#039;&#039;&#039;Hour&#039;&#039;&#039;, &#039;&#039;&#039;Min&#039;&#039;&#039;, &#039;&#039;&#039;Sec&#039;&#039;&#039; and &#039;&#039;&#039;MSec&#039;&#039;&#039; components from a given &#039;&#039;&#039;DateTime&#039;&#039;&#039; value.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;DayOfWeek&#039;&#039;&#039;(const DateTime: TDateTime): Word; &lt;br /&gt;
| Returns the day of the week (as an index) for the specified &#039;&#039;&#039;DateTime&#039;&#039;&#039; value. The indexes are: 1 = Sunday, 2 = Monday, 3 = Tuesday, 4 = Wednesday, 5 = Thursday, 6 = Friday, 7 = Saturday.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;DateTimeToUnix&#039;&#039;&#039;(D: TDateTime): Int64;&lt;br /&gt;
| Converts &#039;&#039;&#039;D&#039;&#039;&#039; value of type &#039;&#039;&#039;TDateTime&#039;&#039;&#039; to a Unix timestamp.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;UnixToDateTime&#039;&#039;&#039;(U: Int64): TDateTime; &lt;br /&gt;
| Converts a Unix timestamp to a value of &#039;&#039;&#039;TDateTime&#039;&#039;&#039; type.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;FormatDateTime&#039;&#039;&#039;(const Fmt: String; D: TDateTime): String; &lt;br /&gt;
| This function provides rich formatting of a &#039;&#039;&#039;DateTime&#039;&#039;&#039; value into a string. [[ReNamer:Date and Time format|Date and time format]] is defined by the &#039;&#039;&#039;Fmt&#039;&#039;&#039; string. &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IncYear&#039;&#039;&#039;(const AValue: TDateTime;const ANumberOfYears: Integer): TDateTime; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IncMonth&#039;&#039;&#039;(const AValue: TDateTime;ANumberOfMonths: Integer): TDateTime; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IncWeek&#039;&#039;&#039;(const AValue: TDateTime; const ANumberOfWeeks: Integer): TDateTime; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IncDay&#039;&#039;&#039;(const AValue: TDateTime;const ANumberOfDays: Integer): TDateTime; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IncHour&#039;&#039;&#039;(const AValue: TDateTime;const ANumberOfHours: Int64): TDateTime; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IncMinute&#039;&#039;&#039;(const AValue: TDateTime;const ANumberOfMinutes: Int64): TDateTime; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IncSecond&#039;&#039;&#039;(const AValue: TDateTime;const ANumberOfSeconds: Int64): TDateTime; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IncMilliSecond&#039;&#039;&#039;(const AValue: TDateTime;const ANumberOfMilliSeconds: Int64): TDateTime; &lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== File Management Routines  ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Function&lt;br /&gt;
! Remarks&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideFileSize&#039;&#039;&#039;(const FileName: WideString): Int64; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideFileExists&#039;&#039;&#039;(const FileName: WideString): Boolean; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideDirectoryExists&#039;&#039;&#039;(const Directory: WideString): Boolean; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideForceDirectories&#039;&#039;&#039;(Dir: WideString): Boolean; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideCreateDir&#039;&#039;&#039;(const Dir: WideString): Boolean; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideDeleteFile&#039;&#039;&#039;(const FileName: WideString): Boolean; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideRenameFile&#039;&#039;&#039;(const OldName, NewName: WideString): Boolean; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideFileSearch&#039;&#039;&#039;(const Name, DirList: WideString): WideString; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideGetCurrentDir&#039;&#039;&#039;: WideString; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideSetCurrentDir&#039;&#039;&#039;(const Dir: WideString): Boolean; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;WideScanDirForFiles&#039;&#039;&#039;(Dir: WideString; var Files: TStringsArray;const Recursive, IncludeHidden, IncludeSystem: Boolean; const Mask: WideString); &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;WideScanDirForFolders&#039;&#039;&#039;(Dir: WideString; var Folders: TStringsArray;const Recursive, IncludeHidden, IncludeSystem: Boolean); &lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== File Name Utilities  ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;center&amp;quot; | &#039;&#039;&#039;Function&#039;&#039;&#039; &lt;br /&gt;
| &amp;lt;center&amp;gt;&#039;&#039;&#039;Remarks&#039;&#039;&#039;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideExtractFilePath&#039;&#039;&#039;(const FileName: WideString): WideString; &lt;br /&gt;
| Returns the entire path of the file &amp;lt;br&amp;gt;(starting from the drive letter)&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideExtractFileDir&#039;&#039;&#039;(const FileName: WideString): WideString; &lt;br /&gt;
| Returns the folder in which the file is located.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideExtractFileDrive&#039;&#039;&#039;(const FileName: WideString): WideString; &lt;br /&gt;
| Returns the drive letter&amp;lt;br&amp;gt;???or is it the name of the drive?&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideExtractFileName&#039;&#039;&#039;(const FileName: WideString): WideString; &lt;br /&gt;
| Returns the filename with extension. &amp;lt;br&amp;gt;(e.g. &amp;quot;FileName.txt&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideExtractBaseName&#039;&#039;&#039;(const FileName: WideString): WideString; &lt;br /&gt;
| Returns only the file&#039; base name (but not the dot or extension). (e.g. &amp;quot;FileName&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideExtractFileExt&#039;&#039;&#039;(const FileName: WideString): WideString; &lt;br /&gt;
| Returns the file&#039;s extension with the dot (e.g. &amp;quot;.txt&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideChangeFileExt&#039;&#039;&#039;(const FileName, Extension: WideString): WideString; &lt;br /&gt;
| Replaces the original extension, and returns the new filename with extension. (e.g. &amp;quot;FineName.txt&amp;quot; -&amp;amp;gt; &amp;quot;FineName.pdf&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideStripExtension&#039;&#039;&#039;(const FileName: WideString): WideString; &lt;br /&gt;
| Strips off the extension from the filename.&amp;lt;br&amp;gt;??? what does it return?&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideExpandFileName&#039;&#039;&#039;(const FileName: WideString): WideString; &lt;br /&gt;
| &amp;amp;nbsp;???&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideExtractRelativePath&#039;&#039;&#039;(const BaseName, DestName: WideString): WideString; &lt;br /&gt;
| &lt;br /&gt;
Given two files lacated in two different folders, returns the relative path of &#039;&#039;&#039;DestName&#039;&#039;&#039; file with respect to the &#039;&#039;&#039;BaseName&#039;&#039;&#039; file. &lt;br /&gt;
&lt;br /&gt;
e.g. If we input these two filenames: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;D:\Folder1\FileName1.txt&#039;&#039;&#039;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; (The base file)&amp;lt;br&amp;gt;&#039;&#039;&#039;D:\Folder2\Folder22\FileName2.pdf&#039;&#039;&#039;&amp;amp;nbsp;&amp;amp;nbsp; (The destination file) &lt;br /&gt;
&lt;br /&gt;
Then the relative path of the destination file is-&amp;lt;br&amp;gt;&#039;&#039;&#039;..\Folder2\Folder22\FileName2.pdf&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideExtractShortPathName&#039;&#039;&#039;(const FileName: WideString): WideString; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideIncludeTrailingPathDelimiter&#039;&#039;&#039;(const S: WideString): WideString; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideExcludeTrailingPathDelimiter&#039;&#039;&#039;(const S: WideString): WideString; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideSameFileName&#039;&#039;&#039;(const S1, S2: WideString): Boolean; &lt;br /&gt;
| Compares the filenames &#039;&#039;&#039;S1&#039;&#039;&#039; and &#039;&#039;&#039;S2&#039;&#039;&#039;, and returns TRUE if they are identical.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideGetEnvironmentVar&#039;&#039;&#039;(const VarName: WideString): WideString; &lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== File Read/Write Routines  ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Function&lt;br /&gt;
! Remarks&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;FileReadFragment&#039;&#039;&#039;(const FileName: WideString; Start, Length: Integer): String; &lt;br /&gt;
| Starting at position &#039;&#039;&#039;Start&#039;&#039;&#039;, read &#039;&#039;&#039;Length&#039;&#039;&#039; number of characters of the file &#039;&#039;&#039;FileName&#039;&#039;&#039; and return them as a string. &#039;&#039;&#039;Start&#039;&#039;&#039; is 0-based, so in order to start the fragment at the beginning of the file, set this parameter to 0 (zero).&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;FileReadLine&#039;&#039;&#039;(const FileName: WideString; LineNum: Integer): String; &lt;br /&gt;
| Read a line from a file &#039;&#039;&#039;FileName&#039;&#039;&#039; specified by a line index &#039;&#039;&#039;LineNum&#039;&#039;&#039;. &#039;&#039;&#039;LineNum&#039;&#039;&#039; is 1 based, so to get the first line set this parameter to 1 (one).&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;FileCountLines&#039;&#039;&#039;(const FileName: WideString): Integer; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;FileReadContent&#039;&#039;&#039;(const FileName: WideString): String; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;FileWriteContent&#039;&#039;&#039;(const FileName: WideString; const Content: String); &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;FileAppendContent&#039;&#039;&#039;(const FileName: WideString; const Content: String); &lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== File Properties Routines  ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;center&amp;quot; | &#039;&#039;&#039;Function&#039;&#039;&#039; &lt;br /&gt;
| &amp;lt;center&amp;gt;&#039;&#039;&#039;Remarks&#039;&#039;&#039;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;FileTimeModified&#039;&#039;&#039;(const FileName: WideString): TDateTime; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;FileTimeCreated&#039;&#039;&#039;(const FileName: WideString): TDateTime; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;SetFileTimeCreated&#039;&#039;&#039;(const FileName: WideString;const DateTime: TDateTime): Boolean; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;SetFileTimeModified&#039;&#039;&#039;(const FileName: WideString;const DateTime: TDateTime): Boolean; &lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== Process Execution Routines  ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;center&amp;quot; | &#039;&#039;&#039;Function&#039;&#039;&#039; &lt;br /&gt;
| &amp;lt;center&amp;gt;&#039;&#039;&#039;Remarks&#039;&#039;&#039;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;ShellOpenFile&#039;&#039;&#039;(const FileName: WideString): Boolean; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;ExecuteProgram&#039;&#039;&#039;(const Command: String; WaitForProgram: Boolean): Cardinal; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;ExecConsoleApp&#039;&#039;&#039;(const CommandLine: String; out Output: String): Cardinal; &lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== Interactive Dialogs  ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;center&amp;quot; | &#039;&#039;&#039;Function&#039;&#039;&#039; &lt;br /&gt;
| &amp;lt;center&amp;gt;&#039;&#039;&#039;Remarks&#039;&#039;&#039;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;ShowMessage&#039;&#039;&#039;(const Msg: String); &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;WideShowMessage&#039;&#039;&#039;(const Msg: WideString); &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;DialogYesNo&#039;&#039;&#039;(const Msg: String): Boolean; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideDialogYesNo&#039;&#039;&#039;(const Msg: WideString): Boolean; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;InputBox&#039;&#039;&#039;(const ACaption, APrompt, ADefault: String): String; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;InputQuery&#039;&#039;&#039;(const ACaption, APrompt: String; var Value: String): Boolean; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideInputBox&#039;&#039;&#039;(const ACaption, APrompt, ADefault: WideString): WideString; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideInputQuery&#039;&#039;&#039;(const ACaption, APrompt: WideString;var Value: WideString): Boolean; &lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== Other Routines  ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;center&amp;quot; | &#039;&#039;&#039;Function&#039;&#039;&#039; &lt;br /&gt;
| &amp;lt;center&amp;gt;&#039;&#039;&#039;Remarks&#039;&#039;&#039;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;Randomize&#039;&#039;&#039;(); &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;Sleep&#039;&#039;&#039;(Milliseconds: Cardinal); &lt;br /&gt;
| Sleeps (waits) for specified miliseconds&lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;DivMod&#039;&#039;&#039;(Dividend: Integer; Divisor: Word; var Result, Remainder: Word); &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;SetClipboardText&#039;&#039;&#039;(const S: WideString); &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;GetClipboardText&#039;&#039;&#039;: WideString; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;RandomRange&#039;&#039;&#039;(const AFrom, ATo: Integer): Integer; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;Base64Encode&#039;&#039;&#039;(const S: String): String; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;Base64Decode&#039;&#039;&#039;(const S: String): String; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;GetTickCount&#039;&#039;&#039;: Cardinal; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;SizeOf&#039;&#039;&#039;(X): Integer; &lt;br /&gt;
| &lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Prologician</name></author>
	</entry>
	<entry>
		<id>https://www.den4b.com/w/index.php?title=ReNamer:Pascal_Script:Functions&amp;diff=1075</id>
		<title>ReNamer:Pascal Script:Functions</title>
		<link rel="alternate" type="text/html" href="https://www.den4b.com/w/index.php?title=ReNamer:Pascal_Script:Functions&amp;diff=1075"/>
		<updated>2009-08-03T01:55:03Z</updated>

		<summary type="html">&lt;p&gt;Prologician: /* File Read/Write Routines */ Italic-bolding consistency, and a few grammar tweaks to FileReadFragment()&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction  ==&lt;br /&gt;
&lt;br /&gt;
ReNamer has many [http://www.taoyue.com/tutorials/pascal/pas4a.html procedures] and [http://www.taoyue.com/tutorials/pascal/pas4c.html functions] to manipulate the entities related to file names. These entities may be derived from the existing filename, path, system date, meta tags from the file, strings entered by the user, etc.&lt;br /&gt;
&lt;br /&gt;
A common prefix &#039;&#039;&#039;Wide&#039;&#039;&#039; in the function name indicates that the function deals with [http://en.wikipedia.org/wiki/Unicode Unicode] strings (WideString). The prefix is used because there are similar functions which deal with Ansi strings and in some cases simply for internal consistency. For example: &#039;&#039;&#039;ShowMessage&#039;&#039;&#039; and &#039;&#039;&#039;WideShowMessage&#039;&#039;&#039; procedures.&lt;br /&gt;
&lt;br /&gt;
*??? What is T prefix? &lt;br /&gt;
*??? What is UTF8?&lt;br /&gt;
&lt;br /&gt;
== Basic String Handling Routines  ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Routine&lt;br /&gt;
! Remarks&lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;Insert&#039;&#039;&#039;(Source: String; var S: String; Index: Integer); &lt;br /&gt;
| Inserts the string &#039;&#039;&#039;S&#039;&#039;&#039; into string &#039;&#039;&#039;Source&#039;&#039;&#039; at position &#039;&#039;&#039;Index&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;Delete&#039;&#039;&#039;(var S: String; Index, Count: Integer); &lt;br /&gt;
| Deletes &#039;&#039;&#039;Count&#039;&#039;&#039; characters from the string &#039;&#039;&#039;S&#039;&#039;&#039;, starting from position &#039;&#039;&#039;Index&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;Copy&#039;&#039;&#039;(S: String; Index, Count: Integer): String; &lt;br /&gt;
| Copies &#039;&#039;&#039;Count&#039;&#039;&#039; characters from string &#039;&#039;&#039;S&#039;&#039;&#039;, starting at position &#039;&#039;&#039;Index&#039;&#039;&#039;, and returns them as a new string.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;Pos&#039;&#039;&#039;(Substr: String; S: String): Integer; &lt;br /&gt;
| Returns the position of a string &#039;&#039;&#039;Substr&#039;&#039;&#039; in another string &#039;&#039;&#039;S&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Indexes of characters in strings are 1 based, so first character in string S would be S[1].&lt;br /&gt;
&lt;br /&gt;
== Length Managing Routines  ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Routine&lt;br /&gt;
! Remarks&lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;SetLength&#039;&#039;&#039;(var S: Array; NewLength: Integer); &lt;br /&gt;
| Sets the length of array variable &#039;&#039;&#039;S&#039;&#039;&#039; to &#039;&#039;&#039;NewLength&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;SetLength&#039;&#039;&#039;(var S: String; NewLength: Integer); &lt;br /&gt;
| Sets the length of string variable &#039;&#039;&#039;S&#039;&#039;&#039; to &#039;&#039;&#039;NewLength&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;SetLength&#039;&#039;&#039;(var S: WideString; NewLength: Integer); &lt;br /&gt;
| Sets the length of widestring &#039;&#039;&#039;S&#039;&#039;&#039; to &#039;&#039;&#039;NewLength&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;Length&#039;&#039;&#039;(const S: Array): Integer; &lt;br /&gt;
| Returns the length of array &#039;&#039;&#039;S &#039;&#039;&#039; (number of elements).&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;Length&#039;&#039;&#039;(const S: String): Integer; &lt;br /&gt;
| Returns the length of string &#039;&#039;&#039;S&#039;&#039;&#039; (number of characters).&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;Length&#039;&#039;&#039;(const S: WideString): Integer;&lt;br /&gt;
| Returns the length of WideString &#039;&#039;&#039;S&#039;&#039;&#039; (number of characters).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Unicode String Handling Routines ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Routine&lt;br /&gt;
! Remarks&lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;WideInsert&#039;&#039;&#039;(const Substr: WideString; var Dest: WideString; Index: Integer); &lt;br /&gt;
| Inserts &#039;&#039;&#039;Substr&#039;&#039;&#039; in &#039;&#039;&#039;Dest&#039;&#039;&#039; at position &#039;&#039;&#039;Index&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;WideDelete&#039;&#039;&#039;(var S: WideString; Index, Count: Integer); &lt;br /&gt;
| Deletes &#039;&#039;&#039;Count&#039;&#039;&#039; characters from &#039;&#039;&#039;S&#039;&#039;&#039;, starting from the &#039;&#039;&#039;Index&#039;&#039;&#039; position.&lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;WideSetLength&#039;&#039;&#039;(var S: WideString; NewLength: Integer); &lt;br /&gt;
| Change the length of string &#039;&#039;&#039;S&#039;&#039;&#039; to a new length specified by &#039;&#039;&#039;NewLength&#039;&#039;&#039;. If new length is smaller than original, the string is truncated. If new length is greater than original, the string will be expanded but additional characters will not be initialized and can be anything.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideLength&#039;&#039;&#039;(const S: WideString): Integer; &lt;br /&gt;
| Returns the length of WideString &#039;&#039;&#039;S&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideCopy&#039;&#039;&#039;(const S: WideString; Index, Count: Integer): WideString; &lt;br /&gt;
| Returns &#039;&#039;&#039;Count&#039;&#039;&#039; characters from WideString &#039;&#039;&#039;S&#039;&#039;&#039;, starting at position &#039;&#039;&#039;Index&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WidePos&#039;&#039;&#039;(const SubStr, S: WideString): Integer; &lt;br /&gt;
| Find and occurrence of &#039;&#039;&#039;SubStr&#039;&#039;&#039; in &#039;&#039;&#039;S&#039;&#039;&#039;. Returns the position of first occurrence, or &#039;&#039;&#039;0&#039;&#039;&#039; if nothing was found.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WidePosEx&#039;&#039;&#039;(const SubStr, S: WideString; Offset: Cardinal): Integer; &lt;br /&gt;
| Find and occurrence of &#039;&#039;&#039;SubStr&#039;&#039;&#039; in &#039;&#039;&#039;S&#039;&#039;&#039; but start searching from position specified by &#039;&#039;&#039;Offset&#039;&#039;&#039;. Returns the position of first occurrence, or &#039;&#039;&#039;0&#039;&#039;&#039; if nothing was found.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideUpperCase&#039;&#039;&#039;(const S: WideString): WideString; &lt;br /&gt;
| Returns the ALLCAPS version of the WideString &#039;&#039;&#039;S&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideLowerCase&#039;&#039;&#039;(const S: WideString): WideString; &lt;br /&gt;
| Returns the lowercase version of the WideString &#039;&#039;&#039;S&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideCompareStr&#039;&#039;&#039;(const S1, S2: WideString): Integer; &lt;br /&gt;
| Compares two WideStrings &#039;&#039;&#039;S1&#039;&#039;&#039; and &#039;&#039;&#039;S2&#039;&#039;&#039;, case-sensitive, and returns an integer based on the result. The return value is less than 0 if S1 is less than S2, 0 if S1 equals S2, or greater than 0 if S1 is greater than S2.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideCompareText&#039;&#039;&#039;(const S1, S2: WideString): Integer; &lt;br /&gt;
| Compares two WideStrings &#039;&#039;&#039;S1&#039;&#039;&#039; and &#039;&#039;&#039;S2&#039;&#039;&#039;, case-insensitive, and returns an integer based on the result. The return value is less than 0 if S1 is less than S2, 0 if S1 equals S2, or greater than 0 if S1 is greater than S2.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideSameText&#039;&#039;&#039;(const S1, S2: WideString): Boolean; &lt;br /&gt;
| Compares two WideStrings &#039;&#039;&#039;S1&#039;&#039;&#039; and &#039;&#039;&#039;S2&#039;&#039;&#039;. Returns TRUE if both are identical, otherwise returns FALSE.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideTextPos&#039;&#039;&#039;(const SubStr, S: WideString): Integer; &lt;br /&gt;
| Behaves like &#039;&#039;&#039;WidePos&#039;&#039;&#039; function, except text if processed in case-insensitive manner.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideTrim&#039;&#039;&#039;(const S: WideString): WideString; &lt;br /&gt;
| Removes leading and trailing spaces and control characters from the given string &#039;&#039;&#039;S&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideReplaceStr&#039;&#039;&#039;(const S, OldPattern, NewPattern: WideString): WideString; &lt;br /&gt;
| &amp;amp;nbsp;???&amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideReplaceText&#039;&#039;&#039;(const S, OldPattern, NewPattern: WideString): WideString; &lt;br /&gt;
| &amp;amp;nbsp;???&amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideSplitString&#039;&#039;&#039;(const Input, Delimiter: WideString): TStringsArray; &lt;br /&gt;
| &lt;br /&gt;
Splits the WideString &#039;&#039;&#039;Input &#039;&#039;&#039;wherever &#039;&#039;&#039;Delimiter&#039;&#039;&#039; occurs, and returns an array that contains the split parts. &lt;br /&gt;
&lt;br /&gt;
*The &#039;&#039;&#039;Delimiter&#039;&#039;&#039; itself can be a multi-character WideString. &amp;lt;br&amp;gt;(Unlike the usual comma, hyphen or space that is used for this purpose) &lt;br /&gt;
*The split parts (returned as elements of the array) do not contain the &#039;&#039;&#039;Delimiter&#039;&#039;&#039; WideString&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideCaseCapitalize&#039;&#039;&#039;(const S: WideString): WideString; &lt;br /&gt;
| &lt;br /&gt;
Returns the &#039;&#039;Sentence case&#039;&#039; version of the WideString &#039;&#039;&#039;S&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
Only the first alphabetic character is capitalized. All other alphabetic characters are converted to lowercase.&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*If &#039;&#039;&#039;S&#039;&#039;&#039; begins with numeric characters, the first alphabetic character that follows will be capitalized.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideCaseInvert&#039;&#039;&#039;(const S: WideString): WideString; &lt;br /&gt;
| Inverts the case of all characters in the WideString &#039;&#039;&#039;S&#039;&#039;&#039; and returns the WideString.&amp;lt;br&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Meta Tags Extraction  ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Function&lt;br /&gt;
! Remarks&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;CalculateMetaTag&#039;&#039;&#039;(const FilePath: WideString; const MetaTagName String): String; &lt;br /&gt;
| Extracts and returns the value of a metatag specified by &#039;&#039;&#039;MetaTagName&#039;&#039;&#039; from the file specified by the complete absolute path &#039;&#039;&#039;FilePath&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For example, to extract &#039;&#039;&#039;EXIF_Date&#039;&#039;&#039; tag from an image and set it to the filename, one can use something like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
begin&lt;br /&gt;
  FileName := CalculateMetaTag(FilePath, &#039;EXIF_Date&#039;);&lt;br /&gt;
end.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The full list of meta tags can be found in [[ReNamer:Meta Tags|Meta Tags]] article.&lt;br /&gt;
&lt;br /&gt;
== Regular Expressions  ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Function&lt;br /&gt;
! Remarks&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;ReplaceRegEx&#039;&#039;&#039;(const Input, Find, Replace: WideString;const CaseSensitive, UseSubstitution: Boolean): WideString; &lt;br /&gt;
| Find-and-replace function using RegEx. Works like [[ReNamer:Rules:RegEx|RegEx rule]].&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;MatchesRegEx&#039;&#039;&#039;(const Input, Find: WideString;const CaseSensitive: Boolean): TStringsArray; &lt;br /&gt;
| Returns a list of RegEx matches as an array. Function returns an array of full matches, which matched the entire expression, not the sub-patterns.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;SubMatchesRegEx&#039;&#039;&#039;(const Input, Find: WideString;const CaseSensitive: Boolean): TStringsArray; &lt;br /&gt;
| This function is very similar to &#039;&#039;&#039;MatchesRegEx&#039;&#039;&#039;, but instead of returning full expression matches it will return an array of sub-expression matches for the first full expression match. For example, &#039;&#039;&#039;SubMatchesRegEx(&#039;one two three&#039;, &#039;(.*) (.*) (.*)&#039;)&#039;&#039;&#039; will return an array &#039;&#039;&#039;[&#039;one&#039;, &#039;two&#039;, &#039;three&#039;]&#039;&#039;&#039;. In this way, it can easily be combined with &#039;&#039;&#039;MatchesRegEx&#039;&#039;&#039; function, to allow users to find all global matches, and then parse those matches through &#039;&#039;&#039;SubMatchesRegEx&#039;&#039;&#039; function to find individual sub-expression matches of each global match.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
General parameters of the functions: &lt;br /&gt;
&lt;br /&gt;
* Input - The WideString that is input to the function. &lt;br /&gt;
* Find - RegEx pattern to be found (same as &#039;&#039;&#039;Expression&#039;&#039;&#039; field in the [[ReNamer:Rules:RegEx|RegEx rule]]).&lt;br /&gt;
* Replace - Replacement string (same as the &#039;&#039;&#039;Replace&#039;&#039;&#039; field in the [[ReNamer:Rules:RegEx|RegEx rule]]).&lt;br /&gt;
* CaseSensitive - Specifies whether to process in a case-sensitive mode.&lt;br /&gt;
* UseSubstitution - Determines whether use [[ReNamer:Regular Expressions#Backreferences|backreferences]] in the result.&lt;br /&gt;
&lt;br /&gt;
== Unicode Character Handling Routines  ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Function&lt;br /&gt;
! Remarks&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IsWideCharUpper&#039;&#039;&#039;(WC: WideChar): Boolean; &lt;br /&gt;
| Checks a Unicode character &#039;&#039;&#039;WC&#039;&#039;&#039; and returns TRUE if it is in UPPERCASE.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IsWideCharLower&#039;&#039;&#039;(WC: WideChar): Boolean; &lt;br /&gt;
| Checks a Unicode character &#039;&#039;&#039;WC&#039;&#039;&#039; and returns TRUE if it is in lowercase.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IsWideCharDigit&#039;&#039;&#039;(WC: WideChar): Boolean; &lt;br /&gt;
| Checks a Unicode character &#039;&#039;&#039;WC&#039;&#039;&#039; and returns TRUE if it is a digit (numeric character 0-9). &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IsWideCharSpace&#039;&#039;&#039;(WC: WideChar): Boolean; &lt;br /&gt;
| Checks a Unicode character &#039;&#039;&#039;WC&#039;&#039;&#039; and returns TRUE if it is a white-space character, such as: space, form-feed, newline, carriage-return, tab and vertical-tab (characters classified as C1_SPACE).&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IsWideCharPunct&#039;&#039;&#039;(WC: WideChar): Boolean; &lt;br /&gt;
| Checks a Unicode character &#039;&#039;&#039;WC&#039;&#039;&#039; and returns TRUE if it is a punctuation mark (characters classified as C1_PUNCT).&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IsWideCharCntrl&#039;&#039;&#039;(WC: WideChar): Boolean; &lt;br /&gt;
| Checks a Unicode character &#039;&#039;&#039;WC&#039;&#039;&#039; and returns TRUE if it is a control character (characters classified as C1_CNTRL).&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IsWideCharBlank&#039;&#039;&#039;(WC: WideChar): Boolean; &lt;br /&gt;
| Checks a Unicode character &#039;&#039;&#039;WC&#039;&#039;&#039; and returns TRUE if it is a blank, such as: space and tab (characters classified as C1_BLANK).&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IsWideCharXDigit&#039;&#039;&#039;(WC: WideChar): Boolean; &lt;br /&gt;
| Checks a Unicode character &#039;&#039;&#039;WC&#039;&#039;&#039; and returns TRUE if it is a hexadecimal digit (0-9 or A-F).&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IsWideCharAlpha&#039;&#039;&#039;(WC: WideChar): Boolean; &lt;br /&gt;
| Checks a Unicode character &#039;&#039;&#039;WC&#039;&#039;&#039; and returns TRUE if it is a alphanumeric character (a-z or A-Z).&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IsWideCharAlphaNumeric&#039;&#039;&#039;(WC: WideChar): Boolean; &lt;br /&gt;
| Checks a Unicode character &#039;&#039;&#039;WC&#039;&#039;&#039; and returns TRUE if it is a alphanumeric character or a numeric character (a-z, A-Z or 0-9).&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideCharUpper&#039;&#039;&#039;(const WC: WideChar): WideChar; &lt;br /&gt;
| Returns a UPPERCASE version of the input Unicode character. In case of non-alphabetic character, it returns the same character.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideCharLower&#039;&#039;&#039;(const WC: WideChar): WideChar; &lt;br /&gt;
| Returns a lowercase version of the input Unicode character. In case of non-alphabetic character, it returns the same character.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Character classifications, such as C1_UPPER, C1_LOWER, C1_DIGIT, C1_SPACE, C1_PUNCT, C1_CNTRL, C1_BLANK, C1_XDIGIT, C1_ALPHA - are part of Unicode definitions. More information regarding classification can be found on the internet. For example: [http://www.fileformat.info/info/unicode/ http://www.fileformat.info/info/unicode/].&lt;br /&gt;
&lt;br /&gt;
== Unicode Conversion Routines  ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Function&lt;br /&gt;
! Remarks&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideToAnsi&#039;&#039;&#039;(const WS: WideString): String; &lt;br /&gt;
| Converts a Unicode string to its ANSI version.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;AnsiToWide&#039;&#039;&#039;(const S: String): WideString; &lt;br /&gt;
| Converts a ANSI string to its Unicode version.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;UTF8Encode&#039;&#039;&#039;(const WS: WideString): String; &lt;br /&gt;
| Convert Unicode string to the UTF-8 encoded string. Useful to storing Unicode strings in files.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;UTF8Decode&#039;&#039;&#039;(const S: String): WideString;&lt;br /&gt;
| Convert UTF-8 encoded string to its full Unicode representation.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Basic Conversion Routines  ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Function&lt;br /&gt;
! Remarks&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IntToStr&#039;&#039;&#039;(Value: Integer): String; &lt;br /&gt;
| Converts an integer to a string. The following assumptions are correct:&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-family: monospace&amp;quot;&amp;gt;&lt;br /&gt;
* IntToStr(123) = &#039;123&#039;&lt;br /&gt;
* IntToStr(0123) = &#039;123&#039;&lt;br /&gt;
* IntToStr(123) &amp;lt;&amp;gt; &#039;0123&#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;StrToInt&#039;&#039;&#039;(const S: String): Integer; &lt;br /&gt;
| Converts a string to an integer. The following equality is correct:&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-family: monospace&amp;quot;&amp;gt;&lt;br /&gt;
* StrToInt(&#039;123&#039;) = 123&lt;br /&gt;
* StrToInt(&#039;123&#039;) = 0123&lt;br /&gt;
* StrToInt(&#039;0123&#039;) = 123&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Warning:&#039;&#039;&#039; An error will occur if the parameter to this function cannot be converted to an integer!&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;StrToIntDef&#039;&#039;&#039;(const S: String; const Default: Integer): Integer; &lt;br /&gt;
| Behaves like &#039;&#039;&#039;StrToInt&#039;&#039;&#039; function, but instead of producing an error on incorrect input function allows the &#039;&#039;&#039;Default&#039;&#039;&#039; value to be specified, which will be returned if the input cannot be converted to an integer.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;DateToStr&#039;&#039;&#039;(D: TDateTime): String; &lt;br /&gt;
| Converts a date to a string, using system format for the short date, for example: &#039;&#039;&#039;dd/mm/yyyy&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;StrToDate&#039;&#039;&#039;(const S: String): TDateTime; &lt;br /&gt;
| Converts a date string to a proper TDateTime value, using system format for the short date, for example: &#039;&#039;&#039;dd/mm/yyyy&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IntToHex&#039;&#039;&#039;(Value: Integer; Digits: Integer): String; &lt;br /&gt;
| Converts an integer to its hexadecimal representation. Here are samples:&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-family: monospace&amp;quot;&amp;gt;&lt;br /&gt;
* IntToHex(1234, 1) = &#039;4D2&#039;&lt;br /&gt;
* IntToHex(1234, 8) = &#039;000004D2&#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;HexToInt&#039;&#039;&#039;(const HexNum: String): Integer; &lt;br /&gt;
| Converts a hexadecimal value to its decimal representation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning:&#039;&#039;&#039; An error will occur if the parameter to this function cannot be converted to an integer!&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;HexToIntDef&#039;&#039;&#039;(const HexNum: String; Default: Integer): Integer; &lt;br /&gt;
| Behaves like &#039;&#039;&#039;HexToInt&#039;&#039;&#039; function, but instead of producing an error on incorrect input function allows the &#039;&#039;&#039;Default&#039;&#039;&#039; value to be specified, which will be returned if the input cannot be converted to an integer.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;Ord&#039;&#039;&#039;(X: Char): Byte; &lt;br /&gt;
| Return an ordinal value (byte representation) of a character.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;Chr&#039;&#039;&#039;(X: Byte): Char; &lt;br /&gt;
| Return a character by its ordinal value (byte representation).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Date And Time Routines ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Function&lt;br /&gt;
! Remarks&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;Date&#039;&#039;&#039;: TDateTime; &lt;br /&gt;
| Returns the current system date.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;Time&#039;&#039;&#039;: TDateTime; &lt;br /&gt;
| Returns the current system time.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;Now&#039;&#039;&#039;: TDateTime; &lt;br /&gt;
| Returns the current system date and time.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;EncodeDate&#039;&#039;&#039;(Year, Month, Day: Word): TDateTime; &lt;br /&gt;
| Generates date value for the specified &#039;&#039;&#039;Year&#039;&#039;&#039;, &#039;&#039;&#039;Month&#039;&#039;&#039;, &#039;&#039;&#039;Day&#039;&#039;&#039;. Parameters must be within a valid date range: Year = 0..9999, Month = 1..12, Day = 1..31 (depending on month/year). An error will be raised if parameters are invalid.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;EncodeTime&#039;&#039;&#039;(Hour, Min, Sec, MSec: Word): TDateTime; &lt;br /&gt;
| Generates time value for the specified &#039;&#039;&#039;Hour&#039;&#039;&#039;, &#039;&#039;&#039;Min&#039;&#039;&#039;, &#039;&#039;&#039;Sec&#039;&#039;&#039;, &#039;&#039;&#039;MSec&#039;&#039;&#039;. Parameters must be within a valid time range: Hour = 0..23, Min = 0..59, Sec = 0..59, MSec = 0..999. An error will be raised if parameters are invalid.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;TryEncodeDate&#039;&#039;&#039;(Year, Month, Day: Word; var Date: TDateTime): Boolean; &lt;br /&gt;
| Behaves exactly like &#039;&#039;&#039;EncodeDate&#039;&#039;&#039; function, except this function returns the TRUE or FALSE depending on the success of the operation. If operation was successful, function will return TRUE and the generated date value will be written in the &#039;&#039;&#039;Date&#039;&#039;&#039; variable.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;TryEncodeTime&#039;&#039;&#039;(Hour, Min, Sec, MSec: Word; var Time: TDateTime): Boolean; &lt;br /&gt;
| Behaves exactly like &#039;&#039;&#039;EncodeTime&#039;&#039;&#039; function, except this function returns the TRUE or FALSE depending on the success of the operation. If operation was successful, function will return TRUE and the generated time value will be written in the &#039;&#039;&#039;Time&#039;&#039;&#039; variable.&lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;DecodeDate&#039;&#039;&#039;(const DateTime: TDateTime; var Year, Month, Day: Word); &lt;br /&gt;
| Extracts &#039;&#039;&#039;Year&#039;&#039;&#039;, &#039;&#039;&#039;Month&#039;&#039;&#039; and &#039;&#039;&#039;Day&#039;&#039;&#039; components from a given &#039;&#039;&#039;DateTime&#039;&#039;&#039; value.&lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;DecodeTime&#039;&#039;&#039;(const DateTime: TDateTime; var Hour, Min, Sec, MSec: Word); &lt;br /&gt;
| Extracts &#039;&#039;&#039;Hour&#039;&#039;&#039;, &#039;&#039;&#039;Min&#039;&#039;&#039;, &#039;&#039;&#039;Sec&#039;&#039;&#039; and &#039;&#039;&#039;MSec&#039;&#039;&#039; components from a given &#039;&#039;&#039;DateTime&#039;&#039;&#039; value.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;DayOfWeek&#039;&#039;&#039;(const DateTime: TDateTime): Word; &lt;br /&gt;
| Returns the day of the week (as an index) for the specified &#039;&#039;&#039;DateTime&#039;&#039;&#039; value. The indexes are: 1 = Sunday, 2 = Monday, 3 = Tuesday, 4 = Wednesday, 5 = Thursday, 6 = Friday, 7 = Saturday.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;DateTimeToUnix&#039;&#039;&#039;(D: TDateTime): Int64;&lt;br /&gt;
| Converts &#039;&#039;&#039;D&#039;&#039;&#039; value of type &#039;&#039;&#039;TDateTime&#039;&#039;&#039; to a Unix timestamp.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;UnixToDateTime&#039;&#039;&#039;(U: Int64): TDateTime; &lt;br /&gt;
| Converts a Unix timestamp to a value of &#039;&#039;&#039;TDateTime&#039;&#039;&#039; type.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;FormatDateTime&#039;&#039;&#039;(const Fmt: String; D: TDateTime): String; &lt;br /&gt;
| This function provides rich formatting of a &#039;&#039;&#039;DateTime&#039;&#039;&#039; value into a string. [[ReNamer:Date and Time format|Date and time format]] is defined by the &#039;&#039;&#039;Fmt&#039;&#039;&#039; string. &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IncYear&#039;&#039;&#039;(const AValue: TDateTime;const ANumberOfYears: Integer): TDateTime; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IncMonth&#039;&#039;&#039;(const AValue: TDateTime;ANumberOfMonths: Integer): TDateTime; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IncWeek&#039;&#039;&#039;(const AValue: TDateTime; const ANumberOfWeeks: Integer): TDateTime; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IncDay&#039;&#039;&#039;(const AValue: TDateTime;const ANumberOfDays: Integer): TDateTime; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IncHour&#039;&#039;&#039;(const AValue: TDateTime;const ANumberOfHours: Int64): TDateTime; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IncMinute&#039;&#039;&#039;(const AValue: TDateTime;const ANumberOfMinutes: Int64): TDateTime; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IncSecond&#039;&#039;&#039;(const AValue: TDateTime;const ANumberOfSeconds: Int64): TDateTime; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IncMilliSecond&#039;&#039;&#039;(const AValue: TDateTime;const ANumberOfMilliSeconds: Int64): TDateTime; &lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== File Management Routines  ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Function&lt;br /&gt;
! Remarks&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideFileSize&#039;&#039;&#039;(const FileName: WideString): Int64; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideFileExists&#039;&#039;&#039;(const FileName: WideString): Boolean; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideDirectoryExists&#039;&#039;&#039;(const Directory: WideString): Boolean; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideForceDirectories&#039;&#039;&#039;(Dir: WideString): Boolean; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideCreateDir&#039;&#039;&#039;(const Dir: WideString): Boolean; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideDeleteFile&#039;&#039;&#039;(const FileName: WideString): Boolean; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideRenameFile&#039;&#039;&#039;(const OldName, NewName: WideString): Boolean; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideFileSearch&#039;&#039;&#039;(const Name, DirList: WideString): WideString; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideGetCurrentDir&#039;&#039;&#039;: WideString; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideSetCurrentDir&#039;&#039;&#039;(const Dir: WideString): Boolean; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;WideScanDirForFiles&#039;&#039;&#039;(Dir: WideString; var Files: TStringsArray;const Recursive, IncludeHidden, IncludeSystem: Boolean; const Mask: WideString); &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;WideScanDirForFolders&#039;&#039;&#039;(Dir: WideString; var Folders: TStringsArray;const Recursive, IncludeHidden, IncludeSystem: Boolean); &lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== File Name Utilities  ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;center&amp;quot; | &#039;&#039;&#039;Function&#039;&#039;&#039; &lt;br /&gt;
| &amp;lt;center&amp;gt;&#039;&#039;&#039;Remarks&#039;&#039;&#039;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideExtractFilePath&#039;&#039;&#039;(const FileName: WideString): WideString; &lt;br /&gt;
| Returns the entire path of the file &amp;lt;br&amp;gt;(starting from the drive letter)&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideExtractFileDir&#039;&#039;&#039;(const FileName: WideString): WideString; &lt;br /&gt;
| Returns the folder in which the file is located.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideExtractFileDrive&#039;&#039;&#039;(const FileName: WideString): WideString; &lt;br /&gt;
| Returns the drive letter&amp;lt;br&amp;gt;???or is it the name of the drive?&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideExtractFileName&#039;&#039;&#039;(const FileName: WideString): WideString; &lt;br /&gt;
| Returns the filename with extension. &amp;lt;br&amp;gt;(e.g. &amp;quot;FileName.txt&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideExtractBaseName&#039;&#039;&#039;(const FileName: WideString): WideString; &lt;br /&gt;
| Returns only the file&#039; base name (but not the dot or extension). (e.g. &amp;quot;FileName&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideExtractFileExt&#039;&#039;&#039;(const FileName: WideString): WideString; &lt;br /&gt;
| Returns the file&#039;s extension with the dot (e.g. &amp;quot;.txt&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideChangeFileExt&#039;&#039;&#039;(const FileName, Extension: WideString): WideString; &lt;br /&gt;
| Replaces the original extension, and returns the new filename with extension. (e.g. &amp;quot;FineName.txt&amp;quot; -&amp;amp;gt; &amp;quot;FineName.pdf&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideStripExtension&#039;&#039;&#039;(const FileName: WideString): WideString; &lt;br /&gt;
| Strips off the extension from the filename.&amp;lt;br&amp;gt;??? what does it return?&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideExpandFileName&#039;&#039;&#039;(const FileName: WideString): WideString; &lt;br /&gt;
| &amp;amp;nbsp;???&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideExtractRelativePath&#039;&#039;&#039;(const BaseName, DestName: WideString): WideString; &lt;br /&gt;
| &lt;br /&gt;
Given two files lacated in two different folders, returns the relative path of &#039;&#039;&#039;DestName&#039;&#039;&#039; file with respect to the &#039;&#039;&#039;BaseName&#039;&#039;&#039; file. &lt;br /&gt;
&lt;br /&gt;
e.g. If we input these two filenames: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;D:\Folder1\FileName1.txt&#039;&#039;&#039;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; (The base file)&amp;lt;br&amp;gt;&#039;&#039;&#039;D:\Folder2\Folder22\FileName2.pdf&#039;&#039;&#039;&amp;amp;nbsp;&amp;amp;nbsp; (The destination file) &lt;br /&gt;
&lt;br /&gt;
Then the relative path of the destination file is-&amp;lt;br&amp;gt;&#039;&#039;&#039;..\Folder2\Folder22\FileName2.pdf&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideExtractShortPathName&#039;&#039;&#039;(const FileName: WideString): WideString; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideIncludeTrailingPathDelimiter&#039;&#039;&#039;(const S: WideString): WideString; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideExcludeTrailingPathDelimiter&#039;&#039;&#039;(const S: WideString): WideString; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideSameFileName&#039;&#039;&#039;(const S1, S2: WideString): Boolean; &lt;br /&gt;
| Compares the filenames &#039;&#039;&#039;S1&#039;&#039;&#039; and &#039;&#039;&#039;S2&#039;&#039;&#039;, and returns TRUE if they are identical.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideGetEnvironmentVar&#039;&#039;&#039;(const VarName: WideString): WideString; &lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== File Read/Write Routines  ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Function&lt;br /&gt;
! Remarks&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;FileReadFragment&#039;&#039;&#039;(const FileName: WideString; Start, Length: Integer): String; &lt;br /&gt;
| Starting at position &#039;&#039;&#039;Start&#039;&#039;&#039;, read &#039;&#039;&#039;Length&#039;&#039;&#039; number of characters of the file &#039;&#039;&#039;FileName&#039;&#039;&#039; and return them as a string. &#039;&#039;&#039;Start&#039;&#039;&#039; is 0-based, so in order to start the fragment at the beginning of the file, set this parameter to 0 (zero).&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;FileReadLine&#039;&#039;&#039;(const FileName: WideString; LineNum: Integer): String; &lt;br /&gt;
| Read a line from a file &#039;&#039;&#039;FileName&#039;&#039;&#039; specified by a line index &#039;&#039;&#039;LineNum&#039;&#039;&#039;. &#039;&#039;&#039;LineNum&#039;&#039;&#039; is 1 based, so to get the first line set this parameter to 1 (one).&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;FileCountLines&#039;&#039;&#039;(const FileName: WideString): Integer; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;FileReadContent&#039;&#039;&#039;(const FileName: WideString): String; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;FileWriteContent&#039;&#039;&#039;(const FileName: WideString; const Content: String); &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;FileAppendContent&#039;&#039;&#039;(const FileName: WideString; const Content: String); &lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== File Properties Routines  ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;center&amp;quot; | &#039;&#039;&#039;Function&#039;&#039;&#039; &lt;br /&gt;
| &amp;lt;center&amp;gt;&#039;&#039;&#039;Remarks&#039;&#039;&#039;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;FileTimeModified&#039;&#039;&#039;(const FileName: WideString): TDateTime; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;FileTimeCreated&#039;&#039;&#039;(const FileName: WideString): TDateTime; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;SetFileTimeCreated&#039;&#039;&#039;(const FileName: WideString;const DateTime: TDateTime): Boolean; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;SetFileTimeModified&#039;&#039;&#039;(const FileName: WideString;const DateTime: TDateTime): Boolean; &lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== Process Execution Routines  ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;center&amp;quot; | &#039;&#039;&#039;Function&#039;&#039;&#039; &lt;br /&gt;
| &amp;lt;center&amp;gt;&#039;&#039;&#039;Remarks&#039;&#039;&#039;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;ShellOpenFile&#039;&#039;&#039;(const FileName: WideString): Boolean; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;ExecuteProgram&#039;&#039;&#039;(const Command: String; WaitForProgram: Boolean): Cardinal; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;ExecConsoleApp&#039;&#039;&#039;(const CommandLine: String; out Output: String): Cardinal; &lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== Interactive Dialogs  ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;center&amp;quot; | &#039;&#039;&#039;Function&#039;&#039;&#039; &lt;br /&gt;
| &amp;lt;center&amp;gt;&#039;&#039;&#039;Remarks&#039;&#039;&#039;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;ShowMessage&#039;&#039;&#039;(const Msg: String); &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;WideShowMessage&#039;&#039;&#039;(const Msg: WideString); &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;DialogYesNo&#039;&#039;&#039;(const Msg: String): Boolean; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideDialogYesNo&#039;&#039;&#039;(const Msg: WideString): Boolean; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;InputBox&#039;&#039;&#039;(const ACaption, APrompt, ADefault: String): String; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;InputQuery&#039;&#039;&#039;(const ACaption, APrompt: String; var Value: String): Boolean; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideInputBox&#039;&#039;&#039;(const ACaption, APrompt, ADefault: WideString): WideString; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideInputQuery&#039;&#039;&#039;(const ACaption, APrompt: WideString;var Value: WideString): Boolean; &lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== Other Routines  ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;center&amp;quot; | &#039;&#039;&#039;Function&#039;&#039;&#039; &lt;br /&gt;
| &amp;lt;center&amp;gt;&#039;&#039;&#039;Remarks&#039;&#039;&#039;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;Randomize&#039;&#039;&#039;(); &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;Sleep&#039;&#039;&#039;(Milliseconds: Cardinal); &lt;br /&gt;
| Sleeps (waits) for specified miliseconds&lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;DivMod&#039;&#039;&#039;(Dividend: Integer; Divisor: Word; var Result, Remainder: Word); &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;SetClipboardText&#039;&#039;&#039;(const S: WideString); &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;GetClipboardText&#039;&#039;&#039;: WideString; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;RandomRange&#039;&#039;&#039;(const AFrom, ATo: Integer): Integer; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;Base64Encode&#039;&#039;&#039;(const S: String): String; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;Base64Decode&#039;&#039;&#039;(const S: String): String; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;GetTickCount&#039;&#039;&#039;: Cardinal; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;SizeOf&#039;&#039;&#039;(X): Integer; &lt;br /&gt;
| &lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Prologician</name></author>
	</entry>
	<entry>
		<id>https://www.den4b.com/w/index.php?title=ReNamer:Pascal_Script:Functions&amp;diff=1074</id>
		<title>ReNamer:Pascal Script:Functions</title>
		<link rel="alternate" type="text/html" href="https://www.den4b.com/w/index.php?title=ReNamer:Pascal_Script:Functions&amp;diff=1074"/>
		<updated>2009-08-03T01:48:01Z</updated>

		<summary type="html">&lt;p&gt;Prologician: /* File Name Utilities */ Corrected a typo in WideExtractBaseName(), fixed the example for WideExtractFileExt() (it adds the period)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction  ==&lt;br /&gt;
&lt;br /&gt;
ReNamer has many [http://www.taoyue.com/tutorials/pascal/pas4a.html procedures] and [http://www.taoyue.com/tutorials/pascal/pas4c.html functions] to manipulate the entities related to file names. These entities may be derived from the existing filename, path, system date, meta tags from the file, strings entered by the user, etc.&lt;br /&gt;
&lt;br /&gt;
A common prefix &#039;&#039;&#039;Wide&#039;&#039;&#039; in the function name indicates that the function deals with [http://en.wikipedia.org/wiki/Unicode Unicode] strings (WideString). The prefix is used because there are similar functions which deal with Ansi strings and in some cases simply for internal consistency. For example: &#039;&#039;&#039;ShowMessage&#039;&#039;&#039; and &#039;&#039;&#039;WideShowMessage&#039;&#039;&#039; procedures.&lt;br /&gt;
&lt;br /&gt;
*??? What is T prefix? &lt;br /&gt;
*??? What is UTF8?&lt;br /&gt;
&lt;br /&gt;
== Basic String Handling Routines  ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Routine&lt;br /&gt;
! Remarks&lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;Insert&#039;&#039;&#039;(Source: String; var S: String; Index: Integer); &lt;br /&gt;
| Inserts the string &#039;&#039;&#039;S&#039;&#039;&#039; into string &#039;&#039;&#039;Source&#039;&#039;&#039; at position &#039;&#039;&#039;Index&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;Delete&#039;&#039;&#039;(var S: String; Index, Count: Integer); &lt;br /&gt;
| Deletes &#039;&#039;&#039;Count&#039;&#039;&#039; characters from the string &#039;&#039;&#039;S&#039;&#039;&#039;, starting from position &#039;&#039;&#039;Index&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;Copy&#039;&#039;&#039;(S: String; Index, Count: Integer): String; &lt;br /&gt;
| Copies &#039;&#039;&#039;Count&#039;&#039;&#039; characters from string &#039;&#039;&#039;S&#039;&#039;&#039;, starting at position &#039;&#039;&#039;Index&#039;&#039;&#039;, and returns them as a new string.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;Pos&#039;&#039;&#039;(Substr: String; S: String): Integer; &lt;br /&gt;
| Returns the position of a string &#039;&#039;&#039;Substr&#039;&#039;&#039; in another string &#039;&#039;&#039;S&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Indexes of characters in strings are 1 based, so first character in string S would be S[1].&lt;br /&gt;
&lt;br /&gt;
== Length Managing Routines  ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Routine&lt;br /&gt;
! Remarks&lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;SetLength&#039;&#039;&#039;(var S: Array; NewLength: Integer); &lt;br /&gt;
| Sets the length of array variable &#039;&#039;&#039;S&#039;&#039;&#039; to &#039;&#039;&#039;NewLength&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;SetLength&#039;&#039;&#039;(var S: String; NewLength: Integer); &lt;br /&gt;
| Sets the length of string variable &#039;&#039;&#039;S&#039;&#039;&#039; to &#039;&#039;&#039;NewLength&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;SetLength&#039;&#039;&#039;(var S: WideString; NewLength: Integer); &lt;br /&gt;
| Sets the length of widestring &#039;&#039;&#039;S&#039;&#039;&#039; to &#039;&#039;&#039;NewLength&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;Length&#039;&#039;&#039;(const S: Array): Integer; &lt;br /&gt;
| Returns the length of array &#039;&#039;&#039;S &#039;&#039;&#039; (number of elements).&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;Length&#039;&#039;&#039;(const S: String): Integer; &lt;br /&gt;
| Returns the length of string &#039;&#039;&#039;S&#039;&#039;&#039; (number of characters).&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;Length&#039;&#039;&#039;(const S: WideString): Integer;&lt;br /&gt;
| Returns the length of WideString &#039;&#039;&#039;S&#039;&#039;&#039; (number of characters).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Unicode String Handling Routines ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Routine&lt;br /&gt;
! Remarks&lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;WideInsert&#039;&#039;&#039;(const Substr: WideString; var Dest: WideString; Index: Integer); &lt;br /&gt;
| Inserts &#039;&#039;&#039;Substr&#039;&#039;&#039; in &#039;&#039;&#039;Dest&#039;&#039;&#039; at position &#039;&#039;&#039;Index&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;WideDelete&#039;&#039;&#039;(var S: WideString; Index, Count: Integer); &lt;br /&gt;
| Deletes &#039;&#039;&#039;Count&#039;&#039;&#039; characters from &#039;&#039;&#039;S&#039;&#039;&#039;, starting from the &#039;&#039;&#039;Index&#039;&#039;&#039; position.&lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;WideSetLength&#039;&#039;&#039;(var S: WideString; NewLength: Integer); &lt;br /&gt;
| Change the length of string &#039;&#039;&#039;S&#039;&#039;&#039; to a new length specified by &#039;&#039;&#039;NewLength&#039;&#039;&#039;. If new length is smaller than original, the string is truncated. If new length is greater than original, the string will be expanded but additional characters will not be initialized and can be anything.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideLength&#039;&#039;&#039;(const S: WideString): Integer; &lt;br /&gt;
| Returns the length of WideString &#039;&#039;&#039;S&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideCopy&#039;&#039;&#039;(const S: WideString; Index, Count: Integer): WideString; &lt;br /&gt;
| Returns &#039;&#039;&#039;Count&#039;&#039;&#039; characters from WideString &#039;&#039;&#039;S&#039;&#039;&#039;, starting at position &#039;&#039;&#039;Index&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WidePos&#039;&#039;&#039;(const SubStr, S: WideString): Integer; &lt;br /&gt;
| Find and occurrence of &#039;&#039;&#039;SubStr&#039;&#039;&#039; in &#039;&#039;&#039;S&#039;&#039;&#039;. Returns the position of first occurrence, or &#039;&#039;&#039;0&#039;&#039;&#039; if nothing was found.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WidePosEx&#039;&#039;&#039;(const SubStr, S: WideString; Offset: Cardinal): Integer; &lt;br /&gt;
| Find and occurrence of &#039;&#039;&#039;SubStr&#039;&#039;&#039; in &#039;&#039;&#039;S&#039;&#039;&#039; but start searching from position specified by &#039;&#039;&#039;Offset&#039;&#039;&#039;. Returns the position of first occurrence, or &#039;&#039;&#039;0&#039;&#039;&#039; if nothing was found.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideUpperCase&#039;&#039;&#039;(const S: WideString): WideString; &lt;br /&gt;
| Returns the ALLCAPS version of the WideString &#039;&#039;&#039;S&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideLowerCase&#039;&#039;&#039;(const S: WideString): WideString; &lt;br /&gt;
| Returns the lowercase version of the WideString &#039;&#039;&#039;S&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideCompareStr&#039;&#039;&#039;(const S1, S2: WideString): Integer; &lt;br /&gt;
| Compares two WideStrings &#039;&#039;&#039;S1&#039;&#039;&#039; and &#039;&#039;&#039;S2&#039;&#039;&#039;, case-sensitive, and returns an integer based on the result. The return value is less than 0 if S1 is less than S2, 0 if S1 equals S2, or greater than 0 if S1 is greater than S2.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideCompareText&#039;&#039;&#039;(const S1, S2: WideString): Integer; &lt;br /&gt;
| Compares two WideStrings &#039;&#039;&#039;S1&#039;&#039;&#039; and &#039;&#039;&#039;S2&#039;&#039;&#039;, case-insensitive, and returns an integer based on the result. The return value is less than 0 if S1 is less than S2, 0 if S1 equals S2, or greater than 0 if S1 is greater than S2.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideSameText&#039;&#039;&#039;(const S1, S2: WideString): Boolean; &lt;br /&gt;
| Compares two WideStrings &#039;&#039;&#039;S1&#039;&#039;&#039; and &#039;&#039;&#039;S2&#039;&#039;&#039;. Returns TRUE if both are identical, otherwise returns FALSE.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideTextPos&#039;&#039;&#039;(const SubStr, S: WideString): Integer; &lt;br /&gt;
| Behaves like &#039;&#039;&#039;WidePos&#039;&#039;&#039; function, except text if processed in case-insensitive manner.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideTrim&#039;&#039;&#039;(const S: WideString): WideString; &lt;br /&gt;
| Removes leading and trailing spaces and control characters from the given string &#039;&#039;&#039;S&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideReplaceStr&#039;&#039;&#039;(const S, OldPattern, NewPattern: WideString): WideString; &lt;br /&gt;
| &amp;amp;nbsp;???&amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideReplaceText&#039;&#039;&#039;(const S, OldPattern, NewPattern: WideString): WideString; &lt;br /&gt;
| &amp;amp;nbsp;???&amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideSplitString&#039;&#039;&#039;(const Input, Delimiter: WideString): TStringsArray; &lt;br /&gt;
| &lt;br /&gt;
Splits the WideString &#039;&#039;&#039;Input &#039;&#039;&#039;wherever &#039;&#039;&#039;Delimiter&#039;&#039;&#039; occurs, and returns an array that contains the split parts. &lt;br /&gt;
&lt;br /&gt;
*The &#039;&#039;&#039;Delimiter&#039;&#039;&#039; itself can be a multi-character WideString. &amp;lt;br&amp;gt;(Unlike the usual comma, hyphen or space that is used for this purpose) &lt;br /&gt;
*The split parts (returned as elements of the array) do not contain the &#039;&#039;&#039;Delimiter&#039;&#039;&#039; WideString&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideCaseCapitalize&#039;&#039;&#039;(const S: WideString): WideString; &lt;br /&gt;
| &lt;br /&gt;
Returns the &#039;&#039;Sentence case&#039;&#039; version of the WideString &#039;&#039;&#039;S&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
Only the first alphabetic character is capitalized. All other alphabetic characters are converted to lowercase.&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*If &#039;&#039;&#039;S&#039;&#039;&#039; begins with numeric characters, the first alphabetic character that follows will be capitalized.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideCaseInvert&#039;&#039;&#039;(const S: WideString): WideString; &lt;br /&gt;
| Inverts the case of all characters in the WideString &#039;&#039;&#039;S&#039;&#039;&#039; and returns the WideString.&amp;lt;br&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Meta Tags Extraction  ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Function&lt;br /&gt;
! Remarks&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;CalculateMetaTag&#039;&#039;&#039;(const FilePath: WideString; const MetaTagName String): String; &lt;br /&gt;
| Extracts and returns the value of a metatag specified by &#039;&#039;&#039;MetaTagName&#039;&#039;&#039; from the file specified by the complete absolute path &#039;&#039;&#039;FilePath&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For example, to extract &#039;&#039;&#039;EXIF_Date&#039;&#039;&#039; tag from an image and set it to the filename, one can use something like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
begin&lt;br /&gt;
  FileName := CalculateMetaTag(FilePath, &#039;EXIF_Date&#039;);&lt;br /&gt;
end.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The full list of meta tags can be found in [[ReNamer:Meta Tags|Meta Tags]] article.&lt;br /&gt;
&lt;br /&gt;
== Regular Expressions  ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Function&lt;br /&gt;
! Remarks&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;ReplaceRegEx&#039;&#039;&#039;(const Input, Find, Replace: WideString;const CaseSensitive, UseSubstitution: Boolean): WideString; &lt;br /&gt;
| Find-and-replace function using RegEx. Works like [[ReNamer:Rules:RegEx|RegEx rule]].&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;MatchesRegEx&#039;&#039;&#039;(const Input, Find: WideString;const CaseSensitive: Boolean): TStringsArray; &lt;br /&gt;
| Returns a list of RegEx matches as an array. Function returns an array of full matches, which matched the entire expression, not the sub-patterns.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;SubMatchesRegEx&#039;&#039;&#039;(const Input, Find: WideString;const CaseSensitive: Boolean): TStringsArray; &lt;br /&gt;
| This function is very similar to &#039;&#039;&#039;MatchesRegEx&#039;&#039;&#039;, but instead of returning full expression matches it will return an array of sub-expression matches for the first full expression match. For example, &#039;&#039;&#039;SubMatchesRegEx(&#039;one two three&#039;, &#039;(.*) (.*) (.*)&#039;)&#039;&#039;&#039; will return an array &#039;&#039;&#039;[&#039;one&#039;, &#039;two&#039;, &#039;three&#039;]&#039;&#039;&#039;. In this way, it can easily be combined with &#039;&#039;&#039;MatchesRegEx&#039;&#039;&#039; function, to allow users to find all global matches, and then parse those matches through &#039;&#039;&#039;SubMatchesRegEx&#039;&#039;&#039; function to find individual sub-expression matches of each global match.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
General parameters of the functions: &lt;br /&gt;
&lt;br /&gt;
* Input - The WideString that is input to the function. &lt;br /&gt;
* Find - RegEx pattern to be found (same as &#039;&#039;&#039;Expression&#039;&#039;&#039; field in the [[ReNamer:Rules:RegEx|RegEx rule]]).&lt;br /&gt;
* Replace - Replacement string (same as the &#039;&#039;&#039;Replace&#039;&#039;&#039; field in the [[ReNamer:Rules:RegEx|RegEx rule]]).&lt;br /&gt;
* CaseSensitive - Specifies whether to process in a case-sensitive mode.&lt;br /&gt;
* UseSubstitution - Determines whether use [[ReNamer:Regular Expressions#Backreferences|backreferences]] in the result.&lt;br /&gt;
&lt;br /&gt;
== Unicode Character Handling Routines  ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Function&lt;br /&gt;
! Remarks&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IsWideCharUpper&#039;&#039;&#039;(WC: WideChar): Boolean; &lt;br /&gt;
| Checks a Unicode character &#039;&#039;&#039;WC&#039;&#039;&#039; and returns TRUE if it is in UPPERCASE.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IsWideCharLower&#039;&#039;&#039;(WC: WideChar): Boolean; &lt;br /&gt;
| Checks a Unicode character &#039;&#039;&#039;WC&#039;&#039;&#039; and returns TRUE if it is in lowercase.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IsWideCharDigit&#039;&#039;&#039;(WC: WideChar): Boolean; &lt;br /&gt;
| Checks a Unicode character &#039;&#039;&#039;WC&#039;&#039;&#039; and returns TRUE if it is a digit (numeric character 0-9). &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IsWideCharSpace&#039;&#039;&#039;(WC: WideChar): Boolean; &lt;br /&gt;
| Checks a Unicode character &#039;&#039;&#039;WC&#039;&#039;&#039; and returns TRUE if it is a white-space character, such as: space, form-feed, newline, carriage-return, tab and vertical-tab (characters classified as C1_SPACE).&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IsWideCharPunct&#039;&#039;&#039;(WC: WideChar): Boolean; &lt;br /&gt;
| Checks a Unicode character &#039;&#039;&#039;WC&#039;&#039;&#039; and returns TRUE if it is a punctuation mark (characters classified as C1_PUNCT).&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IsWideCharCntrl&#039;&#039;&#039;(WC: WideChar): Boolean; &lt;br /&gt;
| Checks a Unicode character &#039;&#039;&#039;WC&#039;&#039;&#039; and returns TRUE if it is a control character (characters classified as C1_CNTRL).&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IsWideCharBlank&#039;&#039;&#039;(WC: WideChar): Boolean; &lt;br /&gt;
| Checks a Unicode character &#039;&#039;&#039;WC&#039;&#039;&#039; and returns TRUE if it is a blank, such as: space and tab (characters classified as C1_BLANK).&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IsWideCharXDigit&#039;&#039;&#039;(WC: WideChar): Boolean; &lt;br /&gt;
| Checks a Unicode character &#039;&#039;&#039;WC&#039;&#039;&#039; and returns TRUE if it is a hexadecimal digit (0-9 or A-F).&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IsWideCharAlpha&#039;&#039;&#039;(WC: WideChar): Boolean; &lt;br /&gt;
| Checks a Unicode character &#039;&#039;&#039;WC&#039;&#039;&#039; and returns TRUE if it is a alphanumeric character (a-z or A-Z).&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IsWideCharAlphaNumeric&#039;&#039;&#039;(WC: WideChar): Boolean; &lt;br /&gt;
| Checks a Unicode character &#039;&#039;&#039;WC&#039;&#039;&#039; and returns TRUE if it is a alphanumeric character or a numeric character (a-z, A-Z or 0-9).&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideCharUpper&#039;&#039;&#039;(const WC: WideChar): WideChar; &lt;br /&gt;
| Returns a UPPERCASE version of the input Unicode character. In case of non-alphabetic character, it returns the same character.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideCharLower&#039;&#039;&#039;(const WC: WideChar): WideChar; &lt;br /&gt;
| Returns a lowercase version of the input Unicode character. In case of non-alphabetic character, it returns the same character.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Character classifications, such as C1_UPPER, C1_LOWER, C1_DIGIT, C1_SPACE, C1_PUNCT, C1_CNTRL, C1_BLANK, C1_XDIGIT, C1_ALPHA - are part of Unicode definitions. More information regarding classification can be found on the internet. For example: [http://www.fileformat.info/info/unicode/ http://www.fileformat.info/info/unicode/].&lt;br /&gt;
&lt;br /&gt;
== Unicode Conversion Routines  ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Function&lt;br /&gt;
! Remarks&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideToAnsi&#039;&#039;&#039;(const WS: WideString): String; &lt;br /&gt;
| Converts a Unicode string to its ANSI version.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;AnsiToWide&#039;&#039;&#039;(const S: String): WideString; &lt;br /&gt;
| Converts a ANSI string to its Unicode version.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;UTF8Encode&#039;&#039;&#039;(const WS: WideString): String; &lt;br /&gt;
| Convert Unicode string to the UTF-8 encoded string. Useful to storing Unicode strings in files.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;UTF8Decode&#039;&#039;&#039;(const S: String): WideString;&lt;br /&gt;
| Convert UTF-8 encoded string to its full Unicode representation.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Basic Conversion Routines  ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Function&lt;br /&gt;
! Remarks&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IntToStr&#039;&#039;&#039;(Value: Integer): String; &lt;br /&gt;
| Converts an integer to a string. The following assumptions are correct:&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-family: monospace&amp;quot;&amp;gt;&lt;br /&gt;
* IntToStr(123) = &#039;123&#039;&lt;br /&gt;
* IntToStr(0123) = &#039;123&#039;&lt;br /&gt;
* IntToStr(123) &amp;lt;&amp;gt; &#039;0123&#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;StrToInt&#039;&#039;&#039;(const S: String): Integer; &lt;br /&gt;
| Converts a string to an integer. The following equality is correct:&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-family: monospace&amp;quot;&amp;gt;&lt;br /&gt;
* StrToInt(&#039;123&#039;) = 123&lt;br /&gt;
* StrToInt(&#039;123&#039;) = 0123&lt;br /&gt;
* StrToInt(&#039;0123&#039;) = 123&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Warning:&#039;&#039;&#039; An error will occur if the parameter to this function cannot be converted to an integer!&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;StrToIntDef&#039;&#039;&#039;(const S: String; const Default: Integer): Integer; &lt;br /&gt;
| Behaves like &#039;&#039;&#039;StrToInt&#039;&#039;&#039; function, but instead of producing an error on incorrect input function allows the &#039;&#039;&#039;Default&#039;&#039;&#039; value to be specified, which will be returned if the input cannot be converted to an integer.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;DateToStr&#039;&#039;&#039;(D: TDateTime): String; &lt;br /&gt;
| Converts a date to a string, using system format for the short date, for example: &#039;&#039;&#039;dd/mm/yyyy&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;StrToDate&#039;&#039;&#039;(const S: String): TDateTime; &lt;br /&gt;
| Converts a date string to a proper TDateTime value, using system format for the short date, for example: &#039;&#039;&#039;dd/mm/yyyy&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IntToHex&#039;&#039;&#039;(Value: Integer; Digits: Integer): String; &lt;br /&gt;
| Converts an integer to its hexadecimal representation. Here are samples:&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-family: monospace&amp;quot;&amp;gt;&lt;br /&gt;
* IntToHex(1234, 1) = &#039;4D2&#039;&lt;br /&gt;
* IntToHex(1234, 8) = &#039;000004D2&#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;HexToInt&#039;&#039;&#039;(const HexNum: String): Integer; &lt;br /&gt;
| Converts a hexadecimal value to its decimal representation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning:&#039;&#039;&#039; An error will occur if the parameter to this function cannot be converted to an integer!&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;HexToIntDef&#039;&#039;&#039;(const HexNum: String; Default: Integer): Integer; &lt;br /&gt;
| Behaves like &#039;&#039;&#039;HexToInt&#039;&#039;&#039; function, but instead of producing an error on incorrect input function allows the &#039;&#039;&#039;Default&#039;&#039;&#039; value to be specified, which will be returned if the input cannot be converted to an integer.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;Ord&#039;&#039;&#039;(X: Char): Byte; &lt;br /&gt;
| Return an ordinal value (byte representation) of a character.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;Chr&#039;&#039;&#039;(X: Byte): Char; &lt;br /&gt;
| Return a character by its ordinal value (byte representation).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Date And Time Routines ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Function&lt;br /&gt;
! Remarks&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;Date&#039;&#039;&#039;: TDateTime; &lt;br /&gt;
| Returns the current system date.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;Time&#039;&#039;&#039;: TDateTime; &lt;br /&gt;
| Returns the current system time.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;Now&#039;&#039;&#039;: TDateTime; &lt;br /&gt;
| Returns the current system date and time.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;EncodeDate&#039;&#039;&#039;(Year, Month, Day: Word): TDateTime; &lt;br /&gt;
| Generates date value for the specified &#039;&#039;&#039;Year&#039;&#039;&#039;, &#039;&#039;&#039;Month&#039;&#039;&#039;, &#039;&#039;&#039;Day&#039;&#039;&#039;. Parameters must be within a valid date range: Year = 0..9999, Month = 1..12, Day = 1..31 (depending on month/year). An error will be raised if parameters are invalid.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;EncodeTime&#039;&#039;&#039;(Hour, Min, Sec, MSec: Word): TDateTime; &lt;br /&gt;
| Generates time value for the specified &#039;&#039;&#039;Hour&#039;&#039;&#039;, &#039;&#039;&#039;Min&#039;&#039;&#039;, &#039;&#039;&#039;Sec&#039;&#039;&#039;, &#039;&#039;&#039;MSec&#039;&#039;&#039;. Parameters must be within a valid time range: Hour = 0..23, Min = 0..59, Sec = 0..59, MSec = 0..999. An error will be raised if parameters are invalid.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;TryEncodeDate&#039;&#039;&#039;(Year, Month, Day: Word; var Date: TDateTime): Boolean; &lt;br /&gt;
| Behaves exactly like &#039;&#039;&#039;EncodeDate&#039;&#039;&#039; function, except this function returns the TRUE or FALSE depending on the success of the operation. If operation was successful, function will return TRUE and the generated date value will be written in the &#039;&#039;&#039;Date&#039;&#039;&#039; variable.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;TryEncodeTime&#039;&#039;&#039;(Hour, Min, Sec, MSec: Word; var Time: TDateTime): Boolean; &lt;br /&gt;
| Behaves exactly like &#039;&#039;&#039;EncodeTime&#039;&#039;&#039; function, except this function returns the TRUE or FALSE depending on the success of the operation. If operation was successful, function will return TRUE and the generated time value will be written in the &#039;&#039;&#039;Time&#039;&#039;&#039; variable.&lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;DecodeDate&#039;&#039;&#039;(const DateTime: TDateTime; var Year, Month, Day: Word); &lt;br /&gt;
| Extracts &#039;&#039;&#039;Year&#039;&#039;&#039;, &#039;&#039;&#039;Month&#039;&#039;&#039; and &#039;&#039;&#039;Day&#039;&#039;&#039; components from a given &#039;&#039;&#039;DateTime&#039;&#039;&#039; value.&lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;DecodeTime&#039;&#039;&#039;(const DateTime: TDateTime; var Hour, Min, Sec, MSec: Word); &lt;br /&gt;
| Extracts &#039;&#039;&#039;Hour&#039;&#039;&#039;, &#039;&#039;&#039;Min&#039;&#039;&#039;, &#039;&#039;&#039;Sec&#039;&#039;&#039; and &#039;&#039;&#039;MSec&#039;&#039;&#039; components from a given &#039;&#039;&#039;DateTime&#039;&#039;&#039; value.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;DayOfWeek&#039;&#039;&#039;(const DateTime: TDateTime): Word; &lt;br /&gt;
| Returns the day of the week (as an index) for the specified &#039;&#039;&#039;DateTime&#039;&#039;&#039; value. The indexes are: 1 = Sunday, 2 = Monday, 3 = Tuesday, 4 = Wednesday, 5 = Thursday, 6 = Friday, 7 = Saturday.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;DateTimeToUnix&#039;&#039;&#039;(D: TDateTime): Int64;&lt;br /&gt;
| Converts &#039;&#039;&#039;D&#039;&#039;&#039; value of type &#039;&#039;&#039;TDateTime&#039;&#039;&#039; to a Unix timestamp.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;UnixToDateTime&#039;&#039;&#039;(U: Int64): TDateTime; &lt;br /&gt;
| Converts a Unix timestamp to a value of &#039;&#039;&#039;TDateTime&#039;&#039;&#039; type.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;FormatDateTime&#039;&#039;&#039;(const Fmt: String; D: TDateTime): String; &lt;br /&gt;
| This function provides rich formatting of a &#039;&#039;&#039;DateTime&#039;&#039;&#039; value into a string. [[ReNamer:Date and Time format|Date and time format]] is defined by the &#039;&#039;&#039;Fmt&#039;&#039;&#039; string. &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IncYear&#039;&#039;&#039;(const AValue: TDateTime;const ANumberOfYears: Integer): TDateTime; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IncMonth&#039;&#039;&#039;(const AValue: TDateTime;ANumberOfMonths: Integer): TDateTime; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IncWeek&#039;&#039;&#039;(const AValue: TDateTime; const ANumberOfWeeks: Integer): TDateTime; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IncDay&#039;&#039;&#039;(const AValue: TDateTime;const ANumberOfDays: Integer): TDateTime; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IncHour&#039;&#039;&#039;(const AValue: TDateTime;const ANumberOfHours: Int64): TDateTime; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IncMinute&#039;&#039;&#039;(const AValue: TDateTime;const ANumberOfMinutes: Int64): TDateTime; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IncSecond&#039;&#039;&#039;(const AValue: TDateTime;const ANumberOfSeconds: Int64): TDateTime; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IncMilliSecond&#039;&#039;&#039;(const AValue: TDateTime;const ANumberOfMilliSeconds: Int64): TDateTime; &lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== File Management Routines  ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Function&lt;br /&gt;
! Remarks&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideFileSize&#039;&#039;&#039;(const FileName: WideString): Int64; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideFileExists&#039;&#039;&#039;(const FileName: WideString): Boolean; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideDirectoryExists&#039;&#039;&#039;(const Directory: WideString): Boolean; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideForceDirectories&#039;&#039;&#039;(Dir: WideString): Boolean; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideCreateDir&#039;&#039;&#039;(const Dir: WideString): Boolean; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideDeleteFile&#039;&#039;&#039;(const FileName: WideString): Boolean; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideRenameFile&#039;&#039;&#039;(const OldName, NewName: WideString): Boolean; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideFileSearch&#039;&#039;&#039;(const Name, DirList: WideString): WideString; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideGetCurrentDir&#039;&#039;&#039;: WideString; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideSetCurrentDir&#039;&#039;&#039;(const Dir: WideString): Boolean; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;WideScanDirForFiles&#039;&#039;&#039;(Dir: WideString; var Files: TStringsArray;const Recursive, IncludeHidden, IncludeSystem: Boolean; const Mask: WideString); &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;WideScanDirForFolders&#039;&#039;&#039;(Dir: WideString; var Folders: TStringsArray;const Recursive, IncludeHidden, IncludeSystem: Boolean); &lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== File Name Utilities  ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;center&amp;quot; | &#039;&#039;&#039;Function&#039;&#039;&#039; &lt;br /&gt;
| &amp;lt;center&amp;gt;&#039;&#039;&#039;Remarks&#039;&#039;&#039;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideExtractFilePath&#039;&#039;&#039;(const FileName: WideString): WideString; &lt;br /&gt;
| Returns the entire path of the file &amp;lt;br&amp;gt;(starting from the drive letter)&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideExtractFileDir&#039;&#039;&#039;(const FileName: WideString): WideString; &lt;br /&gt;
| Returns the folder in which the file is located.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideExtractFileDrive&#039;&#039;&#039;(const FileName: WideString): WideString; &lt;br /&gt;
| Returns the drive letter&amp;lt;br&amp;gt;???or is it the name of the drive?&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideExtractFileName&#039;&#039;&#039;(const FileName: WideString): WideString; &lt;br /&gt;
| Returns the filename with extension. &amp;lt;br&amp;gt;(e.g. &amp;quot;FileName.txt&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideExtractBaseName&#039;&#039;&#039;(const FileName: WideString): WideString; &lt;br /&gt;
| Returns only the file&#039; base name (but not the dot or extension). (e.g. &amp;quot;FileName&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideExtractFileExt&#039;&#039;&#039;(const FileName: WideString): WideString; &lt;br /&gt;
| Returns the file&#039;s extension with the dot (e.g. &amp;quot;.txt&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideChangeFileExt&#039;&#039;&#039;(const FileName, Extension: WideString): WideString; &lt;br /&gt;
| Replaces the original extension, and returns the new filename with extension. (e.g. &amp;quot;FineName.txt&amp;quot; -&amp;amp;gt; &amp;quot;FineName.pdf&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideStripExtension&#039;&#039;&#039;(const FileName: WideString): WideString; &lt;br /&gt;
| Strips off the extension from the filename.&amp;lt;br&amp;gt;??? what does it return?&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideExpandFileName&#039;&#039;&#039;(const FileName: WideString): WideString; &lt;br /&gt;
| &amp;amp;nbsp;???&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideExtractRelativePath&#039;&#039;&#039;(const BaseName, DestName: WideString): WideString; &lt;br /&gt;
| &lt;br /&gt;
Given two files lacated in two different folders, returns the relative path of &#039;&#039;&#039;DestName&#039;&#039;&#039; file with respect to the &#039;&#039;&#039;BaseName&#039;&#039;&#039; file. &lt;br /&gt;
&lt;br /&gt;
e.g. If we input these two filenames: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;D:\Folder1\FileName1.txt&#039;&#039;&#039;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; (The base file)&amp;lt;br&amp;gt;&#039;&#039;&#039;D:\Folder2\Folder22\FileName2.pdf&#039;&#039;&#039;&amp;amp;nbsp;&amp;amp;nbsp; (The destination file) &lt;br /&gt;
&lt;br /&gt;
Then the relative path of the destination file is-&amp;lt;br&amp;gt;&#039;&#039;&#039;..\Folder2\Folder22\FileName2.pdf&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideExtractShortPathName&#039;&#039;&#039;(const FileName: WideString): WideString; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideIncludeTrailingPathDelimiter&#039;&#039;&#039;(const S: WideString): WideString; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideExcludeTrailingPathDelimiter&#039;&#039;&#039;(const S: WideString): WideString; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideSameFileName&#039;&#039;&#039;(const S1, S2: WideString): Boolean; &lt;br /&gt;
| Compares the filenames &#039;&#039;&#039;S1&#039;&#039;&#039; and &#039;&#039;&#039;S2&#039;&#039;&#039;, and returns TRUE if they are identical.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideGetEnvironmentVar&#039;&#039;&#039;(const VarName: WideString): WideString; &lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== File Read/Write Routines  ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Function&lt;br /&gt;
! Remarks&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;FileReadFragment&#039;&#039;&#039;(const FileName: WideString; Start, Length: Integer): String; &lt;br /&gt;
| Starting at position &#039;&#039;Start&#039;&#039; read &#039;&#039;Length&#039;&#039; number of characters of the file &#039;&#039;FileName&#039;&#039; and return them as a string. &#039;&#039;&#039;Start&#039;&#039;&#039; is 0 based, so in order to start the fragment from the first character set this parameter 0 (zero).&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;FileReadLine&#039;&#039;&#039;(const FileName: WideString; LineNum: Integer): String; &lt;br /&gt;
| Read a line from a file &#039;&#039;&#039;FileName&#039;&#039;&#039; specified by a line index &#039;&#039;&#039;LineNum&#039;&#039;&#039;. &#039;&#039;&#039;LineNum&#039;&#039;&#039; is 1 based, so to get the first line set this parameter to 1 (one).&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;FileCountLines&#039;&#039;&#039;(const FileName: WideString): Integer; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;FileReadContent&#039;&#039;&#039;(const FileName: WideString): String; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;FileWriteContent&#039;&#039;&#039;(const FileName: WideString; const Content: String); &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;FileAppendContent&#039;&#039;&#039;(const FileName: WideString; const Content: String); &lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== File Properties Routines  ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;center&amp;quot; | &#039;&#039;&#039;Function&#039;&#039;&#039; &lt;br /&gt;
| &amp;lt;center&amp;gt;&#039;&#039;&#039;Remarks&#039;&#039;&#039;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;FileTimeModified&#039;&#039;&#039;(const FileName: WideString): TDateTime; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;FileTimeCreated&#039;&#039;&#039;(const FileName: WideString): TDateTime; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;SetFileTimeCreated&#039;&#039;&#039;(const FileName: WideString;const DateTime: TDateTime): Boolean; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;SetFileTimeModified&#039;&#039;&#039;(const FileName: WideString;const DateTime: TDateTime): Boolean; &lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== Process Execution Routines  ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;center&amp;quot; | &#039;&#039;&#039;Function&#039;&#039;&#039; &lt;br /&gt;
| &amp;lt;center&amp;gt;&#039;&#039;&#039;Remarks&#039;&#039;&#039;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;ShellOpenFile&#039;&#039;&#039;(const FileName: WideString): Boolean; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;ExecuteProgram&#039;&#039;&#039;(const Command: String; WaitForProgram: Boolean): Cardinal; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;ExecConsoleApp&#039;&#039;&#039;(const CommandLine: String; out Output: String): Cardinal; &lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== Interactive Dialogs  ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;center&amp;quot; | &#039;&#039;&#039;Function&#039;&#039;&#039; &lt;br /&gt;
| &amp;lt;center&amp;gt;&#039;&#039;&#039;Remarks&#039;&#039;&#039;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;ShowMessage&#039;&#039;&#039;(const Msg: String); &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;WideShowMessage&#039;&#039;&#039;(const Msg: WideString); &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;DialogYesNo&#039;&#039;&#039;(const Msg: String): Boolean; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideDialogYesNo&#039;&#039;&#039;(const Msg: WideString): Boolean; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;InputBox&#039;&#039;&#039;(const ACaption, APrompt, ADefault: String): String; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;InputQuery&#039;&#039;&#039;(const ACaption, APrompt: String; var Value: String): Boolean; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideInputBox&#039;&#039;&#039;(const ACaption, APrompt, ADefault: WideString): WideString; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideInputQuery&#039;&#039;&#039;(const ACaption, APrompt: WideString;var Value: WideString): Boolean; &lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== Other Routines  ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;center&amp;quot; | &#039;&#039;&#039;Function&#039;&#039;&#039; &lt;br /&gt;
| &amp;lt;center&amp;gt;&#039;&#039;&#039;Remarks&#039;&#039;&#039;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;Randomize&#039;&#039;&#039;(); &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;Sleep&#039;&#039;&#039;(Milliseconds: Cardinal); &lt;br /&gt;
| Sleeps (waits) for specified miliseconds&lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;DivMod&#039;&#039;&#039;(Dividend: Integer; Divisor: Word; var Result, Remainder: Word); &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;SetClipboardText&#039;&#039;&#039;(const S: WideString); &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;GetClipboardText&#039;&#039;&#039;: WideString; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;RandomRange&#039;&#039;&#039;(const AFrom, ATo: Integer): Integer; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;Base64Encode&#039;&#039;&#039;(const S: String): String; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;Base64Decode&#039;&#039;&#039;(const S: String): String; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;GetTickCount&#039;&#039;&#039;: Cardinal; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;SizeOf&#039;&#039;&#039;(X): Integer; &lt;br /&gt;
| &lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Prologician</name></author>
	</entry>
	<entry>
		<id>https://www.den4b.com/w/index.php?title=ReNamer:Pascal_Script:Functions&amp;diff=1048</id>
		<title>ReNamer:Pascal Script:Functions</title>
		<link rel="alternate" type="text/html" href="https://www.den4b.com/w/index.php?title=ReNamer:Pascal_Script:Functions&amp;diff=1048"/>
		<updated>2009-08-02T09:55:14Z</updated>

		<summary type="html">&lt;p&gt;Prologician: /* File Read/Write Routines */ Fix a missing italic marker.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction  ==&lt;br /&gt;
&lt;br /&gt;
ReNamer has many [http://www.taoyue.com/tutorials/pascal/pas4a.html procedures] and [http://www.taoyue.com/tutorials/pascal/pas4c.html functions] to manipulate the entities related to file names. These entities may be derived from the existing filename, path, system date, meta tags from the file, strings entered by the user, etc.&lt;br /&gt;
&lt;br /&gt;
A common prefix &#039;&#039;&#039;Wide&#039;&#039;&#039; in the function name indicates that the function deals with [http://en.wikipedia.org/wiki/Unicode Unicode] strings (WideString). The prefix is used because there are similar functions which deal with Ansi strings and in some cases simply for internal consistency. For example: &#039;&#039;&#039;ShowMessage&#039;&#039;&#039; and &#039;&#039;&#039;WideShowMessage&#039;&#039;&#039; procedures.&lt;br /&gt;
&lt;br /&gt;
*??? What is T prefix? &lt;br /&gt;
*??? What is UTF8?&lt;br /&gt;
&lt;br /&gt;
== Basic String Handling Routines  ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Routine&lt;br /&gt;
! Remarks&lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;Insert&#039;&#039;&#039;(Source: String; var S: String; Index: Integer); &lt;br /&gt;
| Inserts the string &#039;&#039;&#039;S&#039;&#039;&#039; into string &#039;&#039;&#039;Source&#039;&#039;&#039; at position &#039;&#039;&#039;Index&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;Delete&#039;&#039;&#039;(var S: String; Index, Count: Integer); &lt;br /&gt;
| Deletes &#039;&#039;&#039;Count&#039;&#039;&#039; characters from the string &#039;&#039;&#039;S&#039;&#039;&#039;, starting from position &#039;&#039;&#039;Index&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;Copy&#039;&#039;&#039;(S: String; Index, Count: Integer): String; &lt;br /&gt;
| Copies &#039;&#039;&#039;Count&#039;&#039;&#039; characters from string &#039;&#039;&#039;S&#039;&#039;&#039;, starting at position &#039;&#039;&#039;Index&#039;&#039;&#039;, and returns them as a new string.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;Pos&#039;&#039;&#039;(Substr: String; S: String): Integer; &lt;br /&gt;
| Returns the position of a string &#039;&#039;&#039;Substr&#039;&#039;&#039; in another string &#039;&#039;&#039;S&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Indexes of characters in strings are 1 based, so first character in string S would be S[1].&lt;br /&gt;
&lt;br /&gt;
== Length Managing Routines  ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Routine&lt;br /&gt;
! Remarks&lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;SetLength&#039;&#039;&#039;(var S: Array; NewLength: Integer); &lt;br /&gt;
| Sets the length of array variable &#039;&#039;&#039;S&#039;&#039;&#039; to &#039;&#039;&#039;NewLength&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;SetLength&#039;&#039;&#039;(var S: String; NewLength: Integer); &lt;br /&gt;
| Sets the length of string variable &#039;&#039;&#039;S&#039;&#039;&#039; to &#039;&#039;&#039;NewLength&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;SetLength&#039;&#039;&#039;(var S: WideString; NewLength: Integer); &lt;br /&gt;
| Sets the length of widestring &#039;&#039;&#039;S&#039;&#039;&#039; to &#039;&#039;&#039;NewLength&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;Length&#039;&#039;&#039;(const S: Array): Integer; &lt;br /&gt;
| Returns the length of array &#039;&#039;&#039;S &#039;&#039;&#039; (number of elements).&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;Length&#039;&#039;&#039;(const S: String): Integer; &lt;br /&gt;
| Returns the length of string &#039;&#039;&#039;S&#039;&#039;&#039; (number of characters).&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;Length&#039;&#039;&#039;(const S: WideString): Integer;&lt;br /&gt;
| Returns the length of WideString &#039;&#039;&#039;S&#039;&#039;&#039; (number of characters).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Unicode String Handling Routines ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Routine&lt;br /&gt;
! Remarks&lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;WideInsert&#039;&#039;&#039;(const Substr: WideString; var Dest: WideString; Index: Integer); &lt;br /&gt;
| Inserts &#039;&#039;&#039;Substr&#039;&#039;&#039; in &#039;&#039;&#039;Dest&#039;&#039;&#039; at position &#039;&#039;&#039;Index&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;WideDelete&#039;&#039;&#039;(var S: WideString; Index, Count: Integer); &lt;br /&gt;
| Deletes &#039;&#039;&#039;Count&#039;&#039;&#039; characters from &#039;&#039;&#039;S&#039;&#039;&#039;, starting from the &#039;&#039;&#039;Index&#039;&#039;&#039; position.&lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;WideSetLength&#039;&#039;&#039;(var S: WideString; NewLength: Integer); &lt;br /&gt;
| Change the length of string &#039;&#039;&#039;S&#039;&#039;&#039; to a new length specified by &#039;&#039;&#039;NewLength&#039;&#039;&#039;. If new length is smaller than original, the string is truncated. If new length is greater than original, the string will be expanded but additional characters will not be initialized and can be anything.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideLength&#039;&#039;&#039;(const S: WideString): Integer; &lt;br /&gt;
| Returns the length of WideString &#039;&#039;&#039;S&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideCopy&#039;&#039;&#039;(const S: WideString; Index, Count: Integer): WideString; &lt;br /&gt;
| Returns &#039;&#039;&#039;Count&#039;&#039;&#039; characters from WideString &#039;&#039;&#039;S&#039;&#039;&#039;, starting at position &#039;&#039;&#039;Index&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WidePos&#039;&#039;&#039;(const SubStr, S: WideString): Integer; &lt;br /&gt;
| Find and occurrence of &#039;&#039;&#039;SubStr&#039;&#039;&#039; in &#039;&#039;&#039;S&#039;&#039;&#039;. Returns the position of first occurrence, or &#039;&#039;&#039;0&#039;&#039;&#039; if nothing was found.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WidePosEx&#039;&#039;&#039;(const SubStr, S: WideString; Offset: Cardinal): Integer; &lt;br /&gt;
| Find and occurrence of &#039;&#039;&#039;SubStr&#039;&#039;&#039; in &#039;&#039;&#039;S&#039;&#039;&#039; but start searching from position specified by &#039;&#039;&#039;Offset&#039;&#039;&#039;. Returns the position of first occurrence, or &#039;&#039;&#039;0&#039;&#039;&#039; if nothing was found.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideUpperCase&#039;&#039;&#039;(const S: WideString): WideString; &lt;br /&gt;
| Returns the ALLCAPS version of the WideString &#039;&#039;&#039;S&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideLowerCase&#039;&#039;&#039;(const S: WideString): WideString; &lt;br /&gt;
| Returns the lowercase version of the WideString &#039;&#039;&#039;S&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideCompareStr&#039;&#039;&#039;(const S1, S2: WideString): Integer; &lt;br /&gt;
| Compares two WideStrings &#039;&#039;&#039;S1&#039;&#039;&#039; and &#039;&#039;&#039;S2&#039;&#039;&#039;, case-sensitive, and returns an integer based on the result. The return value is less than 0 if S1 is less than S2, 0 if S1 equals S2, or greater than 0 if S1 is greater than S2.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideCompareText&#039;&#039;&#039;(const S1, S2: WideString): Integer; &lt;br /&gt;
| Compares two WideStrings &#039;&#039;&#039;S1&#039;&#039;&#039; and &#039;&#039;&#039;S2&#039;&#039;&#039;, case-insensitive, and returns an integer based on the result. The return value is less than 0 if S1 is less than S2, 0 if S1 equals S2, or greater than 0 if S1 is greater than S2.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideSameText&#039;&#039;&#039;(const S1, S2: WideString): Boolean; &lt;br /&gt;
| Compares two WideStrings &#039;&#039;&#039;S1&#039;&#039;&#039; and &#039;&#039;&#039;S2&#039;&#039;&#039;. Returns TRUE if both are identical, otherwise returns FALSE.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideTextPos&#039;&#039;&#039;(const SubStr, S: WideString): Integer; &lt;br /&gt;
| Behaves like &#039;&#039;&#039;WidePos&#039;&#039;&#039; function, except text if processed in case-insensitive manner.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideTrim&#039;&#039;&#039;(const S: WideString): WideString; &lt;br /&gt;
| Removes leading and trailing spaces and control characters from the given string &#039;&#039;&#039;S&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideReplaceStr&#039;&#039;&#039;(const S, OldPattern, NewPattern: WideString): WideString; &lt;br /&gt;
| &amp;amp;nbsp;???&amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideReplaceText&#039;&#039;&#039;(const S, OldPattern, NewPattern: WideString): WideString; &lt;br /&gt;
| &amp;amp;nbsp;???&amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideSplitString&#039;&#039;&#039;(const Input, Delimiter: WideString): TStringsArray; &lt;br /&gt;
| &lt;br /&gt;
Splits the WideString &#039;&#039;&#039;Input &#039;&#039;&#039;wherever &#039;&#039;&#039;Delimiter&#039;&#039;&#039; occurs, and returns an array that contains the split parts. &lt;br /&gt;
&lt;br /&gt;
*The &#039;&#039;&#039;Delimiter&#039;&#039;&#039; itself can be a multi-character WideString. &amp;lt;br&amp;gt;(Unlike the usual comma, hyphen or space that is used for this purpose) &lt;br /&gt;
*The split parts (returned as elements of the array) do not contain the &#039;&#039;&#039;Delimiter&#039;&#039;&#039; WideString&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideCaseCapitalize&#039;&#039;&#039;(const S: WideString): WideString; &lt;br /&gt;
| &lt;br /&gt;
Returns the &#039;&#039;Sentence case&#039;&#039; version of the WideString &#039;&#039;&#039;S&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
Only the first alphabetic character is capitalized. All other alphabetic characters are converted to lowercase.&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*If &#039;&#039;&#039;S&#039;&#039;&#039; begins with numeric characters, the first alphabetic character that follows will be capitalized.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideCaseInvert&#039;&#039;&#039;(const S: WideString): WideString; &lt;br /&gt;
| Inverts the case of all characters in the WideString &#039;&#039;&#039;S&#039;&#039;&#039; and returns the WideString.&amp;lt;br&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Meta Tags Extraction  ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Function&lt;br /&gt;
! Remarks&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;CalculateMetaTag&#039;&#039;&#039;(const FilePath: WideString; const MetaTagName String): String; &lt;br /&gt;
| Extracts and returns the value of a metatag specified by &#039;&#039;&#039;MetaTagName&#039;&#039;&#039; from the file specified by the complete absolute path &#039;&#039;&#039;FilePath&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For example, to extract &#039;&#039;&#039;EXIF_Date&#039;&#039;&#039; tag from an image and set it to the filename, one can use something like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
begin&lt;br /&gt;
  FileName := CalculateMetaTag(FilePath, &#039;EXIF_Date&#039;);&lt;br /&gt;
end.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The full list of meta tags can be found in [[ReNamer:Meta Tags|Meta Tags]] article.&lt;br /&gt;
&lt;br /&gt;
== Regular Expressions  ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Function&lt;br /&gt;
! Remarks&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;ReplaceRegEx&#039;&#039;&#039;(const Input, Find, Replace: WideString;const CaseSensitive, UseSubstitution: Boolean): WideString; &lt;br /&gt;
| Find-and-replace function using RegEx. Works like [[ReNamer:Rules:RegEx|RegEx rule]].&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;MatchesRegEx&#039;&#039;&#039;(const Input, Find: WideString;const CaseSensitive: Boolean): TStringsArray; &lt;br /&gt;
| Returns a list of RegEx matches as an array. Function returns an array of full matches, which matched the entire expression, not the sub-patterns.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;SubMatchesRegEx&#039;&#039;&#039;(const Input, Find: WideString;const CaseSensitive: Boolean): TStringsArray; &lt;br /&gt;
| This function is very similar to &#039;&#039;&#039;MatchesRegEx&#039;&#039;&#039;, but instead of returning full expression matches it will return an array of sub-expression matches for the first full expression match. For example, &#039;&#039;&#039;SubMatchesRegEx(&#039;one two three&#039;, &#039;(.*) (.*) (.*)&#039;)&#039;&#039;&#039; will return an array &#039;&#039;&#039;[&#039;one&#039;, &#039;two&#039;, &#039;three&#039;]&#039;&#039;&#039;. In this way, it can easily be combined with &#039;&#039;&#039;MatchesRegEx&#039;&#039;&#039; function, to allow users to find all global matches, and then parse those matches through &#039;&#039;&#039;SubMatchesRegEx&#039;&#039;&#039; function to find individual sub-expression matches of each global match.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
General parameters of the functions: &lt;br /&gt;
&lt;br /&gt;
* Input - The WideString that is input to the function. &lt;br /&gt;
* Find - RegEx pattern to be found (same as &#039;&#039;&#039;Expression&#039;&#039;&#039; field in the [[ReNamer:Rules:RegEx|RegEx rule]]).&lt;br /&gt;
* Replace - Replacement string (same as the &#039;&#039;&#039;Replace&#039;&#039;&#039; field in the [[ReNamer:Rules:RegEx|RegEx rule]]).&lt;br /&gt;
* CaseSensitive - Specifies whether to process in a case-sensitive mode.&lt;br /&gt;
* UseSubstitution - Determines whether use [[ReNamer:Regular Expressions#Backreferences|backreferences]] in the result.&lt;br /&gt;
&lt;br /&gt;
== Unicode Character Handling Routines  ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Function&lt;br /&gt;
! Remarks&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IsWideCharUpper&#039;&#039;&#039;(WC: WideChar): Boolean; &lt;br /&gt;
| Checks a Unicode character &#039;&#039;&#039;WC&#039;&#039;&#039; and returns TRUE if it is in UPPERCASE.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IsWideCharLower&#039;&#039;&#039;(WC: WideChar): Boolean; &lt;br /&gt;
| Checks a Unicode character &#039;&#039;&#039;WC&#039;&#039;&#039; and returns TRUE if it is in lowercase.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IsWideCharDigit&#039;&#039;&#039;(WC: WideChar): Boolean; &lt;br /&gt;
| Checks a Unicode character &#039;&#039;&#039;WC&#039;&#039;&#039; and returns TRUE if it is a digit (numeric character 0-9). &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IsWideCharSpace&#039;&#039;&#039;(WC: WideChar): Boolean; &lt;br /&gt;
| Checks a Unicode character &#039;&#039;&#039;WC&#039;&#039;&#039; and returns TRUE if it is a white-space character, such as: space, form-feed, newline, carriage-return, tab and vertical-tab (characters classified as C1_SPACE).&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IsWideCharPunct&#039;&#039;&#039;(WC: WideChar): Boolean; &lt;br /&gt;
| Checks a Unicode character &#039;&#039;&#039;WC&#039;&#039;&#039; and returns TRUE if it is a punctuation mark (characters classified as C1_PUNCT).&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IsWideCharCntrl&#039;&#039;&#039;(WC: WideChar): Boolean; &lt;br /&gt;
| Checks a Unicode character &#039;&#039;&#039;WC&#039;&#039;&#039; and returns TRUE if it is a control character (characters classified as C1_CNTRL).&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IsWideCharBlank&#039;&#039;&#039;(WC: WideChar): Boolean; &lt;br /&gt;
| Checks a Unicode character &#039;&#039;&#039;WC&#039;&#039;&#039; and returns TRUE if it is a blank, such as: space and tab (characters classified as C1_BLANK).&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IsWideCharXDigit&#039;&#039;&#039;(WC: WideChar): Boolean; &lt;br /&gt;
| Checks a Unicode character &#039;&#039;&#039;WC&#039;&#039;&#039; and returns TRUE if it is a hexadecimal digit (0-9 or A-F).&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IsWideCharAlpha&#039;&#039;&#039;(WC: WideChar): Boolean; &lt;br /&gt;
| Checks a Unicode character &#039;&#039;&#039;WC&#039;&#039;&#039; and returns TRUE if it is a alphanumeric character (a-z or A-Z).&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IsWideCharAlphaNumeric&#039;&#039;&#039;(WC: WideChar): Boolean; &lt;br /&gt;
| Checks a Unicode character &#039;&#039;&#039;WC&#039;&#039;&#039; and returns TRUE if it is a alphanumeric character or a numeric character (a-z, A-Z or 0-9).&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideCharUpper&#039;&#039;&#039;(const WC: WideChar): WideChar; &lt;br /&gt;
| Returns a UPPERCASE version of the input Unicode character. In case of non-alphabetic character, it returns the same character.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideCharLower&#039;&#039;&#039;(const WC: WideChar): WideChar; &lt;br /&gt;
| Returns a lowercase version of the input Unicode character. In case of non-alphabetic character, it returns the same character.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Character classifications, such as C1_UPPER, C1_LOWER, C1_DIGIT, C1_SPACE, C1_PUNCT, C1_CNTRL, C1_BLANK, C1_XDIGIT, C1_ALPHA - are part of Unicode definitions. More information regarding classification can be found on the internet. For example: [http://www.fileformat.info/info/unicode/ http://www.fileformat.info/info/unicode/].&lt;br /&gt;
&lt;br /&gt;
== Unicode Conversion Routines  ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Function&lt;br /&gt;
! Remarks&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideToAnsi&#039;&#039;&#039;(const WS: WideString): String; &lt;br /&gt;
| Converts a Unicode string to its ANSI version.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;AnsiToWide&#039;&#039;&#039;(const S: String): WideString; &lt;br /&gt;
| Converts a ANSI string to its Unicode version.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;UTF8Encode&#039;&#039;&#039;(const WS: WideString): String; &lt;br /&gt;
| Convert Unicode string to the UTF-8 encoded string. Useful to storing Unicode strings in files.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;UTF8Decode&#039;&#039;&#039;(const S: String): WideString;&lt;br /&gt;
| Convert UTF-8 encoded string to its full Unicode representation.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Basic Conversion Routines  ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Function&lt;br /&gt;
! Remarks&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IntToStr&#039;&#039;&#039;(Value: Integer): String; &lt;br /&gt;
| Converts an integer to a string. The following assumptions are correct:&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-family: monospace&amp;quot;&amp;gt;&lt;br /&gt;
* IntToStr(123) = &#039;123&#039;&lt;br /&gt;
* IntToStr(0123) = &#039;123&#039;&lt;br /&gt;
* IntToStr(123) &amp;lt;&amp;gt; &#039;0123&#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;StrToInt&#039;&#039;&#039;(const S: String): Integer; &lt;br /&gt;
| Converts a string to an integer. The following equality is correct:&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-family: monospace&amp;quot;&amp;gt;&lt;br /&gt;
* StrToInt(&#039;123&#039;) = 123&lt;br /&gt;
* StrToInt(&#039;123&#039;) = 0123&lt;br /&gt;
* StrToInt(&#039;0123&#039;) = 123&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Warning:&#039;&#039;&#039; An error will occur if the parameter to this function cannot be converted to an integer!&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;StrToIntDef&#039;&#039;&#039;(const S: String; const Default: Integer): Integer; &lt;br /&gt;
| Behaves like &#039;&#039;&#039;StrToInt&#039;&#039;&#039; function, but instead of producing an error on incorrect input function allows the &#039;&#039;&#039;Default&#039;&#039;&#039; value to be specified, which will be returned if the input cannot be converted to an integer.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;DateToStr&#039;&#039;&#039;(D: TDateTime): String; &lt;br /&gt;
| Converts a date to a string, using system format for the short date, for example: &#039;&#039;&#039;dd/mm/yyyy&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;StrToDate&#039;&#039;&#039;(const S: String): TDateTime; &lt;br /&gt;
| Converts a date string to a proper TDateTime value, using system format for the short date, for example: &#039;&#039;&#039;dd/mm/yyyy&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IntToHex&#039;&#039;&#039;(Value: Integer; Digits: Integer): String; &lt;br /&gt;
| Converts an integer to its hexadecimal representation. Here are samples:&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-family: monospace&amp;quot;&amp;gt;&lt;br /&gt;
* IntToHex(1234, 1) = &#039;4D2&#039;&lt;br /&gt;
* IntToHex(1234, 8) = &#039;000004D2&#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;HexToInt&#039;&#039;&#039;(const HexNum: String): Integer; &lt;br /&gt;
| Converts a hexadecimal value to its decimal representation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning:&#039;&#039;&#039; An error will occur if the parameter to this function cannot be converted to an integer!&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;HexToIntDef&#039;&#039;&#039;(const HexNum: String; Default: Integer): Integer; &lt;br /&gt;
| Behaves like &#039;&#039;&#039;HexToInt&#039;&#039;&#039; function, but instead of producing an error on incorrect input function allows the &#039;&#039;&#039;Default&#039;&#039;&#039; value to be specified, which will be returned if the input cannot be converted to an integer.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;Ord&#039;&#039;&#039;(X: Char): Byte; &lt;br /&gt;
| Return an ordinal value (byte representation) of a character.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;Chr&#039;&#039;&#039;(X: Byte): Char; &lt;br /&gt;
| Return a character by its ordinal value (byte representation).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Date And Time Routines ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Function&lt;br /&gt;
! Remarks&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;Date&#039;&#039;&#039;: TDateTime; &lt;br /&gt;
| Returns the current system date.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;Time&#039;&#039;&#039;: TDateTime; &lt;br /&gt;
| Returns the current system time.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;Now&#039;&#039;&#039;: TDateTime; &lt;br /&gt;
| Returns the current system date and time.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;EncodeDate&#039;&#039;&#039;(Year, Month, Day: Word): TDateTime; &lt;br /&gt;
| Generates date value for the specified &#039;&#039;&#039;Year&#039;&#039;&#039;, &#039;&#039;&#039;Month&#039;&#039;&#039;, &#039;&#039;&#039;Day&#039;&#039;&#039;. Parameters must be within a valid date range: Year = 0..9999, Month = 1..12, Day = 1..31 (depending on month/year). An error will be raised if parameters are invalid.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;EncodeTime&#039;&#039;&#039;(Hour, Min, Sec, MSec: Word): TDateTime; &lt;br /&gt;
| Generates time value for the specified &#039;&#039;&#039;Hour&#039;&#039;&#039;, &#039;&#039;&#039;Min&#039;&#039;&#039;, &#039;&#039;&#039;Sec&#039;&#039;&#039;, &#039;&#039;&#039;MSec&#039;&#039;&#039;. Parameters must be within a valid time range: Hour = 0..23, Min = 0..59, Sec = 0..59, MSec = 0..999. An error will be raised if parameters are invalid.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;TryEncodeDate&#039;&#039;&#039;(Year, Month, Day: Word; var Date: TDateTime): Boolean; &lt;br /&gt;
| Behaves exactly like &#039;&#039;&#039;EncodeDate&#039;&#039;&#039; function, except this function returns the TRUE or FALSE depending on the success of the operation. If operation was successful, function will return TRUE and the generated date value will be written in the &#039;&#039;&#039;Date&#039;&#039;&#039; variable.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;TryEncodeTime&#039;&#039;&#039;(Hour, Min, Sec, MSec: Word; var Time: TDateTime): Boolean; &lt;br /&gt;
| Behaves exactly like &#039;&#039;&#039;EncodeTime&#039;&#039;&#039; function, except this function returns the TRUE or FALSE depending on the success of the operation. If operation was successful, function will return TRUE and the generated time value will be written in the &#039;&#039;&#039;Time&#039;&#039;&#039; variable.&lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;DecodeDate&#039;&#039;&#039;(const DateTime: TDateTime; var Year, Month, Day: Word); &lt;br /&gt;
| Extracts &#039;&#039;&#039;Year&#039;&#039;&#039;, &#039;&#039;&#039;Month&#039;&#039;&#039; and &#039;&#039;&#039;Day&#039;&#039;&#039; components from a given &#039;&#039;&#039;DateTime&#039;&#039;&#039; value.&lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;DecodeTime&#039;&#039;&#039;(const DateTime: TDateTime; var Hour, Min, Sec, MSec: Word); &lt;br /&gt;
| Extracts &#039;&#039;&#039;Hour&#039;&#039;&#039;, &#039;&#039;&#039;Min&#039;&#039;&#039;, &#039;&#039;&#039;Sec&#039;&#039;&#039; and &#039;&#039;&#039;MSec&#039;&#039;&#039; components from a given &#039;&#039;&#039;DateTime&#039;&#039;&#039; value.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;DayOfWeek&#039;&#039;&#039;(const DateTime: TDateTime): Word; &lt;br /&gt;
| Returns the day of the week (as an index) for the specified &#039;&#039;&#039;DateTime&#039;&#039;&#039; value. The indexes are: 1 = Sunday, 2 = Monday, 3 = Tuesday, 4 = Wednesday, 5 = Thursday, 6 = Friday, 7 = Saturday.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;DateTimeToUnix&#039;&#039;&#039;(D: TDateTime): Int64;&lt;br /&gt;
| Converts &#039;&#039;&#039;D&#039;&#039;&#039; value of type &#039;&#039;&#039;TDateTime&#039;&#039;&#039; to a Unix timestamp.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;UnixToDateTime&#039;&#039;&#039;(U: Int64): TDateTime; &lt;br /&gt;
| Converts a Unix timestamp to a value of &#039;&#039;&#039;TDateTime&#039;&#039;&#039; type.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;FormatDateTime&#039;&#039;&#039;(const Fmt: String; D: TDateTime): String; &lt;br /&gt;
| This function provides rich formatting of a &#039;&#039;&#039;DateTime&#039;&#039;&#039; value into a string. [[ReNamer:Date and Time format|Date and time format]] is defined by the &#039;&#039;&#039;Fmt&#039;&#039;&#039; string. &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IncYear&#039;&#039;&#039;(const AValue: TDateTime;const ANumberOfYears: Integer): TDateTime; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IncMonth&#039;&#039;&#039;(const AValue: TDateTime;ANumberOfMonths: Integer): TDateTime; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IncWeek&#039;&#039;&#039;(const AValue: TDateTime; const ANumberOfWeeks: Integer): TDateTime; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IncDay&#039;&#039;&#039;(const AValue: TDateTime;const ANumberOfDays: Integer): TDateTime; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IncHour&#039;&#039;&#039;(const AValue: TDateTime;const ANumberOfHours: Int64): TDateTime; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IncMinute&#039;&#039;&#039;(const AValue: TDateTime;const ANumberOfMinutes: Int64): TDateTime; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IncSecond&#039;&#039;&#039;(const AValue: TDateTime;const ANumberOfSeconds: Int64): TDateTime; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IncMilliSecond&#039;&#039;&#039;(const AValue: TDateTime;const ANumberOfMilliSeconds: Int64): TDateTime; &lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== File Management Routines  ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Function&lt;br /&gt;
! Remarks&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideFileSize&#039;&#039;&#039;(const FileName: WideString): Int64; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideFileExists&#039;&#039;&#039;(const FileName: WideString): Boolean; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideDirectoryExists&#039;&#039;&#039;(const Directory: WideString): Boolean; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideForceDirectories&#039;&#039;&#039;(Dir: WideString): Boolean; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideCreateDir&#039;&#039;&#039;(const Dir: WideString): Boolean; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideDeleteFile&#039;&#039;&#039;(const FileName: WideString): Boolean; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideRenameFile&#039;&#039;&#039;(const OldName, NewName: WideString): Boolean; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideFileSearch&#039;&#039;&#039;(const Name, DirList: WideString): WideString; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideGetCurrentDir&#039;&#039;&#039;: WideString; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideSetCurrentDir&#039;&#039;&#039;(const Dir: WideString): Boolean; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;WideScanDirForFiles&#039;&#039;&#039;(Dir: WideString; var Files: TStringsArray;const Recursive, IncludeHidden, IncludeSystem: Boolean; const Mask: WideString); &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;WideScanDirForFolders&#039;&#039;&#039;(Dir: WideString; var Folders: TStringsArray;const Recursive, IncludeHidden, IncludeSystem: Boolean); &lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== File Name Utilities  ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;center&amp;quot; | &#039;&#039;&#039;Function&#039;&#039;&#039; &lt;br /&gt;
| &amp;lt;center&amp;gt;&#039;&#039;&#039;Remarks&#039;&#039;&#039;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideExtractFilePath&#039;&#039;&#039;(const FileName: WideString): WideString; &lt;br /&gt;
| Returns the entire path of the file &amp;lt;br&amp;gt;(starting from the drive letter)&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideExtractFileDir&#039;&#039;&#039;(const FileName: WideString): WideString; &lt;br /&gt;
| Returns the folder in which the file is located.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideExtractFileDrive&#039;&#039;&#039;(const FileName: WideString): WideString; &lt;br /&gt;
| Returns the drive letter&amp;lt;br&amp;gt;???or is it the name of the drive?&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideExtractFileName&#039;&#039;&#039;(const FileName: WideString): WideString; &lt;br /&gt;
| Returns the filename with extension. &amp;lt;br&amp;gt;(e.g. &amp;quot;FileName.txt&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideExtractBaseName&#039;&#039;&#039;(const FileName: WideString): WideString; &lt;br /&gt;
| Retusn only the file&#039; base name (but not the dot or extension). (e.g. &amp;quot;FileName&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideExtractFileExt&#039;&#039;&#039;(const FileName: WideString): WideString; &lt;br /&gt;
| Returns the file&#039;s extension only (e.g. &amp;quot;txt&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideChangeFileExt&#039;&#039;&#039;(const FileName, Extension: WideString): WideString; &lt;br /&gt;
| Replaces the original extension, and returns the new filename with extension. (e.g. &amp;quot;FineName.txt&amp;quot; -&amp;amp;gt; &amp;quot;FineName.pdf&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideStripExtension&#039;&#039;&#039;(const FileName: WideString): WideString; &lt;br /&gt;
| Strips off the extension from the filename.&amp;lt;br&amp;gt;??? what does it return?&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideExpandFileName&#039;&#039;&#039;(const FileName: WideString): WideString; &lt;br /&gt;
| &amp;amp;nbsp;???&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideExtractRelativePath&#039;&#039;&#039;(const BaseName, DestName: WideString): WideString; &lt;br /&gt;
| &lt;br /&gt;
Given two files lacated in two different folders, returns the relative path of &#039;&#039;&#039;DestName&#039;&#039;&#039; file with respect to the &#039;&#039;&#039;BaseName&#039;&#039;&#039; file. &lt;br /&gt;
&lt;br /&gt;
e.g. If we input these two filenames: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;D:\Folder1\FileName1.txt&#039;&#039;&#039;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; (The base file)&amp;lt;br&amp;gt;&#039;&#039;&#039;D:\Folder2\Folder22\FileName2.pdf&#039;&#039;&#039;&amp;amp;nbsp;&amp;amp;nbsp; (The destination file) &lt;br /&gt;
&lt;br /&gt;
Then the relative path of the destination file is-&amp;lt;br&amp;gt;&#039;&#039;&#039;..\Folder2\Folder22\FileName2.pdf&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideExtractShortPathName&#039;&#039;&#039;(const FileName: WideString): WideString; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideIncludeTrailingPathDelimiter&#039;&#039;&#039;(const S: WideString): WideString; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideExcludeTrailingPathDelimiter&#039;&#039;&#039;(const S: WideString): WideString; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideSameFileName&#039;&#039;&#039;(const S1, S2: WideString): Boolean; &lt;br /&gt;
| Compares the filenames &#039;&#039;&#039;S1&#039;&#039;&#039; and &#039;&#039;&#039;S2&#039;&#039;&#039;, and returns TRUE if they are identical.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideGetEnvironmentVar&#039;&#039;&#039;(const VarName: WideString): WideString; &lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== File Read/Write Routines  ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;center&amp;quot; | &#039;&#039;&#039;Function&#039;&#039;&#039; &lt;br /&gt;
| &amp;lt;center&amp;gt;&#039;&#039;&#039;Remarks&#039;&#039;&#039;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;FileReadFragment&#039;&#039;&#039;(const FileName: WideString; Start, Length: Integer): String; &lt;br /&gt;
| Starting at &#039;&#039;Start&#039;&#039;, reads &#039;&#039;Length&#039;&#039; number of bytes of the file &#039;&#039;FileName&#039;&#039; as raw data.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;FileReadLine&#039;&#039;&#039;(const FileName: WideString; LineNum: Integer): String; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;FileCountLines&#039;&#039;&#039;(const FileName: WideString): Integer; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;FileReadContent&#039;&#039;&#039;(const FileName: WideString): String; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;FileWriteContent&#039;&#039;&#039;(const FileName: WideString; const Content: String); &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;FileAppendContent&#039;&#039;&#039;(const FileName: WideString; const Content: String); &lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== File Properties Routines  ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;center&amp;quot; | &#039;&#039;&#039;Function&#039;&#039;&#039; &lt;br /&gt;
| &amp;lt;center&amp;gt;&#039;&#039;&#039;Remarks&#039;&#039;&#039;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;FileTimeModified&#039;&#039;&#039;(const FileName: WideString): TDateTime; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;FileTimeCreated&#039;&#039;&#039;(const FileName: WideString): TDateTime; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;SetFileTimeCreated&#039;&#039;&#039;(const FileName: WideString;const DateTime: TDateTime): Boolean; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;SetFileTimeModified&#039;&#039;&#039;(const FileName: WideString;const DateTime: TDateTime): Boolean; &lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== Process Execution Routines  ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;center&amp;quot; | &#039;&#039;&#039;Function&#039;&#039;&#039; &lt;br /&gt;
| &amp;lt;center&amp;gt;&#039;&#039;&#039;Remarks&#039;&#039;&#039;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;ShellOpenFile&#039;&#039;&#039;(const FileName: WideString): Boolean; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;ExecuteProgram&#039;&#039;&#039;(const Command: String; WaitForProgram: Boolean): Cardinal; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;ExecConsoleApp&#039;&#039;&#039;(const CommandLine: String; out Output: String): Cardinal; &lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== Interactive Dialogs  ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;center&amp;quot; | &#039;&#039;&#039;Function&#039;&#039;&#039; &lt;br /&gt;
| &amp;lt;center&amp;gt;&#039;&#039;&#039;Remarks&#039;&#039;&#039;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;ShowMessage&#039;&#039;&#039;(const Msg: String); &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;WideShowMessage&#039;&#039;&#039;(const Msg: WideString); &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;DialogYesNo&#039;&#039;&#039;(const Msg: String): Boolean; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideDialogYesNo&#039;&#039;&#039;(const Msg: WideString): Boolean; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;InputBox&#039;&#039;&#039;(const ACaption, APrompt, ADefault: String): String; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;InputQuery&#039;&#039;&#039;(const ACaption, APrompt: String; var Value: String): Boolean; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideInputBox&#039;&#039;&#039;(const ACaption, APrompt, ADefault: WideString): WideString; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideInputQuery&#039;&#039;&#039;(const ACaption, APrompt: WideString;var Value: WideString): Boolean; &lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== Other Routines  ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;center&amp;quot; | &#039;&#039;&#039;Function&#039;&#039;&#039; &lt;br /&gt;
| &amp;lt;center&amp;gt;&#039;&#039;&#039;Remarks&#039;&#039;&#039;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;Randomize&#039;&#039;&#039;(); &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;Sleep&#039;&#039;&#039;(Milliseconds: Cardinal); &lt;br /&gt;
| Sleeps (waits) for specified miliseconds&lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;DivMod&#039;&#039;&#039;(Dividend: Integer; Divisor: Word; var Result, Remainder: Word); &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;SetClipboardText&#039;&#039;&#039;(const S: WideString); &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;GetClipboardText&#039;&#039;&#039;: WideString; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;RandomRange&#039;&#039;&#039;(const AFrom, ATo: Integer): Integer; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;Base64Encode&#039;&#039;&#039;(const S: String): String; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;Base64Decode&#039;&#039;&#039;(const S: String): String; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;GetTickCount&#039;&#039;&#039;: Cardinal; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;SizeOf&#039;&#039;&#039;(X): Integer; &lt;br /&gt;
| &lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Prologician</name></author>
	</entry>
	<entry>
		<id>https://www.den4b.com/w/index.php?title=ReNamer:Pascal_Script:Functions&amp;diff=1047</id>
		<title>ReNamer:Pascal Script:Functions</title>
		<link rel="alternate" type="text/html" href="https://www.den4b.com/w/index.php?title=ReNamer:Pascal_Script:Functions&amp;diff=1047"/>
		<updated>2009-08-02T09:54:42Z</updated>

		<summary type="html">&lt;p&gt;Prologician: /* File Read/Write Routines */  Description for FileReadFragment()&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction  ==&lt;br /&gt;
&lt;br /&gt;
ReNamer has many [http://www.taoyue.com/tutorials/pascal/pas4a.html procedures] and [http://www.taoyue.com/tutorials/pascal/pas4c.html functions] to manipulate the entities related to file names. These entities may be derived from the existing filename, path, system date, meta tags from the file, strings entered by the user, etc.&lt;br /&gt;
&lt;br /&gt;
A common prefix &#039;&#039;&#039;Wide&#039;&#039;&#039; in the function name indicates that the function deals with [http://en.wikipedia.org/wiki/Unicode Unicode] strings (WideString). The prefix is used because there are similar functions which deal with Ansi strings and in some cases simply for internal consistency. For example: &#039;&#039;&#039;ShowMessage&#039;&#039;&#039; and &#039;&#039;&#039;WideShowMessage&#039;&#039;&#039; procedures.&lt;br /&gt;
&lt;br /&gt;
*??? What is T prefix? &lt;br /&gt;
*??? What is UTF8?&lt;br /&gt;
&lt;br /&gt;
== Basic String Handling Routines  ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Routine&lt;br /&gt;
! Remarks&lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;Insert&#039;&#039;&#039;(Source: String; var S: String; Index: Integer); &lt;br /&gt;
| Inserts the string &#039;&#039;&#039;S&#039;&#039;&#039; into string &#039;&#039;&#039;Source&#039;&#039;&#039; at position &#039;&#039;&#039;Index&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;Delete&#039;&#039;&#039;(var S: String; Index, Count: Integer); &lt;br /&gt;
| Deletes &#039;&#039;&#039;Count&#039;&#039;&#039; characters from the string &#039;&#039;&#039;S&#039;&#039;&#039;, starting from position &#039;&#039;&#039;Index&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;Copy&#039;&#039;&#039;(S: String; Index, Count: Integer): String; &lt;br /&gt;
| Copies &#039;&#039;&#039;Count&#039;&#039;&#039; characters from string &#039;&#039;&#039;S&#039;&#039;&#039;, starting at position &#039;&#039;&#039;Index&#039;&#039;&#039;, and returns them as a new string.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;Pos&#039;&#039;&#039;(Substr: String; S: String): Integer; &lt;br /&gt;
| Returns the position of a string &#039;&#039;&#039;Substr&#039;&#039;&#039; in another string &#039;&#039;&#039;S&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Indexes of characters in strings are 1 based, so first character in string S would be S[1].&lt;br /&gt;
&lt;br /&gt;
== Length Managing Routines  ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Routine&lt;br /&gt;
! Remarks&lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;SetLength&#039;&#039;&#039;(var S: Array; NewLength: Integer); &lt;br /&gt;
| Sets the length of array variable &#039;&#039;&#039;S&#039;&#039;&#039; to &#039;&#039;&#039;NewLength&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;SetLength&#039;&#039;&#039;(var S: String; NewLength: Integer); &lt;br /&gt;
| Sets the length of string variable &#039;&#039;&#039;S&#039;&#039;&#039; to &#039;&#039;&#039;NewLength&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;SetLength&#039;&#039;&#039;(var S: WideString; NewLength: Integer); &lt;br /&gt;
| Sets the length of widestring &#039;&#039;&#039;S&#039;&#039;&#039; to &#039;&#039;&#039;NewLength&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;Length&#039;&#039;&#039;(const S: Array): Integer; &lt;br /&gt;
| Returns the length of array &#039;&#039;&#039;S &#039;&#039;&#039; (number of elements).&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;Length&#039;&#039;&#039;(const S: String): Integer; &lt;br /&gt;
| Returns the length of string &#039;&#039;&#039;S&#039;&#039;&#039; (number of characters).&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;Length&#039;&#039;&#039;(const S: WideString): Integer;&lt;br /&gt;
| Returns the length of WideString &#039;&#039;&#039;S&#039;&#039;&#039; (number of characters).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Unicode String Handling Routines ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Routine&lt;br /&gt;
! Remarks&lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;WideInsert&#039;&#039;&#039;(const Substr: WideString; var Dest: WideString; Index: Integer); &lt;br /&gt;
| Inserts &#039;&#039;&#039;Substr&#039;&#039;&#039; in &#039;&#039;&#039;Dest&#039;&#039;&#039; at position &#039;&#039;&#039;Index&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;WideDelete&#039;&#039;&#039;(var S: WideString; Index, Count: Integer); &lt;br /&gt;
| Deletes &#039;&#039;&#039;Count&#039;&#039;&#039; characters from &#039;&#039;&#039;S&#039;&#039;&#039;, starting from the &#039;&#039;&#039;Index&#039;&#039;&#039; position.&lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;WideSetLength&#039;&#039;&#039;(var S: WideString; NewLength: Integer); &lt;br /&gt;
| Change the length of string &#039;&#039;&#039;S&#039;&#039;&#039; to a new length specified by &#039;&#039;&#039;NewLength&#039;&#039;&#039;. If new length is smaller than original, the string is truncated. If new length is greater than original, the string will be expanded but additional characters will not be initialized and can be anything.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideLength&#039;&#039;&#039;(const S: WideString): Integer; &lt;br /&gt;
| Returns the length of WideString &#039;&#039;&#039;S&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideCopy&#039;&#039;&#039;(const S: WideString; Index, Count: Integer): WideString; &lt;br /&gt;
| Returns &#039;&#039;&#039;Count&#039;&#039;&#039; characters from WideString &#039;&#039;&#039;S&#039;&#039;&#039;, starting at position &#039;&#039;&#039;Index&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WidePos&#039;&#039;&#039;(const SubStr, S: WideString): Integer; &lt;br /&gt;
| Find and occurrence of &#039;&#039;&#039;SubStr&#039;&#039;&#039; in &#039;&#039;&#039;S&#039;&#039;&#039;. Returns the position of first occurrence, or &#039;&#039;&#039;0&#039;&#039;&#039; if nothing was found.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WidePosEx&#039;&#039;&#039;(const SubStr, S: WideString; Offset: Cardinal): Integer; &lt;br /&gt;
| Find and occurrence of &#039;&#039;&#039;SubStr&#039;&#039;&#039; in &#039;&#039;&#039;S&#039;&#039;&#039; but start searching from position specified by &#039;&#039;&#039;Offset&#039;&#039;&#039;. Returns the position of first occurrence, or &#039;&#039;&#039;0&#039;&#039;&#039; if nothing was found.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideUpperCase&#039;&#039;&#039;(const S: WideString): WideString; &lt;br /&gt;
| Returns the ALLCAPS version of the WideString &#039;&#039;&#039;S&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideLowerCase&#039;&#039;&#039;(const S: WideString): WideString; &lt;br /&gt;
| Returns the lowercase version of the WideString &#039;&#039;&#039;S&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideCompareStr&#039;&#039;&#039;(const S1, S2: WideString): Integer; &lt;br /&gt;
| Compares two WideStrings &#039;&#039;&#039;S1&#039;&#039;&#039; and &#039;&#039;&#039;S2&#039;&#039;&#039;, case-sensitive, and returns an integer based on the result. The return value is less than 0 if S1 is less than S2, 0 if S1 equals S2, or greater than 0 if S1 is greater than S2.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideCompareText&#039;&#039;&#039;(const S1, S2: WideString): Integer; &lt;br /&gt;
| Compares two WideStrings &#039;&#039;&#039;S1&#039;&#039;&#039; and &#039;&#039;&#039;S2&#039;&#039;&#039;, case-insensitive, and returns an integer based on the result. The return value is less than 0 if S1 is less than S2, 0 if S1 equals S2, or greater than 0 if S1 is greater than S2.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideSameText&#039;&#039;&#039;(const S1, S2: WideString): Boolean; &lt;br /&gt;
| Compares two WideStrings &#039;&#039;&#039;S1&#039;&#039;&#039; and &#039;&#039;&#039;S2&#039;&#039;&#039;. Returns TRUE if both are identical, otherwise returns FALSE.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideTextPos&#039;&#039;&#039;(const SubStr, S: WideString): Integer; &lt;br /&gt;
| Behaves like &#039;&#039;&#039;WidePos&#039;&#039;&#039; function, except text if processed in case-insensitive manner.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideTrim&#039;&#039;&#039;(const S: WideString): WideString; &lt;br /&gt;
| Removes leading and trailing spaces and control characters from the given string &#039;&#039;&#039;S&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideReplaceStr&#039;&#039;&#039;(const S, OldPattern, NewPattern: WideString): WideString; &lt;br /&gt;
| &amp;amp;nbsp;???&amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideReplaceText&#039;&#039;&#039;(const S, OldPattern, NewPattern: WideString): WideString; &lt;br /&gt;
| &amp;amp;nbsp;???&amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideSplitString&#039;&#039;&#039;(const Input, Delimiter: WideString): TStringsArray; &lt;br /&gt;
| &lt;br /&gt;
Splits the WideString &#039;&#039;&#039;Input &#039;&#039;&#039;wherever &#039;&#039;&#039;Delimiter&#039;&#039;&#039; occurs, and returns an array that contains the split parts. &lt;br /&gt;
&lt;br /&gt;
*The &#039;&#039;&#039;Delimiter&#039;&#039;&#039; itself can be a multi-character WideString. &amp;lt;br&amp;gt;(Unlike the usual comma, hyphen or space that is used for this purpose) &lt;br /&gt;
*The split parts (returned as elements of the array) do not contain the &#039;&#039;&#039;Delimiter&#039;&#039;&#039; WideString&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideCaseCapitalize&#039;&#039;&#039;(const S: WideString): WideString; &lt;br /&gt;
| &lt;br /&gt;
Returns the &#039;&#039;Sentence case&#039;&#039; version of the WideString &#039;&#039;&#039;S&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
Only the first alphabetic character is capitalized. All other alphabetic characters are converted to lowercase.&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*If &#039;&#039;&#039;S&#039;&#039;&#039; begins with numeric characters, the first alphabetic character that follows will be capitalized.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideCaseInvert&#039;&#039;&#039;(const S: WideString): WideString; &lt;br /&gt;
| Inverts the case of all characters in the WideString &#039;&#039;&#039;S&#039;&#039;&#039; and returns the WideString.&amp;lt;br&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Meta Tags Extraction  ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Function&lt;br /&gt;
! Remarks&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;CalculateMetaTag&#039;&#039;&#039;(const FilePath: WideString; const MetaTagName String): String; &lt;br /&gt;
| Extracts and returns the value of a metatag specified by &#039;&#039;&#039;MetaTagName&#039;&#039;&#039; from the file specified by the complete absolute path &#039;&#039;&#039;FilePath&#039;&#039;&#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For example, to extract &#039;&#039;&#039;EXIF_Date&#039;&#039;&#039; tag from an image and set it to the filename, one can use something like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
begin&lt;br /&gt;
  FileName := CalculateMetaTag(FilePath, &#039;EXIF_Date&#039;);&lt;br /&gt;
end.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The full list of meta tags can be found in [[ReNamer:Meta Tags|Meta Tags]] article.&lt;br /&gt;
&lt;br /&gt;
== Regular Expressions  ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Function&lt;br /&gt;
! Remarks&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;ReplaceRegEx&#039;&#039;&#039;(const Input, Find, Replace: WideString;const CaseSensitive, UseSubstitution: Boolean): WideString; &lt;br /&gt;
| Find-and-replace function using RegEx. Works like [[ReNamer:Rules:RegEx|RegEx rule]].&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;MatchesRegEx&#039;&#039;&#039;(const Input, Find: WideString;const CaseSensitive: Boolean): TStringsArray; &lt;br /&gt;
| Returns a list of RegEx matches as an array. Function returns an array of full matches, which matched the entire expression, not the sub-patterns.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;SubMatchesRegEx&#039;&#039;&#039;(const Input, Find: WideString;const CaseSensitive: Boolean): TStringsArray; &lt;br /&gt;
| This function is very similar to &#039;&#039;&#039;MatchesRegEx&#039;&#039;&#039;, but instead of returning full expression matches it will return an array of sub-expression matches for the first full expression match. For example, &#039;&#039;&#039;SubMatchesRegEx(&#039;one two three&#039;, &#039;(.*) (.*) (.*)&#039;)&#039;&#039;&#039; will return an array &#039;&#039;&#039;[&#039;one&#039;, &#039;two&#039;, &#039;three&#039;]&#039;&#039;&#039;. In this way, it can easily be combined with &#039;&#039;&#039;MatchesRegEx&#039;&#039;&#039; function, to allow users to find all global matches, and then parse those matches through &#039;&#039;&#039;SubMatchesRegEx&#039;&#039;&#039; function to find individual sub-expression matches of each global match.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
General parameters of the functions: &lt;br /&gt;
&lt;br /&gt;
* Input - The WideString that is input to the function. &lt;br /&gt;
* Find - RegEx pattern to be found (same as &#039;&#039;&#039;Expression&#039;&#039;&#039; field in the [[ReNamer:Rules:RegEx|RegEx rule]]).&lt;br /&gt;
* Replace - Replacement string (same as the &#039;&#039;&#039;Replace&#039;&#039;&#039; field in the [[ReNamer:Rules:RegEx|RegEx rule]]).&lt;br /&gt;
* CaseSensitive - Specifies whether to process in a case-sensitive mode.&lt;br /&gt;
* UseSubstitution - Determines whether use [[ReNamer:Regular Expressions#Backreferences|backreferences]] in the result.&lt;br /&gt;
&lt;br /&gt;
== Unicode Character Handling Routines  ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Function&lt;br /&gt;
! Remarks&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IsWideCharUpper&#039;&#039;&#039;(WC: WideChar): Boolean; &lt;br /&gt;
| Checks a Unicode character &#039;&#039;&#039;WC&#039;&#039;&#039; and returns TRUE if it is in UPPERCASE.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IsWideCharLower&#039;&#039;&#039;(WC: WideChar): Boolean; &lt;br /&gt;
| Checks a Unicode character &#039;&#039;&#039;WC&#039;&#039;&#039; and returns TRUE if it is in lowercase.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IsWideCharDigit&#039;&#039;&#039;(WC: WideChar): Boolean; &lt;br /&gt;
| Checks a Unicode character &#039;&#039;&#039;WC&#039;&#039;&#039; and returns TRUE if it is a digit (numeric character 0-9). &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IsWideCharSpace&#039;&#039;&#039;(WC: WideChar): Boolean; &lt;br /&gt;
| Checks a Unicode character &#039;&#039;&#039;WC&#039;&#039;&#039; and returns TRUE if it is a white-space character, such as: space, form-feed, newline, carriage-return, tab and vertical-tab (characters classified as C1_SPACE).&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IsWideCharPunct&#039;&#039;&#039;(WC: WideChar): Boolean; &lt;br /&gt;
| Checks a Unicode character &#039;&#039;&#039;WC&#039;&#039;&#039; and returns TRUE if it is a punctuation mark (characters classified as C1_PUNCT).&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IsWideCharCntrl&#039;&#039;&#039;(WC: WideChar): Boolean; &lt;br /&gt;
| Checks a Unicode character &#039;&#039;&#039;WC&#039;&#039;&#039; and returns TRUE if it is a control character (characters classified as C1_CNTRL).&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IsWideCharBlank&#039;&#039;&#039;(WC: WideChar): Boolean; &lt;br /&gt;
| Checks a Unicode character &#039;&#039;&#039;WC&#039;&#039;&#039; and returns TRUE if it is a blank, such as: space and tab (characters classified as C1_BLANK).&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IsWideCharXDigit&#039;&#039;&#039;(WC: WideChar): Boolean; &lt;br /&gt;
| Checks a Unicode character &#039;&#039;&#039;WC&#039;&#039;&#039; and returns TRUE if it is a hexadecimal digit (0-9 or A-F).&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IsWideCharAlpha&#039;&#039;&#039;(WC: WideChar): Boolean; &lt;br /&gt;
| Checks a Unicode character &#039;&#039;&#039;WC&#039;&#039;&#039; and returns TRUE if it is a alphanumeric character (a-z or A-Z).&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IsWideCharAlphaNumeric&#039;&#039;&#039;(WC: WideChar): Boolean; &lt;br /&gt;
| Checks a Unicode character &#039;&#039;&#039;WC&#039;&#039;&#039; and returns TRUE if it is a alphanumeric character or a numeric character (a-z, A-Z or 0-9).&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideCharUpper&#039;&#039;&#039;(const WC: WideChar): WideChar; &lt;br /&gt;
| Returns a UPPERCASE version of the input Unicode character. In case of non-alphabetic character, it returns the same character.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideCharLower&#039;&#039;&#039;(const WC: WideChar): WideChar; &lt;br /&gt;
| Returns a lowercase version of the input Unicode character. In case of non-alphabetic character, it returns the same character.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Character classifications, such as C1_UPPER, C1_LOWER, C1_DIGIT, C1_SPACE, C1_PUNCT, C1_CNTRL, C1_BLANK, C1_XDIGIT, C1_ALPHA - are part of Unicode definitions. More information regarding classification can be found on the internet. For example: [http://www.fileformat.info/info/unicode/ http://www.fileformat.info/info/unicode/].&lt;br /&gt;
&lt;br /&gt;
== Unicode Conversion Routines  ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Function&lt;br /&gt;
! Remarks&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideToAnsi&#039;&#039;&#039;(const WS: WideString): String; &lt;br /&gt;
| Converts a Unicode string to its ANSI version.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;AnsiToWide&#039;&#039;&#039;(const S: String): WideString; &lt;br /&gt;
| Converts a ANSI string to its Unicode version.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;UTF8Encode&#039;&#039;&#039;(const WS: WideString): String; &lt;br /&gt;
| Convert Unicode string to the UTF-8 encoded string. Useful to storing Unicode strings in files.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;UTF8Decode&#039;&#039;&#039;(const S: String): WideString;&lt;br /&gt;
| Convert UTF-8 encoded string to its full Unicode representation.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Basic Conversion Routines  ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Function&lt;br /&gt;
! Remarks&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IntToStr&#039;&#039;&#039;(Value: Integer): String; &lt;br /&gt;
| Converts an integer to a string. The following assumptions are correct:&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-family: monospace&amp;quot;&amp;gt;&lt;br /&gt;
* IntToStr(123) = &#039;123&#039;&lt;br /&gt;
* IntToStr(0123) = &#039;123&#039;&lt;br /&gt;
* IntToStr(123) &amp;lt;&amp;gt; &#039;0123&#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;StrToInt&#039;&#039;&#039;(const S: String): Integer; &lt;br /&gt;
| Converts a string to an integer. The following equality is correct:&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-family: monospace&amp;quot;&amp;gt;&lt;br /&gt;
* StrToInt(&#039;123&#039;) = 123&lt;br /&gt;
* StrToInt(&#039;123&#039;) = 0123&lt;br /&gt;
* StrToInt(&#039;0123&#039;) = 123&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Warning:&#039;&#039;&#039; An error will occur if the parameter to this function cannot be converted to an integer!&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;StrToIntDef&#039;&#039;&#039;(const S: String; const Default: Integer): Integer; &lt;br /&gt;
| Behaves like &#039;&#039;&#039;StrToInt&#039;&#039;&#039; function, but instead of producing an error on incorrect input function allows the &#039;&#039;&#039;Default&#039;&#039;&#039; value to be specified, which will be returned if the input cannot be converted to an integer.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;DateToStr&#039;&#039;&#039;(D: TDateTime): String; &lt;br /&gt;
| Converts a date to a string, using system format for the short date, for example: &#039;&#039;&#039;dd/mm/yyyy&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;StrToDate&#039;&#039;&#039;(const S: String): TDateTime; &lt;br /&gt;
| Converts a date string to a proper TDateTime value, using system format for the short date, for example: &#039;&#039;&#039;dd/mm/yyyy&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IntToHex&#039;&#039;&#039;(Value: Integer; Digits: Integer): String; &lt;br /&gt;
| Converts an integer to its hexadecimal representation. Here are samples:&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-family: monospace&amp;quot;&amp;gt;&lt;br /&gt;
* IntToHex(1234, 1) = &#039;4D2&#039;&lt;br /&gt;
* IntToHex(1234, 8) = &#039;000004D2&#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;HexToInt&#039;&#039;&#039;(const HexNum: String): Integer; &lt;br /&gt;
| Converts a hexadecimal value to its decimal representation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning:&#039;&#039;&#039; An error will occur if the parameter to this function cannot be converted to an integer!&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;HexToIntDef&#039;&#039;&#039;(const HexNum: String; Default: Integer): Integer; &lt;br /&gt;
| Behaves like &#039;&#039;&#039;HexToInt&#039;&#039;&#039; function, but instead of producing an error on incorrect input function allows the &#039;&#039;&#039;Default&#039;&#039;&#039; value to be specified, which will be returned if the input cannot be converted to an integer.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;Ord&#039;&#039;&#039;(X: Char): Byte; &lt;br /&gt;
| Return an ordinal value (byte representation) of a character.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;Chr&#039;&#039;&#039;(X: Byte): Char; &lt;br /&gt;
| Return a character by its ordinal value (byte representation).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Date And Time Routines ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Function&lt;br /&gt;
! Remarks&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;Date&#039;&#039;&#039;: TDateTime; &lt;br /&gt;
| Returns the current system date.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;Time&#039;&#039;&#039;: TDateTime; &lt;br /&gt;
| Returns the current system time.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;Now&#039;&#039;&#039;: TDateTime; &lt;br /&gt;
| Returns the current system date and time.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;EncodeDate&#039;&#039;&#039;(Year, Month, Day: Word): TDateTime; &lt;br /&gt;
| Generates date value for the specified &#039;&#039;&#039;Year&#039;&#039;&#039;, &#039;&#039;&#039;Month&#039;&#039;&#039;, &#039;&#039;&#039;Day&#039;&#039;&#039;. Parameters must be within a valid date range: Year = 0..9999, Month = 1..12, Day = 1..31 (depending on month/year). An error will be raised if parameters are invalid.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;EncodeTime&#039;&#039;&#039;(Hour, Min, Sec, MSec: Word): TDateTime; &lt;br /&gt;
| Generates time value for the specified &#039;&#039;&#039;Hour&#039;&#039;&#039;, &#039;&#039;&#039;Min&#039;&#039;&#039;, &#039;&#039;&#039;Sec&#039;&#039;&#039;, &#039;&#039;&#039;MSec&#039;&#039;&#039;. Parameters must be within a valid time range: Hour = 0..23, Min = 0..59, Sec = 0..59, MSec = 0..999. An error will be raised if parameters are invalid.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;TryEncodeDate&#039;&#039;&#039;(Year, Month, Day: Word; var Date: TDateTime): Boolean; &lt;br /&gt;
| Behaves exactly like &#039;&#039;&#039;EncodeDate&#039;&#039;&#039; function, except this function returns the TRUE or FALSE depending on the success of the operation. If operation was successful, function will return TRUE and the generated date value will be written in the &#039;&#039;&#039;Date&#039;&#039;&#039; variable.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;TryEncodeTime&#039;&#039;&#039;(Hour, Min, Sec, MSec: Word; var Time: TDateTime): Boolean; &lt;br /&gt;
| Behaves exactly like &#039;&#039;&#039;EncodeTime&#039;&#039;&#039; function, except this function returns the TRUE or FALSE depending on the success of the operation. If operation was successful, function will return TRUE and the generated time value will be written in the &#039;&#039;&#039;Time&#039;&#039;&#039; variable.&lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;DecodeDate&#039;&#039;&#039;(const DateTime: TDateTime; var Year, Month, Day: Word); &lt;br /&gt;
| Extracts &#039;&#039;&#039;Year&#039;&#039;&#039;, &#039;&#039;&#039;Month&#039;&#039;&#039; and &#039;&#039;&#039;Day&#039;&#039;&#039; components from a given &#039;&#039;&#039;DateTime&#039;&#039;&#039; value.&lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;DecodeTime&#039;&#039;&#039;(const DateTime: TDateTime; var Hour, Min, Sec, MSec: Word); &lt;br /&gt;
| Extracts &#039;&#039;&#039;Hour&#039;&#039;&#039;, &#039;&#039;&#039;Min&#039;&#039;&#039;, &#039;&#039;&#039;Sec&#039;&#039;&#039; and &#039;&#039;&#039;MSec&#039;&#039;&#039; components from a given &#039;&#039;&#039;DateTime&#039;&#039;&#039; value.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;DayOfWeek&#039;&#039;&#039;(const DateTime: TDateTime): Word; &lt;br /&gt;
| Returns the day of the week (as an index) for the specified &#039;&#039;&#039;DateTime&#039;&#039;&#039; value. The indexes are: 1 = Sunday, 2 = Monday, 3 = Tuesday, 4 = Wednesday, 5 = Thursday, 6 = Friday, 7 = Saturday.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;DateTimeToUnix&#039;&#039;&#039;(D: TDateTime): Int64;&lt;br /&gt;
| Converts &#039;&#039;&#039;D&#039;&#039;&#039; value of type &#039;&#039;&#039;TDateTime&#039;&#039;&#039; to a Unix timestamp.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;UnixToDateTime&#039;&#039;&#039;(U: Int64): TDateTime; &lt;br /&gt;
| Converts a Unix timestamp to a value of &#039;&#039;&#039;TDateTime&#039;&#039;&#039; type.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;FormatDateTime&#039;&#039;&#039;(const Fmt: String; D: TDateTime): String; &lt;br /&gt;
| This function provides rich formatting of a &#039;&#039;&#039;DateTime&#039;&#039;&#039; value into a string. [[ReNamer:Date and Time format|Date and time format]] is defined by the &#039;&#039;&#039;Fmt&#039;&#039;&#039; string. &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IncYear&#039;&#039;&#039;(const AValue: TDateTime;const ANumberOfYears: Integer): TDateTime; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IncMonth&#039;&#039;&#039;(const AValue: TDateTime;ANumberOfMonths: Integer): TDateTime; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IncWeek&#039;&#039;&#039;(const AValue: TDateTime; const ANumberOfWeeks: Integer): TDateTime; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IncDay&#039;&#039;&#039;(const AValue: TDateTime;const ANumberOfDays: Integer): TDateTime; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IncHour&#039;&#039;&#039;(const AValue: TDateTime;const ANumberOfHours: Int64): TDateTime; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IncMinute&#039;&#039;&#039;(const AValue: TDateTime;const ANumberOfMinutes: Int64): TDateTime; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IncSecond&#039;&#039;&#039;(const AValue: TDateTime;const ANumberOfSeconds: Int64): TDateTime; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IncMilliSecond&#039;&#039;&#039;(const AValue: TDateTime;const ANumberOfMilliSeconds: Int64): TDateTime; &lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== File Management Routines  ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Function&lt;br /&gt;
! Remarks&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideFileSize&#039;&#039;&#039;(const FileName: WideString): Int64; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideFileExists&#039;&#039;&#039;(const FileName: WideString): Boolean; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideDirectoryExists&#039;&#039;&#039;(const Directory: WideString): Boolean; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideForceDirectories&#039;&#039;&#039;(Dir: WideString): Boolean; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideCreateDir&#039;&#039;&#039;(const Dir: WideString): Boolean; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideDeleteFile&#039;&#039;&#039;(const FileName: WideString): Boolean; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideRenameFile&#039;&#039;&#039;(const OldName, NewName: WideString): Boolean; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideFileSearch&#039;&#039;&#039;(const Name, DirList: WideString): WideString; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideGetCurrentDir&#039;&#039;&#039;: WideString; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideSetCurrentDir&#039;&#039;&#039;(const Dir: WideString): Boolean; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;WideScanDirForFiles&#039;&#039;&#039;(Dir: WideString; var Files: TStringsArray;const Recursive, IncludeHidden, IncludeSystem: Boolean; const Mask: WideString); &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;WideScanDirForFolders&#039;&#039;&#039;(Dir: WideString; var Folders: TStringsArray;const Recursive, IncludeHidden, IncludeSystem: Boolean); &lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== File Name Utilities  ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;center&amp;quot; | &#039;&#039;&#039;Function&#039;&#039;&#039; &lt;br /&gt;
| &amp;lt;center&amp;gt;&#039;&#039;&#039;Remarks&#039;&#039;&#039;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideExtractFilePath&#039;&#039;&#039;(const FileName: WideString): WideString; &lt;br /&gt;
| Returns the entire path of the file &amp;lt;br&amp;gt;(starting from the drive letter)&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideExtractFileDir&#039;&#039;&#039;(const FileName: WideString): WideString; &lt;br /&gt;
| Returns the folder in which the file is located.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideExtractFileDrive&#039;&#039;&#039;(const FileName: WideString): WideString; &lt;br /&gt;
| Returns the drive letter&amp;lt;br&amp;gt;???or is it the name of the drive?&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideExtractFileName&#039;&#039;&#039;(const FileName: WideString): WideString; &lt;br /&gt;
| Returns the filename with extension. &amp;lt;br&amp;gt;(e.g. &amp;quot;FileName.txt&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideExtractBaseName&#039;&#039;&#039;(const FileName: WideString): WideString; &lt;br /&gt;
| Retusn only the file&#039; base name (but not the dot or extension). (e.g. &amp;quot;FileName&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideExtractFileExt&#039;&#039;&#039;(const FileName: WideString): WideString; &lt;br /&gt;
| Returns the file&#039;s extension only (e.g. &amp;quot;txt&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideChangeFileExt&#039;&#039;&#039;(const FileName, Extension: WideString): WideString; &lt;br /&gt;
| Replaces the original extension, and returns the new filename with extension. (e.g. &amp;quot;FineName.txt&amp;quot; -&amp;amp;gt; &amp;quot;FineName.pdf&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideStripExtension&#039;&#039;&#039;(const FileName: WideString): WideString; &lt;br /&gt;
| Strips off the extension from the filename.&amp;lt;br&amp;gt;??? what does it return?&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideExpandFileName&#039;&#039;&#039;(const FileName: WideString): WideString; &lt;br /&gt;
| &amp;amp;nbsp;???&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideExtractRelativePath&#039;&#039;&#039;(const BaseName, DestName: WideString): WideString; &lt;br /&gt;
| &lt;br /&gt;
Given two files lacated in two different folders, returns the relative path of &#039;&#039;&#039;DestName&#039;&#039;&#039; file with respect to the &#039;&#039;&#039;BaseName&#039;&#039;&#039; file. &lt;br /&gt;
&lt;br /&gt;
e.g. If we input these two filenames: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;D:\Folder1\FileName1.txt&#039;&#039;&#039;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; (The base file)&amp;lt;br&amp;gt;&#039;&#039;&#039;D:\Folder2\Folder22\FileName2.pdf&#039;&#039;&#039;&amp;amp;nbsp;&amp;amp;nbsp; (The destination file) &lt;br /&gt;
&lt;br /&gt;
Then the relative path of the destination file is-&amp;lt;br&amp;gt;&#039;&#039;&#039;..\Folder2\Folder22\FileName2.pdf&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideExtractShortPathName&#039;&#039;&#039;(const FileName: WideString): WideString; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideIncludeTrailingPathDelimiter&#039;&#039;&#039;(const S: WideString): WideString; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideExcludeTrailingPathDelimiter&#039;&#039;&#039;(const S: WideString): WideString; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideSameFileName&#039;&#039;&#039;(const S1, S2: WideString): Boolean; &lt;br /&gt;
| Compares the filenames &#039;&#039;&#039;S1&#039;&#039;&#039; and &#039;&#039;&#039;S2&#039;&#039;&#039;, and returns TRUE if they are identical.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideGetEnvironmentVar&#039;&#039;&#039;(const VarName: WideString): WideString; &lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== File Read/Write Routines  ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;center&amp;quot; | &#039;&#039;&#039;Function&#039;&#039;&#039; &lt;br /&gt;
| &amp;lt;center&amp;gt;&#039;&#039;&#039;Remarks&#039;&#039;&#039;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;FileReadFragment&#039;&#039;&#039;(const FileName: WideString; Start, Length: Integer): String; &lt;br /&gt;
| Starting at &#039;&#039;Start&#039;, reads &#039;&#039;Length&#039;&#039; number of bytes of the file &#039;&#039;FileName&#039;&#039; as raw data.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;FileReadLine&#039;&#039;&#039;(const FileName: WideString; LineNum: Integer): String; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;FileCountLines&#039;&#039;&#039;(const FileName: WideString): Integer; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;FileReadContent&#039;&#039;&#039;(const FileName: WideString): String; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;FileWriteContent&#039;&#039;&#039;(const FileName: WideString; const Content: String); &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;FileAppendContent&#039;&#039;&#039;(const FileName: WideString; const Content: String); &lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== File Properties Routines  ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;center&amp;quot; | &#039;&#039;&#039;Function&#039;&#039;&#039; &lt;br /&gt;
| &amp;lt;center&amp;gt;&#039;&#039;&#039;Remarks&#039;&#039;&#039;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;FileTimeModified&#039;&#039;&#039;(const FileName: WideString): TDateTime; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;FileTimeCreated&#039;&#039;&#039;(const FileName: WideString): TDateTime; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;SetFileTimeCreated&#039;&#039;&#039;(const FileName: WideString;const DateTime: TDateTime): Boolean; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;SetFileTimeModified&#039;&#039;&#039;(const FileName: WideString;const DateTime: TDateTime): Boolean; &lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== Process Execution Routines  ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;center&amp;quot; | &#039;&#039;&#039;Function&#039;&#039;&#039; &lt;br /&gt;
| &amp;lt;center&amp;gt;&#039;&#039;&#039;Remarks&#039;&#039;&#039;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;ShellOpenFile&#039;&#039;&#039;(const FileName: WideString): Boolean; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;ExecuteProgram&#039;&#039;&#039;(const Command: String; WaitForProgram: Boolean): Cardinal; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;ExecConsoleApp&#039;&#039;&#039;(const CommandLine: String; out Output: String): Cardinal; &lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== Interactive Dialogs  ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;center&amp;quot; | &#039;&#039;&#039;Function&#039;&#039;&#039; &lt;br /&gt;
| &amp;lt;center&amp;gt;&#039;&#039;&#039;Remarks&#039;&#039;&#039;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;ShowMessage&#039;&#039;&#039;(const Msg: String); &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;WideShowMessage&#039;&#039;&#039;(const Msg: WideString); &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;DialogYesNo&#039;&#039;&#039;(const Msg: String): Boolean; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideDialogYesNo&#039;&#039;&#039;(const Msg: WideString): Boolean; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;InputBox&#039;&#039;&#039;(const ACaption, APrompt, ADefault: String): String; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;InputQuery&#039;&#039;&#039;(const ACaption, APrompt: String; var Value: String): Boolean; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideInputBox&#039;&#039;&#039;(const ACaption, APrompt, ADefault: WideString): WideString; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideInputQuery&#039;&#039;&#039;(const ACaption, APrompt: WideString;var Value: WideString): Boolean; &lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== Other Routines  ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;prettytable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;center&amp;quot; | &#039;&#039;&#039;Function&#039;&#039;&#039; &lt;br /&gt;
| &amp;lt;center&amp;gt;&#039;&#039;&#039;Remarks&#039;&#039;&#039;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;Randomize&#039;&#039;&#039;(); &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;Sleep&#039;&#039;&#039;(Milliseconds: Cardinal); &lt;br /&gt;
| Sleeps (waits) for specified miliseconds&lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;DivMod&#039;&#039;&#039;(Dividend: Integer; Divisor: Word; var Result, Remainder: Word); &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;SetClipboardText&#039;&#039;&#039;(const S: WideString); &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;GetClipboardText&#039;&#039;&#039;: WideString; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;RandomRange&#039;&#039;&#039;(const AFrom, ATo: Integer): Integer; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;Base64Encode&#039;&#039;&#039;(const S: String): String; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;Base64Decode&#039;&#039;&#039;(const S: String): String; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;GetTickCount&#039;&#039;&#039;: Cardinal; &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;SizeOf&#039;&#039;&#039;(X): Integer; &lt;br /&gt;
| &lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Prologician</name></author>
	</entry>
</feed>