<?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=Andrew</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=Andrew"/>
	<link rel="alternate" type="text/html" href="https://www.den4b.com/wiki/Special:Contributions/Andrew"/>
	<updated>2026-06-09T17:31:34Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.10</generator>
	<entry>
		<id>https://www.den4b.com/w/index.php?title=ReNamer:Scripts:TrID&amp;diff=2300</id>
		<title>ReNamer:Scripts:TrID</title>
		<link rel="alternate" type="text/html" href="https://www.den4b.com/w/index.php?title=ReNamer:Scripts:TrID&amp;diff=2300"/>
		<updated>2012-01-03T08:02:10Z</updated>

		<summary type="html">&lt;p&gt;Andrew: /* Requirements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Up|ReNamer:Scripts}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:left; margin: 0 1em 0.2em 0&amp;quot;&amp;gt;__TOC__&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This script integrates the famous [http://mark0.net/code-tridlib-e.html TrID library] which is used for detecting file extensions. Discussions about this script and some script variants can be found in the following forum threads: [http://www.den4b.com/forum/viewtopic.php?id=550 ReNamer and TrID library for detecting file extension] and [http://www.den4b.com/forum/viewtopic.php?id=1245  ReNamer: MSI files are detected as PPT/XLS/DOC files].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; At the moment these scripts work only on ANSI filenames (non-[[Unicode]]). This is a limitation of the library, which may be addressed in later versions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear:both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
* [http://mark0.net/download/tridlib-free.zip TrIDLib.dll] in ReNamer&#039;s folder (http://mark0.net/code-tridlib-e.html)&lt;br /&gt;
* [http://mark0.net/download/triddefs.zip TrIDDefs.TRD] in ReNamer&#039;s folder (http://mark0.net/soft-trid-e.html)&lt;br /&gt;
&lt;br /&gt;
== Code: Basic ==&lt;br /&gt;
&lt;br /&gt;
Author: Denis Kozlov. Date: 16 Dec 2008. Initial version. Sets the file extension to the top matching extension. Can be easily extended.&lt;br /&gt;
&lt;br /&gt;
* Tested with ReNamer Beta from 5 Dec 2008&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source&amp;gt;&lt;br /&gt;
{ TrID Script }&lt;br /&gt;
&lt;br /&gt;
// TrID DLL exported functions&lt;br /&gt;
function TridAnalyze: integer;&lt;br /&gt;
  external &#039;TrID_Analyze@TrIDLib.dll stdcall&#039;;&lt;br /&gt;
function TridSubmitFileA(szFileName: pchar): integer;&lt;br /&gt;
  external &#039;TrID_SubmitFileA@tridlib.dll stdcall&#039;;&lt;br /&gt;
function TridLoadDefsPack(szPath: pchar): integer;&lt;br /&gt;
  external &#039;TrID_LoadDefsPack@tridlib.dll stdcall&#039;;&lt;br /&gt;
function TridGetInfo(lInfoType: integer; lInfoIdx: integer; sBuf: pchar): integer;&lt;br /&gt;
  external &#039;TrID_GetInfo@tridlib.dll stdcall&#039;;&lt;br /&gt;
&lt;br /&gt;
// Constants for TrID_GetInfo&lt;br /&gt;
const&lt;br /&gt;
  TRID_GET_RES_NUM         = 1;    // Get the number of results available&lt;br /&gt;
  TRID_GET_RES_FILETYPE    = 2;    // Filetype descriptions&lt;br /&gt;
  TRID_GET_RES_FILEEXT     = 3;    // Filetype extension&lt;br /&gt;
  TRID_GET_RES_POINTS      = 4;    // Matching points&lt;br /&gt;
  TRID_GET_VER             = 1001; // TrIDLib version (major * 100 + minor)&lt;br /&gt;
  TRID_GET_DEFSNUM         = 1004; // Number of filetypes definitions loaded&lt;br /&gt;
&lt;br /&gt;
function GetTopExtensions(Max: Integer): String;&lt;br /&gt;
var&lt;br /&gt;
  S: String;&lt;br /&gt;
  Num, I: Integer;&lt;br /&gt;
begin&lt;br /&gt;
  Result := &#039;&#039;;&lt;br /&gt;
  SetLength(S, 100);&lt;br /&gt;
  Num := TridGetInfo(TRID_GET_RES_NUM, 0, PChar(S));&lt;br /&gt;
  if Num &amp;gt; 0 then&lt;br /&gt;
  begin&lt;br /&gt;
    if Num &amp;gt; Max then&lt;br /&gt;
      Num := Max;&lt;br /&gt;
    for I:=1 to Num do&lt;br /&gt;
      begin&lt;br /&gt;
        TridGetInfo(TRID_GET_RES_FILEEXT, I, PChar(S));&lt;br /&gt;
        if I &amp;gt; 1 then Result := Result + &#039;|&#039;;       &lt;br /&gt;
        Result := Result + String(PChar(S));&lt;br /&gt;
      end;&lt;br /&gt;
  end;&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
var&lt;br /&gt;
  Initialized: Boolean;&lt;br /&gt;
&lt;br /&gt;
begin&lt;br /&gt;
  if not Initialized then&lt;br /&gt;
  begin&lt;br /&gt;
    TridLoadDefsPack(&#039;&#039;);&lt;br /&gt;
    Initialized := True;&lt;br /&gt;
  end;&lt;br /&gt;
  TridSubmitFileA(PChar(FilePath));&lt;br /&gt;
  if TridAnalyze &amp;lt;&amp;gt; 0 then&lt;br /&gt;
    FileName := WideStripExtension(FileName)+&#039;.&#039;+GetTopExtensions(1);&lt;br /&gt;
end.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Code: Advanced ==&lt;br /&gt;
&lt;br /&gt;
Author: [http://www.den4b.com/forum/profile.php?id=804 Andrew]. Date: 27 Nov 2011. An extended version by Andrew. Read comments in the script for more information.&lt;br /&gt;
&lt;br /&gt;
* Requires ReNamer 5.60+ Beta 10 or later&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source&amp;gt;&lt;br /&gt;
{ TrID Script v6 }&lt;br /&gt;
&lt;br /&gt;
// v1 - Original script by Denis&lt;br /&gt;
// v2 - Modified by Andrew to output lowercase extensions and detect presence of TrIDLib.dll and TrIDDefs.trd&lt;br /&gt;
// v3 - Modified by Andrew to keep existing extensions if not identified properly&lt;br /&gt;
// v4 - Modified by Andrew to display multiple possible extensions&lt;br /&gt;
// v5 - Modified by Andrew to display multiple possible extensions with cutoff of 20%&lt;br /&gt;
// v6 - Modified by Andrew to fix a path-related issue&lt;br /&gt;
&lt;br /&gt;
// Important: Download http://mark0.net/download/tridlib-free.zip and http://mark0.net/download/triddefs.zip,&lt;br /&gt;
// then extract TrIDLib.dll and TrIDDefs.trd to ReNamer.exe&#039;s folder/directory or else the script will fail&lt;br /&gt;
&lt;br /&gt;
// TrID DLL exported functions&lt;br /&gt;
function TridLoadDefsPack(szPath: PChar): Integer;&lt;br /&gt;
  external &#039;TrID_LoadDefsPack@TrIDLib.dll stdcall&#039;;&lt;br /&gt;
function TridSubmitFileA(szFileName: PChar): Integer;&lt;br /&gt;
  external &#039;TrID_SubmitFileA@TrIDLib.dll stdcall&#039;;&lt;br /&gt;
function TridAnalyze: Integer;&lt;br /&gt;
  external &#039;TrID_Analyze@TrIDLib.dll stdcall&#039;;&lt;br /&gt;
function TridGetInfo(lInfoType: Integer; lInfoIdx: Integer; sBuf: PChar): Integer;&lt;br /&gt;
  external &#039;TrID_GetInfo@TrIDLib.dll stdcall&#039;;&lt;br /&gt;
&lt;br /&gt;
// Constants for TrID_GetInfo etc.&lt;br /&gt;
const&lt;br /&gt;
  TRID_GET_RES_NUM     = 1;  // Get the number of results&lt;br /&gt;
  TRID_GET_RES_FILEEXT = 3;  // Filetype extension&lt;br /&gt;
  TRID_GET_RES_POINTS  = 4;  // Matching points&lt;br /&gt;
  TRID_GET_RES_CUTOFF  = 20; // Cutoff percentage for results&lt;br /&gt;
&lt;br /&gt;
function GetExtensions(): WideString;&lt;br /&gt;
var&lt;br /&gt;
  Str1, Str2: String;&lt;br /&gt;
  I, NumRes, NumPts, TotPts: Integer;&lt;br /&gt;
&lt;br /&gt;
begin&lt;br /&gt;
  Result := &#039;&#039;;&lt;br /&gt;
  SetLength(Str1, 100);&lt;br /&gt;
  NumRes := TridGetInfo(TRID_GET_RES_NUM, 0, PChar(Str1));&lt;br /&gt;
  if (NumRes &amp;gt; 0) then&lt;br /&gt;
  begin&lt;br /&gt;
    for I := 1 to NumRes do&lt;br /&gt;
      TotPts := TotPts + TridGetInfo(TRID_GET_RES_POINTS, I, PChar(Str1));&lt;br /&gt;
    for I := 1 to NumRes do&lt;br /&gt;
    begin&lt;br /&gt;
      NumPts := TridGetInfo(TRID_GET_RES_POINTS, I, PChar(Str1));&lt;br /&gt;
      if ((NumPts*100/TotPts) &amp;gt; TRID_GET_RES_CUTOFF) then&lt;br /&gt;
      begin&lt;br /&gt;
        TridGetInfo(TRID_GET_RES_FILEEXT, I, PChar(Str1));&lt;br /&gt;
        Str2 := LowerCase(String(PChar(Str1)));&lt;br /&gt;
        if (Length(Str2)&amp;gt;0) And (Pos(Str2, Result)=0) then&lt;br /&gt;
        begin&lt;br /&gt;
          if (I &amp;gt; 1) then Result := Result + &#039;/&#039;;&lt;br /&gt;
          Result := Result + Str2;&lt;br /&gt;
        end;&lt;br /&gt;
      end;&lt;br /&gt;
    end;&lt;br /&gt;
  end;&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
var&lt;br /&gt;
  Initialized: Boolean;&lt;br /&gt;
  AppPath, FileExts: WideString;&lt;br /&gt;
&lt;br /&gt;
begin&lt;br /&gt;
  if (not Initialized) then&lt;br /&gt;
  begin&lt;br /&gt;
    Initialized := True;&lt;br /&gt;
    AppPath := WideExtractFilePath(GetApplicationPath());&lt;br /&gt;
    if (TridLoadDefsPack(AppPath) = 0) then&lt;br /&gt;
    begin&lt;br /&gt;
      WideDeleteFile(AppPath + &#039;TrIDDefs.trd&#039;);&lt;br /&gt;
      if (DialogYesNo(&#039;Error! TrIDDefs.trd not found in the program directory (&#039; + AppPath + &#039;)!&#039;&lt;br /&gt;
      + #13#10#13#10 + &#039;Do you want to download the latest version from the TrID website now?&#039;)) then&lt;br /&gt;
        ShellOpenFile(&#039;http://mark0.net/soft-trid-e.html&#039;);&lt;br /&gt;
      Exit;&lt;br /&gt;
    end;&lt;br /&gt;
  end;&lt;br /&gt;
  if (TridSubmitFileA(PChar(FilePath)) &amp;lt;&amp;gt; 0) then&lt;br /&gt;
  begin&lt;br /&gt;
    if (TridAnalyze &amp;lt;&amp;gt; 0) then&lt;br /&gt;
    begin&lt;br /&gt;
      FileExts := GetExtensions();&lt;br /&gt;
      if (Length(FileExts) &amp;gt; 0) then&lt;br /&gt;
        FileName := WideStripExtension(FileName) + &#039;.&#039; + FileExts;&lt;br /&gt;
    end;&lt;br /&gt;
  end;&lt;br /&gt;
end.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Andrew</name></author>
	</entry>
	<entry>
		<id>https://www.den4b.com/w/index.php?title=ReNamer:Scripts:TrID&amp;diff=2294</id>
		<title>ReNamer:Scripts:TrID</title>
		<link rel="alternate" type="text/html" href="https://www.den4b.com/w/index.php?title=ReNamer:Scripts:TrID&amp;diff=2294"/>
		<updated>2011-11-27T19:55:28Z</updated>

		<summary type="html">&lt;p&gt;Andrew: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Up|ReNamer:Scripts}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:left; margin: 0 1em 0.2em 0&amp;quot;&amp;gt;__TOC__&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This script integrates the famous [http://mark0.net/code-tridlib-e.html TrID library] which is used for detecting file extensions. Discussions about this script and some script variants can be found in the following forum threads: [http://www.den4b.com/forum/viewtopic.php?id=550 ReNamer and TrID library for detecting file extension] and [http://www.den4b.com/forum/viewtopic.php?id=1245  ReNamer: MSI files are detected as PPT/XLS/DOC files].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; At the moment these scripts work only on ANSI filenames (non-[[Unicode]]). This is a limitation of the library, which may be addressed in later versions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear:both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
* [http://mark0.net/download/tridlib-free.zip TrIDLib.dll] in ReNamer&#039;s folder (http://mark0.net/code-tridlib-e.html)&lt;br /&gt;
* [http://mark0.net/download/triddefs.zip TrIDDefs.TRD] in ReNamer&#039;s folder (http://mark0.net/soft-trid.html)&lt;br /&gt;
&lt;br /&gt;
== Code: Basic ==&lt;br /&gt;
&lt;br /&gt;
Author: Denis Kozlov. Date: 16 Dec 2008. Initial version. Sets the file extension to the top matching extension. Can be easily extended.&lt;br /&gt;
&lt;br /&gt;
* Tested with ReNamer Beta from 5 Dec 2008&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source&amp;gt;&lt;br /&gt;
{ TrID Script }&lt;br /&gt;
&lt;br /&gt;
// TrID DLL exported functions&lt;br /&gt;
function TridAnalyze: integer;&lt;br /&gt;
  external &#039;TrID_Analyze@TrIDLib.dll stdcall&#039;;&lt;br /&gt;
function TridSubmitFileA(szFileName: pchar): integer;&lt;br /&gt;
  external &#039;TrID_SubmitFileA@tridlib.dll stdcall&#039;;&lt;br /&gt;
function TridLoadDefsPack(szPath: pchar): integer;&lt;br /&gt;
  external &#039;TrID_LoadDefsPack@tridlib.dll stdcall&#039;;&lt;br /&gt;
function TridGetInfo(lInfoType: integer; lInfoIdx: integer; sBuf: pchar): integer;&lt;br /&gt;
  external &#039;TrID_GetInfo@tridlib.dll stdcall&#039;;&lt;br /&gt;
&lt;br /&gt;
// Constants for TrID_GetInfo&lt;br /&gt;
const&lt;br /&gt;
  TRID_GET_RES_NUM         = 1;    // Get the number of results available&lt;br /&gt;
  TRID_GET_RES_FILETYPE    = 2;    // Filetype descriptions&lt;br /&gt;
  TRID_GET_RES_FILEEXT     = 3;    // Filetype extension&lt;br /&gt;
  TRID_GET_RES_POINTS      = 4;    // Matching points&lt;br /&gt;
  TRID_GET_VER             = 1001; // TrIDLib version (major * 100 + minor)&lt;br /&gt;
  TRID_GET_DEFSNUM         = 1004; // Number of filetypes definitions loaded&lt;br /&gt;
&lt;br /&gt;
function GetTopExtensions(Max: Integer): String;&lt;br /&gt;
var&lt;br /&gt;
  S: String;&lt;br /&gt;
  Num, I: Integer;&lt;br /&gt;
begin&lt;br /&gt;
  Result := &#039;&#039;;&lt;br /&gt;
  SetLength(S, 100);&lt;br /&gt;
  Num := TridGetInfo(TRID_GET_RES_NUM, 0, PChar(S));&lt;br /&gt;
  if Num &amp;gt; 0 then&lt;br /&gt;
  begin&lt;br /&gt;
    if Num &amp;gt; Max then&lt;br /&gt;
      Num := Max;&lt;br /&gt;
    for I:=1 to Num do&lt;br /&gt;
      begin&lt;br /&gt;
        TridGetInfo(TRID_GET_RES_FILEEXT, I, PChar(S));&lt;br /&gt;
        if I &amp;gt; 1 then Result := Result + &#039;|&#039;;       &lt;br /&gt;
        Result := Result + String(PChar(S));&lt;br /&gt;
      end;&lt;br /&gt;
  end;&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
var&lt;br /&gt;
  Initialized: Boolean;&lt;br /&gt;
&lt;br /&gt;
begin&lt;br /&gt;
  if not Initialized then&lt;br /&gt;
  begin&lt;br /&gt;
    TridLoadDefsPack(&#039;&#039;);&lt;br /&gt;
    Initialized := True;&lt;br /&gt;
  end;&lt;br /&gt;
  TridSubmitFileA(PChar(FilePath));&lt;br /&gt;
  if TridAnalyze &amp;lt;&amp;gt; 0 then&lt;br /&gt;
    FileName := WideStripExtension(FileName)+&#039;.&#039;+GetTopExtensions(1);&lt;br /&gt;
end.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Code: Advanced ==&lt;br /&gt;
&lt;br /&gt;
Author: [http://www.den4b.com/forum/profile.php?id=804 Andrew]. Date: 27 Nov 2011. An extended version by Andrew. Read comments in the script for more information.&lt;br /&gt;
&lt;br /&gt;
* Requires ReNamer 5.60+ Beta 10 or later&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source&amp;gt;&lt;br /&gt;
{ TrID Script v6 }&lt;br /&gt;
&lt;br /&gt;
// v1 - Original script by Denis&lt;br /&gt;
// v2 - Modified by Andrew to output lowercase extensions and detect presence of TrIDLib.dll and TrIDDefs.trd&lt;br /&gt;
// v3 - Modified by Andrew to keep existing extensions if not identified properly&lt;br /&gt;
// v4 - Modified by Andrew to display multiple possible extensions&lt;br /&gt;
// v5 - Modified by Andrew to display multiple possible extensions with cutoff of 20%&lt;br /&gt;
// v6 - Modified by Andrew to fix a path-related issue&lt;br /&gt;
&lt;br /&gt;
// Important: Download http://mark0.net/download/tridlib-free.zip and http://mark0.net/download/triddefs.zip,&lt;br /&gt;
// then extract TrIDLib.dll and TrIDDefs.trd to ReNamer.exe&#039;s folder/directory or else the script will fail&lt;br /&gt;
&lt;br /&gt;
// TrID DLL exported functions&lt;br /&gt;
function TridLoadDefsPack(szPath: PChar): Integer;&lt;br /&gt;
  external &#039;TrID_LoadDefsPack@TrIDLib.dll stdcall&#039;;&lt;br /&gt;
function TridSubmitFileA(szFileName: PChar): Integer;&lt;br /&gt;
  external &#039;TrID_SubmitFileA@TrIDLib.dll stdcall&#039;;&lt;br /&gt;
function TridAnalyze: Integer;&lt;br /&gt;
  external &#039;TrID_Analyze@TrIDLib.dll stdcall&#039;;&lt;br /&gt;
function TridGetInfo(lInfoType: Integer; lInfoIdx: Integer; sBuf: PChar): Integer;&lt;br /&gt;
  external &#039;TrID_GetInfo@TrIDLib.dll stdcall&#039;;&lt;br /&gt;
&lt;br /&gt;
// Constants for TrID_GetInfo etc.&lt;br /&gt;
const&lt;br /&gt;
  TRID_GET_RES_NUM     = 1;  // Get the number of results&lt;br /&gt;
  TRID_GET_RES_FILEEXT = 3;  // Filetype extension&lt;br /&gt;
  TRID_GET_RES_POINTS  = 4;  // Matching points&lt;br /&gt;
  TRID_GET_RES_CUTOFF  = 20; // Cutoff percentage for results&lt;br /&gt;
&lt;br /&gt;
function GetExtensions(): WideString;&lt;br /&gt;
var&lt;br /&gt;
  Str1, Str2: String;&lt;br /&gt;
  I, NumRes, NumPts, TotPts: Integer;&lt;br /&gt;
&lt;br /&gt;
begin&lt;br /&gt;
  Result := &#039;&#039;;&lt;br /&gt;
  SetLength(Str1, 100);&lt;br /&gt;
  NumRes := TridGetInfo(TRID_GET_RES_NUM, 0, PChar(Str1));&lt;br /&gt;
  if (NumRes &amp;gt; 0) then&lt;br /&gt;
  begin&lt;br /&gt;
    for I := 1 to NumRes do&lt;br /&gt;
      TotPts := TotPts + TridGetInfo(TRID_GET_RES_POINTS, I, PChar(Str1));&lt;br /&gt;
    for I := 1 to NumRes do&lt;br /&gt;
    begin&lt;br /&gt;
      NumPts := TridGetInfo(TRID_GET_RES_POINTS, I, PChar(Str1));&lt;br /&gt;
      if ((NumPts*100/TotPts) &amp;gt; TRID_GET_RES_CUTOFF) then&lt;br /&gt;
      begin&lt;br /&gt;
        TridGetInfo(TRID_GET_RES_FILEEXT, I, PChar(Str1));&lt;br /&gt;
        Str2 := LowerCase(String(PChar(Str1)));&lt;br /&gt;
        if (Length(Str2)&amp;gt;0) And (Pos(Str2, Result)=0) then&lt;br /&gt;
        begin&lt;br /&gt;
          if (I &amp;gt; 1) then Result := Result + &#039;/&#039;;&lt;br /&gt;
          Result := Result + Str2;&lt;br /&gt;
        end;&lt;br /&gt;
      end;&lt;br /&gt;
    end;&lt;br /&gt;
  end;&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
var&lt;br /&gt;
  Initialized: Boolean;&lt;br /&gt;
  AppPath, FileExts: WideString;&lt;br /&gt;
&lt;br /&gt;
begin&lt;br /&gt;
  if (not Initialized) then&lt;br /&gt;
  begin&lt;br /&gt;
    Initialized := True;&lt;br /&gt;
    AppPath := WideExtractFilePath(GetApplicationPath());&lt;br /&gt;
    if (TridLoadDefsPack(AppPath) = 0) then&lt;br /&gt;
    begin&lt;br /&gt;
      WideDeleteFile(AppPath + &#039;TrIDDefs.trd&#039;);&lt;br /&gt;
      if (DialogYesNo(&#039;Error! TrIDDefs.trd not found in the program directory (&#039; + AppPath + &#039;)!&#039;&lt;br /&gt;
      + #13#10#13#10 + &#039;Do you want to download the latest version from the TrID website now?&#039;)) then&lt;br /&gt;
        ShellOpenFile(&#039;http://mark0.net/soft-trid-e.html&#039;);&lt;br /&gt;
      Exit;&lt;br /&gt;
    end;&lt;br /&gt;
  end;&lt;br /&gt;
  if (TridSubmitFileA(PChar(FilePath)) &amp;lt;&amp;gt; 0) then&lt;br /&gt;
  begin&lt;br /&gt;
    if (TridAnalyze &amp;lt;&amp;gt; 0) then&lt;br /&gt;
    begin&lt;br /&gt;
      FileExts := GetExtensions();&lt;br /&gt;
      if (Length(FileExts) &amp;gt; 0) then&lt;br /&gt;
        FileName := WideStripExtension(FileName) + &#039;.&#039; + FileExts;&lt;br /&gt;
    end;&lt;br /&gt;
  end;&lt;br /&gt;
end.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Andrew</name></author>
	</entry>
	<entry>
		<id>https://www.den4b.com/w/index.php?title=ReNamer:Scripts:TrID&amp;diff=2292</id>
		<title>ReNamer:Scripts:TrID</title>
		<link rel="alternate" type="text/html" href="https://www.den4b.com/w/index.php?title=ReNamer:Scripts:TrID&amp;diff=2292"/>
		<updated>2011-11-27T13:35:33Z</updated>

		<summary type="html">&lt;p&gt;Andrew: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Up|ReNamer:Scripts}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:left; margin: 0 1em 0.2em 0&amp;quot;&amp;gt;__TOC__&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This script integrates the famous [http://mark0.net/code-tridlib-e.html TrID library] which is used for detecting file extensions. Discussions about this script and some script variants can be found on forum: [http://www.den4b.com/forum/viewtopic.php?id=550 ReNamer and TrID library for detecting file extension] and [http://www.den4b.com/forum/viewtopic.php?id=1245  ReNamer: MSI files are detected as PPT/XLS/DOC files].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; At the moment these scripts work only on ANSI filenames (non-[[Unicode]]). This is a limitation of the library, which may be addressed in later versions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear:both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
* [http://mark0.net/download/tridlib-free.zip TrIDLib.dll] in ReNamer&#039;s folder (http://mark0.net/code-tridlib-e.html)&lt;br /&gt;
* [http://mark0.net/download/triddefs.zip TrIDDefs.TRD] in ReNamer&#039;s folder (http://mark0.net/soft-trid.html)&lt;br /&gt;
&lt;br /&gt;
== Code: Basic ==&lt;br /&gt;
&lt;br /&gt;
Author: Denis Kozlov. Date: 16 Dec 2008. Initial version. Sets the file extension to the top matching extension. Can be easily extended.&lt;br /&gt;
&lt;br /&gt;
* Tested with ReNamer Beta from 5 Dec 2008&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source&amp;gt;&lt;br /&gt;
{ TrID Script }&lt;br /&gt;
&lt;br /&gt;
// TrID DLL exported functions&lt;br /&gt;
function TridAnalyze: integer;&lt;br /&gt;
  external &#039;TrID_Analyze@TrIDLib.dll stdcall&#039;;&lt;br /&gt;
function TridSubmitFileA(szFileName: pchar): integer;&lt;br /&gt;
  external &#039;TrID_SubmitFileA@tridlib.dll stdcall&#039;;&lt;br /&gt;
function TridLoadDefsPack(szPath: pchar): integer;&lt;br /&gt;
  external &#039;TrID_LoadDefsPack@tridlib.dll stdcall&#039;;&lt;br /&gt;
function TridGetInfo(lInfoType: integer; lInfoIdx: integer; sBuf: pchar): integer;&lt;br /&gt;
  external &#039;TrID_GetInfo@tridlib.dll stdcall&#039;;&lt;br /&gt;
&lt;br /&gt;
// Constants for TrID_GetInfo&lt;br /&gt;
const&lt;br /&gt;
  TRID_GET_RES_NUM         = 1;    // Get the number of results available&lt;br /&gt;
  TRID_GET_RES_FILETYPE    = 2;    // Filetype descriptions&lt;br /&gt;
  TRID_GET_RES_FILEEXT     = 3;    // Filetype extension&lt;br /&gt;
  TRID_GET_RES_POINTS      = 4;    // Matching points&lt;br /&gt;
  TRID_GET_VER             = 1001; // TrIDLib version (major * 100 + minor)&lt;br /&gt;
  TRID_GET_DEFSNUM         = 1004; // Number of filetypes definitions loaded&lt;br /&gt;
&lt;br /&gt;
function GetTopExtensions(Max: Integer): String;&lt;br /&gt;
var&lt;br /&gt;
  S: String;&lt;br /&gt;
  Num, I: Integer;&lt;br /&gt;
begin&lt;br /&gt;
  Result := &#039;&#039;;&lt;br /&gt;
  SetLength(S, 100);&lt;br /&gt;
  Num := TridGetInfo(TRID_GET_RES_NUM, 0, PChar(S));&lt;br /&gt;
  if Num &amp;gt; 0 then&lt;br /&gt;
  begin&lt;br /&gt;
    if Num &amp;gt; Max then&lt;br /&gt;
      Num := Max;&lt;br /&gt;
    for I:=1 to Num do&lt;br /&gt;
      begin&lt;br /&gt;
        TridGetInfo(TRID_GET_RES_FILEEXT, I, PChar(S));&lt;br /&gt;
        if I &amp;gt; 1 then Result := Result + &#039;|&#039;;       &lt;br /&gt;
        Result := Result + String(PChar(S));&lt;br /&gt;
      end;&lt;br /&gt;
  end;&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
var&lt;br /&gt;
  Initialized: Boolean;&lt;br /&gt;
&lt;br /&gt;
begin&lt;br /&gt;
  if not Initialized then&lt;br /&gt;
  begin&lt;br /&gt;
    TridLoadDefsPack(&#039;&#039;);&lt;br /&gt;
    Initialized := True;&lt;br /&gt;
  end;&lt;br /&gt;
  TridSubmitFileA(PChar(FilePath));&lt;br /&gt;
  if TridAnalyze &amp;lt;&amp;gt; 0 then&lt;br /&gt;
    FileName := WideStripExtension(FileName)+&#039;.&#039;+GetTopExtensions(1);&lt;br /&gt;
end.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Code: Advanced ==&lt;br /&gt;
&lt;br /&gt;
Author: [http://www.den4b.com/forum/profile.php?id=804 Andrew]. Date: 27 Nov 2008. An extended version by Andrew. Read comments in the script for more information.&lt;br /&gt;
&lt;br /&gt;
* Requires ReNamer 5.60+ Beta 10 or later&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source&amp;gt;&lt;br /&gt;
{ TrID Script v6 }&lt;br /&gt;
&lt;br /&gt;
// v1 - Original script by Denis&lt;br /&gt;
// v2 - Modified by Andrew to output lowercase extensions and detect presence of TrIDLib.dll and TrIDDefs.trd&lt;br /&gt;
// v3 - Modified by Andrew to keep existing extensions if not identified properly&lt;br /&gt;
// v4 - Modified by Andrew to display multiple possible extensions&lt;br /&gt;
// v5 - Modified by Andrew to display multiple possible extensions with cutoff of 20%&lt;br /&gt;
// v6 - Modified by Andrew to fix a path-related issue&lt;br /&gt;
&lt;br /&gt;
// Important: Download http://mark0.net/download/tridlib-free.zip and http://mark0.net/download/triddefs.zip,&lt;br /&gt;
// then extract TrIDLib.dll and TrIDDefs.trd to ReNamer.exe&#039;s folder/directory or else the script will fail&lt;br /&gt;
&lt;br /&gt;
// TrID DLL exported functions&lt;br /&gt;
function TridLoadDefsPack(szPath: PChar): Integer;&lt;br /&gt;
  external &#039;TrID_LoadDefsPack@TrIDLib.dll stdcall&#039;;&lt;br /&gt;
function TridSubmitFileA(szFileName: PChar): Integer;&lt;br /&gt;
  external &#039;TrID_SubmitFileA@TrIDLib.dll stdcall&#039;;&lt;br /&gt;
function TridAnalyze: Integer;&lt;br /&gt;
  external &#039;TrID_Analyze@TrIDLib.dll stdcall&#039;;&lt;br /&gt;
function TridGetInfo(lInfoType: Integer; lInfoIdx: Integer; sBuf: PChar): Integer;&lt;br /&gt;
  external &#039;TrID_GetInfo@TrIDLib.dll stdcall&#039;;&lt;br /&gt;
&lt;br /&gt;
// Constants for TrID_GetInfo etc.&lt;br /&gt;
const&lt;br /&gt;
  TRID_GET_RES_NUM     = 1;  // Get the number of results&lt;br /&gt;
  TRID_GET_RES_FILEEXT = 3;  // Filetype extension&lt;br /&gt;
  TRID_GET_RES_POINTS  = 4;  // Matching points&lt;br /&gt;
  TRID_GET_RES_CUTOFF  = 20; // Cutoff percentage for results&lt;br /&gt;
&lt;br /&gt;
function GetExtensions(): WideString;&lt;br /&gt;
var&lt;br /&gt;
  Str1, Str2: String;&lt;br /&gt;
  I, NumRes, NumPts, TotPts: Integer;&lt;br /&gt;
&lt;br /&gt;
begin&lt;br /&gt;
  Result := &#039;&#039;;&lt;br /&gt;
  SetLength(Str1, 100);&lt;br /&gt;
  NumRes := TridGetInfo(TRID_GET_RES_NUM, 0, PChar(Str1));&lt;br /&gt;
  if (NumRes &amp;gt; 0) then&lt;br /&gt;
  begin&lt;br /&gt;
    for I := 1 to NumRes do&lt;br /&gt;
      TotPts := TotPts + TridGetInfo(TRID_GET_RES_POINTS, I, PChar(Str1));&lt;br /&gt;
    for I := 1 to NumRes do&lt;br /&gt;
    begin&lt;br /&gt;
      NumPts := TridGetInfo(TRID_GET_RES_POINTS, I, PChar(Str1));&lt;br /&gt;
      if ((NumPts*100/TotPts) &amp;gt; TRID_GET_RES_CUTOFF) then&lt;br /&gt;
      begin&lt;br /&gt;
        TridGetInfo(TRID_GET_RES_FILEEXT, I, PChar(Str1));&lt;br /&gt;
        Str2 := LowerCase(String(PChar(Str1)));&lt;br /&gt;
        if (Length(Str2)&amp;gt;0) And (Pos(Str2, Result)=0) then&lt;br /&gt;
        begin&lt;br /&gt;
          if (I &amp;gt; 1) then Result := Result + &#039;/&#039;;&lt;br /&gt;
          Result := Result + Str2;&lt;br /&gt;
        end;&lt;br /&gt;
      end;&lt;br /&gt;
    end;&lt;br /&gt;
  end;&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
var&lt;br /&gt;
  Initialized: Boolean;&lt;br /&gt;
  AppPath, FileExts: WideString;&lt;br /&gt;
&lt;br /&gt;
begin&lt;br /&gt;
  if (not Initialized) then&lt;br /&gt;
  begin&lt;br /&gt;
    Initialized := True;&lt;br /&gt;
    AppPath := WideExtractFilePath(GetApplicationPath());&lt;br /&gt;
    if (TridLoadDefsPack(AppPath) = 0) then&lt;br /&gt;
    begin&lt;br /&gt;
      WideDeleteFile(AppPath + &#039;TrIDDefs.trd&#039;);&lt;br /&gt;
      if (DialogYesNo(&#039;Error! TrIDDefs.trd not found in the program directory (&#039; + AppPath + &#039;)!&#039;&lt;br /&gt;
      + #13#10#13#10 + &#039;Do you want to download the latest version from the TrID website now?&#039;)) then&lt;br /&gt;
        ShellOpenFile(&#039;http://mark0.net/soft-trid-e.html&#039;);&lt;br /&gt;
      Exit;&lt;br /&gt;
    end;&lt;br /&gt;
  end;&lt;br /&gt;
  if (TridSubmitFileA(PChar(FilePath)) &amp;lt;&amp;gt; 0) then&lt;br /&gt;
  begin&lt;br /&gt;
    if (TridAnalyze &amp;lt;&amp;gt; 0) then&lt;br /&gt;
    begin&lt;br /&gt;
      FileExts := GetExtensions();&lt;br /&gt;
      if (Length(FileExts) &amp;gt; 0) then&lt;br /&gt;
        FileName := WideStripExtension(FileName) + &#039;.&#039; + FileExts;&lt;br /&gt;
    end;&lt;br /&gt;
  end;&lt;br /&gt;
end.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Andrew</name></author>
	</entry>
	<entry>
		<id>https://www.den4b.com/w/index.php?title=ReNamer:Pascal_Script:Functions&amp;diff=2291</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=2291"/>
		<updated>2011-11-27T13:24:37Z</updated>

		<summary type="html">&lt;p&gt;Andrew: /* File Name Utilities */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Up|ReNamer:Pascal Script}}&lt;br /&gt;
&lt;br /&gt;
ReNamer has many functions to manipulate the entities related to file names and do some more complex tasks for individual files. These entities may be derived from the existing filename, path, system date, meta tags from the file, strings entered by the user, etc. This functionality is available for use via the [[ReNamer:Rules:PascalScript|PascalScript rule]].&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 [[Unicode]] strings (WideString). The prefix is used because there are similar functions which deal with &#039;&#039;&#039;ANSI&#039;&#039;&#039; 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;
== Basic String Handling ==&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 Management ==&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 ==&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;
| Returns the result of replacing on a string S, a string OldPattern (Case Sensitive), with a NewPattern.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideReplaceText&#039;&#039;&#039;(const S, OldPattern, NewPattern: WideString): WideString; &lt;br /&gt;
| Returns the result of replacing on a string S, a text OldPattern (Case Non-Sensitive), with a NewPattern.&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 &#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 are 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;.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| function  &#039;&#039;&#039;WideJoinStrings&#039;&#039;&#039;(const Strings: TStringsArray; const Delimiter: WideString): WideString;&lt;br /&gt;
| Joins all individual items from &#039;&#039;&#039;Strings&#039;&#039;&#039; into a single WideString, with &#039;&#039;&#039;Delimiter&#039;&#039;&#039; inserted between the joined items.&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;wikitable&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;source&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;/source&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;
For example, given the Input &#039;Ax1_-_Bx2---Cx3&#039; and the function &#039;&#039;&#039;MatchesRegEx&#039;&#039;&#039;(Input, &#039;&#039;&#039;&#039;([A-Z])x(\d)&#039;&#039;&#039;&#039;, False).&amp;amp;nbsp;What we get is [&#039;&#039;&#039;&#039;Ax1&#039;&#039;&#039;&#039;, &#039;&#039;&#039;&#039;Bx2&#039;&#039;&#039;&#039;, &#039;&#039;&#039;&#039;Cx3&#039;&#039;&#039;&#039;]. Being these the 3 full matches found on the Input.&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. &lt;br /&gt;
&lt;br /&gt;
For example, given the Input &#039;Ax1_-_Bx2---Cx3&#039; and the function &#039;&#039;&#039;SubMatchesRegEx&#039;&#039;&#039;(Input, &#039;&#039;&#039;&#039;([A-Z])x(\d)&#039;&#039;&#039;&#039;, False).&amp;amp;nbsp;What we get is&amp;amp;nbsp;[&#039;&#039;&#039;&#039;A&#039;&#039;&#039;&#039;,&amp;amp;nbsp;&#039;&#039;&#039;&#039;1&#039;&#039;&#039;&#039;]. Being these the first sub-matches requested&amp;amp;nbsp;(two in this case). &lt;br /&gt;
&lt;br /&gt;
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 ==&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;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 ==&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 [http://en.wikipedia.org/wiki/UTF-8 UTF-8] encoded string.&amp;lt;br/&amp;gt;Useful for storing Unicode strings in files, sometimes for compatibility reasons and sometimes to reduce the size of the file.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;UTF8Decode&#039;&#039;&#039;(const S: String): WideString;&lt;br /&gt;
| Convert [http://en.wikipedia.org/wiki/UTF-8 UTF-8] encoded string to its full [[Unicode]] representation.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Basic Conversion ==&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;BoolToStr&#039;&#039;&#039;(B: Boolean): String;&lt;br /&gt;
| Convert boolean variable into a string. Returns &#039;&#039;&#039;True&#039;&#039;&#039; or &#039;&#039;&#039;False&#039;&#039;&#039; string.&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 equalities are 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;FloatToStr&#039;&#039;&#039;(Value: Extended): string;&lt;br /&gt;
| Converts supplied floating point value to its string representation, using default system format.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;StrToFloat&#039;&#039;&#039;(const S: string): Extended;&lt;br /&gt;
| Converts supplied string to a floating point value.&amp;lt;br&amp;gt;&#039;&#039;&#039;Warning:&#039;&#039;&#039; An error will occur if the parameter to this function cannot be converted to a floating point value!&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;StrToFloatDef&#039;&#039;&#039;(const S: string; const Default: Extended): Extended;&lt;br /&gt;
| Behaves like &#039;&#039;&#039;StrToFloat&#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 a floating point value.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;FormatFloat&#039;&#039;&#039;(const Format: string; Value: Extended): string;&lt;br /&gt;
| Converts supplied floating point value to its string representation, using user specific &#039;&#039;&#039;Format&#039;&#039;&#039;. Format string may contain following specifiers:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Specifier&lt;br /&gt;
! Represents&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;0&#039;&#039;&#039;&amp;amp;nbsp;(zero)&lt;br /&gt;
| Digit placeholder. If the value being formatted has a digit in the position where the &amp;quot;0&amp;quot; appears in the format string, then that digit is copied to the output string. Otherwise, a &amp;quot;0&amp;quot; is stored in that position in the output string.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;#&#039;&#039;&#039;&amp;amp;nbsp;(hash)&lt;br /&gt;
| Digit placeholder. If the value being formatted has a digit in the position where the &amp;quot;#&amp;quot; appears in the format string, then that digit is copied to the output string. Otherwise, nothing is stored in that position in the output string.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;.&#039;&#039;&#039;&amp;amp;nbsp;(dot)&lt;br /&gt;
| Decimal point. The first &amp;quot;.&amp;quot; character in the format string determines the location of the decimal separator in the formatted value, any additional &amp;quot;.&amp;quot; characters are ignored.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;,&#039;&#039;&#039;&amp;amp;nbsp;(comma)&lt;br /&gt;
| Thousand separator. If the format string contains one or more &amp;quot;,&amp;quot; characters, the output will have thousand separators inserted between each group of three digits to the left of the decimal point. The placement and number of &amp;quot;,&amp;quot; characters in the format string does not affect the output.&lt;br /&gt;
|}&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.&amp;lt;br/&amp;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 ==&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;
| Increments a TDateTime variable by a number of years (plus or minus).&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IncMonth&#039;&#039;&#039;(const AValue: TDateTime; ANumberOfMonths: Integer): TDateTime; &lt;br /&gt;
| Increments a TDateTime variable by a number of months (plus or minus).&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IncWeek&#039;&#039;&#039;(const AValue: TDateTime; const ANumberOfWeeks: Integer): TDateTime; &lt;br /&gt;
| Increments a TDateTime variable by a number of weeks (plus or minus).&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IncDay&#039;&#039;&#039;(const AValue: TDateTime; const ANumberOfDays: Integer): TDateTime; &lt;br /&gt;
| Increments a TDateTime variable by a number of days (plus or minus).&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IncHour&#039;&#039;&#039;(const AValue: TDateTime; const ANumberOfHours: Int64): TDateTime; &lt;br /&gt;
| Increments a TDateTime variable by a number of hours (plus or minus).&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IncMinute&#039;&#039;&#039;(const AValue: TDateTime; const ANumberOfMinutes: Int64): TDateTime; &lt;br /&gt;
| Increments a TDateTime variable by a number of minutes (plus or minus).&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IncSecond&#039;&#039;&#039;(const AValue: TDateTime; const ANumberOfSeconds: Int64): TDateTime; &lt;br /&gt;
| Increments a TDateTime variable by a number of seconds (plus or minus).&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;IncMilliSecond&#039;&#039;&#039;(const AValue: TDateTime; const ANumberOfMilliSeconds: Int64): TDateTime; &lt;br /&gt;
| Increments a TDateTime variable by a number of milliseconds (plus or minus).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== File Management ==&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;
| Returns the size of the file.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideFileExists&#039;&#039;&#039;(const FileName: WideString): Boolean; &lt;br /&gt;
| Check whether specified file exists. Returns TRUE if file exists, otherwise FALSE.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideDirectoryExists&#039;&#039;&#039;(const Directory: WideString): Boolean; &lt;br /&gt;
| Check whether specified directory exists. Returns TRUE if directory exists, otherwise FALSE.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideForceDirectories&#039;&#039;&#039;(Dir: WideString): Boolean; &lt;br /&gt;
| Makes sure that that all directories in the path exist. If they don&#039;t, function will try to create them, recursively. Returns TRUE if all folders exist or have been successfully created.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideCreateDir&#039;&#039;&#039;(const Dir: WideString): Boolean; &lt;br /&gt;
| Create specified directory (non-recursive). Returns TRUE on success, otherwise FALSE.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideDeleteFile&#039;&#039;&#039;(const FileName: WideString): Boolean; &lt;br /&gt;
| Delete physical file from the disk. Returns TRUE on success, otherwise FALSE.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideRenameFile&#039;&#039;&#039;(const OldName, NewName: WideString): Boolean; &lt;br /&gt;
| Rename file from &#039;&#039;&#039;OldName&#039;&#039;&#039; to &#039;&#039;&#039;NewName&#039;&#039;&#039;. Returns TRUE on success, otherwise FALSE.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideCopyFile&#039;&#039;&#039;(FromFile, ToFile: WideString; FailIfExists: Boolean): Boolean;&lt;br /&gt;
| Rename file from &#039;&#039;&#039;FromFile&#039;&#039;&#039; to &#039;&#039;&#039;ToFile&#039;&#039;&#039;. If &#039;&#039;&#039;FailIfExists&#039;&#039;&#039; flag is TRUE, file will not be copied when destination file already exists, otherwise, destination file will be overwritten. Returns TRUE on success, otherwise FALSE.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideFileSearch&#039;&#039;&#039;(const Name, DirList: WideString): WideString; &lt;br /&gt;
| Search through the directories passed in &#039;&#039;&#039;DirList&#039;&#039;&#039; for a file named &#039;&#039;&#039;Name&#039;&#039;&#039;. DirList is a list of path names delimited by semicolons. If file matching Name is located, function returns a string specifying a path name for that file. If no matching file exists, function returns an empty string.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideGetCurrentDir&#039;&#039;&#039;: WideString; &lt;br /&gt;
| Returns the current working directory.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideSetCurrentDir&#039;&#039;&#039;(const Dir: WideString): Boolean; &lt;br /&gt;
| Sets the current working directory to the directory specified by parameter &#039;&#039;&#039;Dir&#039;&#039;&#039;.&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;
| You can get a list of the files inside a folder.&lt;br /&gt;
*&#039;&#039;&#039;Dir&#039;&#039;&#039;: The folder you want to scan.&lt;br /&gt;
*&#039;&#039;&#039;Files&#039;&#039;&#039;: Where the list of files is going to be saved.&lt;br /&gt;
*&#039;&#039;&#039;Recursive&#039;&#039;&#039;: Do you want to scan the subfolders?&lt;br /&gt;
*&#039;&#039;&#039;IncludeHidden&#039;&#039;&#039;: Do you want to list the hidden files?&lt;br /&gt;
*&#039;&#039;&#039;IncludeSystem&#039;&#039;&#039;: Do you want to list the system files?&lt;br /&gt;
*&#039;&#039;&#039;Mask&#039;&#039;&#039;: You can list everything (&#039;*&#039;), or only the files that contain some string (example: &#039;*.txt&#039;).&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;
| You can get a list of the folders inside other folder.&lt;br /&gt;
*&#039;&#039;&#039;Dir&#039;&#039;&#039;: The folder you want to scan.&lt;br /&gt;
*&#039;&#039;&#039;Folders&#039;&#039;&#039;: Where the list of folders is going to be saved.&lt;br /&gt;
*&#039;&#039;&#039;Recursive&#039;&#039;&#039;: Do you want to scan the subfolders?&lt;br /&gt;
*&#039;&#039;&#039;IncludeHidden&#039;&#039;&#039;: Do you want to list the hidden folders?&lt;br /&gt;
*&#039;&#039;&#039;IncludeSystem&#039;&#039;&#039;: Do you want to list the system folders?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== File Name Utilities ==&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;WideExtractFilePath&#039;&#039;&#039;(const FileName: WideString): WideString; &lt;br /&gt;
| Returns the drive and directory portion from &amp;quot;FileName&amp;quot;, including the trailing path delimiter, e.g. &amp;quot;C:\Folder\&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideExtractFileDir&#039;&#039;&#039;(const FileName: WideString): WideString; &lt;br /&gt;
| Returns the drive and directory portion from &amp;quot;FileName&amp;quot;, excluding the trailing path delimiter, e.g. &amp;quot;C:\Folder&amp;quot;.&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, e.g. &amp;quot;C:&amp;quot;.&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, 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 the base name of the file (file name without extension).&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. Returns the stripped string.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideExpandFileName&#039;&#039;&#039;(const FileName: WideString): WideString; &lt;br /&gt;
| Converts the relative file name into a fully qualified path. This function does not verify that the resulting path refers to an existing file.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideExtractRelativePath&#039;&#039;&#039;(const BaseName, DestName: WideString): WideString; &lt;br /&gt;
| Creates a relative path to go from &#039;&#039;&#039;BaseName&#039;&#039;&#039; to &#039;&#039;&#039;DestName&#039;&#039;&#039;. For example:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| &#039;&#039;&#039;BaseName:&#039;&#039;&#039;&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;C:\Folder\FileName.txt&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;DestName:&#039;&#039;&#039;&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;C:\Documents\Article.pdf&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Result:&#039;&#039;&#039;&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;..\Documents\Article.pdf&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideExtractShortPathName&#039;&#039;&#039;(const FileName: WideString): WideString; &lt;br /&gt;
| It converts a path into it&#039;s representation in DOS format.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideIncludeTrailingPathDelimiter&#039;&#039;&#039;(const S: WideString): WideString; &lt;br /&gt;
| With this function you can ensure that a path for a folder &#039;&#039;&#039;contains&#039;&#039;&#039; the path delimiter (&amp;quot;\&amp;quot;) at the end of the path.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideExcludeTrailingPathDelimiter&#039;&#039;&#039;(const S: WideString): WideString; &lt;br /&gt;
| With this function you can ensure that a path for a file does &#039;&#039;&#039;not contain&#039;&#039;&#039; the path delimiter (&amp;quot;\&amp;quot;) at the end of the path.&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;
| Returns an environment variable by its name. For example:&lt;br /&gt;
&amp;lt;source&amp;gt;&lt;br /&gt;
var&lt;br /&gt;
  UserName, ComputerName: WideString;&lt;br /&gt;
begin&lt;br /&gt;
  UserName := WideGetEnvironmentVar(&#039;USERNAME&#039;);&lt;br /&gt;
  ComputerName := WideGetEnvironmentVar(&#039;COMPUTERNAME&#039;);&lt;br /&gt;
end.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== File Read/Write ==&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;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).&amp;lt;br/&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; This function is extremely inefficient and provided only for convenience!&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;FileCountLines&#039;&#039;&#039;(const FileName: WideString): Integer; &lt;br /&gt;
| Count number of lines in the file.&amp;lt;br/&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; This function is extremely inefficient and provided only for convenience!&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;FileReadContent&#039;&#039;&#039;(const FileName: WideString): String; &lt;br /&gt;
| Return the entire content of the file as a String.&lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;FileWriteContent&#039;&#039;&#039;(const FileName: WideString; const Content: String); &lt;br /&gt;
| Write &#039;&#039;&#039;Content&#039;&#039;&#039; to the file. If target file already exists, it will be overwritten.&lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;FileAppendContent&#039;&#039;&#039;(const FileName: WideString; const Content: String); &lt;br /&gt;
| Append &#039;&#039;&#039;Content&#039;&#039;&#039; to the end of the file. If target file does not exist, it will be created.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== File Time ==&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;FileTimeModified&#039;&#039;&#039;(const FileName: WideString): TDateTime; &lt;br /&gt;
| Returns last modified time of the specified file.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;FileTimeCreated&#039;&#039;&#039;(const FileName: WideString): TDateTime; &lt;br /&gt;
| Returns creation time of the specified file.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;SetFileTimeCreated&#039;&#039;&#039;(const FileName: WideString; const DateTime: TDateTime): Boolean; &lt;br /&gt;
| Sets creation time for the specified file.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;SetFileTimeModified&#039;&#039;&#039;(const FileName: WideString; const DateTime: TDateTime): Boolean; &lt;br /&gt;
| Sets last modified time for the specified file.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Process Execution ==&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;ShellOpenFile&#039;&#039;&#039;(const FileName: WideString): Boolean; &lt;br /&gt;
| Run (open) a file specified by &#039;&#039;&#039;FileName&#039;&#039;&#039;. Works like &amp;quot;Start &amp;amp;gt; Run&amp;quot; command. Parameter does not have to be an executable file, it can by any file or protocol with assigned handler. For example, you can open a Word document or a web page, and associated application will be launched:&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-family: monospace&amp;quot;&amp;gt;&lt;br /&gt;
* ShellOpenFile(&amp;lt;nowiki&amp;gt;&#039;http://www.den4b.com/&#039;&amp;lt;/nowiki&amp;gt;);&lt;br /&gt;
* ShellOpenFile(&amp;lt;nowiki&amp;gt;&#039;C:\Document.doc&#039;&amp;lt;/nowiki&amp;gt;);&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;ExecuteProgram&#039;&#039;&#039;(const Command: String; WaitForProgram: Boolean): Cardinal; &lt;br /&gt;
| Execute a command line specified by parameter &#039;&#039;&#039;Command&#039;&#039;&#039;. Works like &amp;quot;Command Prompt&amp;quot;. Parameter &#039;&#039;&#039;WaitForProgram&#039;&#039;&#039; allows you to specify whether the code needs to wait until the command (launched program) has finished executing.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;ExecConsoleApp&#039;&#039;&#039;(const CommandLine: String; out Output: String): Cardinal; &lt;br /&gt;
| Execute a command line specified by parameter &#039;&#039;&#039;CommandLine&#039;&#039;&#039; and record its standard output in the variable &#039;&#039;&#039;Output&#039;&#039;&#039;. Works like &amp;quot;Command Prompt&amp;quot;. Should be used only for console style applications. Returns the exit code.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Dialogs ==&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;
| procedure &#039;&#039;&#039;ShowMessage&#039;&#039;&#039;(const Msg: String); &lt;br /&gt;
| Show a simple dialog with the message specified by &#039;&#039;&#039;Msg&#039;&#039;&#039; parameter.&lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;WideShowMessage&#039;&#039;&#039;(const Msg: WideString); &lt;br /&gt;
| Same as &#039;&#039;&#039;ShowMessage&#039;&#039;&#039; function but parameter is Unicode text.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;DialogYesNo&#039;&#039;&#039;(const Msg: String): Boolean; &lt;br /&gt;
| Show a simple prompt with the message specified by &#039;&#039;&#039;Msg&#039;&#039;&#039; parameter and two button: Yes and No. Returns TRUE if user clicks Yes button, otherwise FALSE.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideDialogYesNo&#039;&#039;&#039;(const Msg: WideString): Boolean; &lt;br /&gt;
| Same as &#039;&#039;&#039;DialogYesNo&#039;&#039;&#039; function but parameter is WideString text.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;InputBox&#039;&#039;&#039;(const ACaption, APrompt, ADefault: String): String; &lt;br /&gt;
| Displays a simple dialog box with the given &#039;&#039;&#039;ACaption&#039;&#039;&#039; and &#039;&#039;&#039;APrompt&#039;&#039;&#039; message. It asks the user to enter data in a text box on the dialog. A &#039;&#039;&#039;ADefault&#039;&#039;&#039; value is displayed in the text box initially. If the user presses OK, the value from the text box is returned, otherwise &#039;&#039;&#039;ADefault&#039;&#039;&#039; value is returned.&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;
| Operates similar to &#039;&#039;&#039;InputBox&#039;&#039;&#039; function. The default value and the value of the text box after the dialog is closed are transferred via the &#039;&#039;&#039;Value&#039;&#039;&#039; parameter. Function returns TRUE is user clicked OK, otherwise returns FALSE.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;WideInputBox&#039;&#039;&#039;(const ACaption, APrompt, ADefault: WideString): WideString; &lt;br /&gt;
| Same as &#039;&#039;&#039;InputBox&#039;&#039;&#039; function but operates on WideString text.&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;
| Same as &#039;&#039;&#039;InputQuery&#039;&#039;&#039; function but operates on WideString text.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Other 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;
| procedure &#039;&#039;&#039;Sleep&#039;&#039;&#039;(Milliseconds: Cardinal); &lt;br /&gt;
| Sleep (pause the execution) for specified number of &#039;&#039;&#039;Milliseconds&#039;&#039;&#039;.&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;
| Perform integer division and fetch the remainder as well, all in one operation. &#039;&#039;&#039;Dividend&#039;&#039;&#039; is the integer into which you are dividing. &#039;&#039;&#039;Divisor&#039;&#039;&#039; is the value by which to divide &#039;&#039;&#039;Dividend&#039;&#039;&#039;. &#039;&#039;&#039;Result&#039;&#039;&#039; returns the result of the integer division. &#039;&#039;&#039;Remainder&#039;&#039;&#039; returns the remainder (the difference between Result * Divisor and Dividend).&lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;Randomize&#039;&#039;&#039;; &lt;br /&gt;
| Prepares the random number generator.&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Should only be called once per application cycle, at the start of the process!&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;RandomRange&#039;&#039;&#039;(const AFrom, ATo: Integer): Integer; &lt;br /&gt;
| Return a random integer number within the specified range from &#039;&#039;&#039;AFrom&#039;&#039;&#039; (inclusive) to &#039;&#039;&#039;ATo&#039;&#039;&#039; (non-inclusive).&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;GetApplicationPath&#039;&#039;&#039;: WideString;&lt;br /&gt;
| Return full path to the application, for example: &amp;quot;C:\Program Files\ReNamer\ReNamer.exe&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;GetApplicationParams&#039;&#039;&#039;: TStringsArray;&lt;br /&gt;
| Return an array of command line parameters which were supplied to the application at launch.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;GetClipboardText&#039;&#039;&#039;: WideString; &lt;br /&gt;
| Get the content of the the clipboard (text only).&lt;br /&gt;
|-&lt;br /&gt;
| procedure &#039;&#039;&#039;SetClipboardText&#039;&#039;&#039;(const S: WideString); &lt;br /&gt;
| Set the content of the the clipboard (text only).&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;Base64Encode&#039;&#039;&#039;(const S: String): String; &lt;br /&gt;
| Encode string &#039;&#039;&#039;S&#039;&#039;&#039; into [http://en.wikipedia.org/wiki/Base64 Base64]. Useful for encoding binary data in order to minimize the likelihood of data being modified in transit through different systems, like email or internet.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;Base64Decode&#039;&#039;&#039;(const S: String): String; &lt;br /&gt;
| Decode [http://en.wikipedia.org/wiki/Base64 Base64] string;&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;GetTickCount&#039;&#039;&#039;: Cardinal; &lt;br /&gt;
| Retrieves the number of milliseconds that have elapsed since the system was started (up to 49.7 days, then timer resets). The precision of this timer is very limited.&lt;br /&gt;
|-&lt;br /&gt;
| function &#039;&#039;&#039;SizeOf&#039;&#039;&#039;(X): Integer; &lt;br /&gt;
| Pass a variable reference to determine the number of bytes used to represent the variable. Pass a type identifier to determine the number of bytes used to represent instances of that type.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:ReNamer]]&lt;br /&gt;
[[Category:Pascal Script]]&lt;/div&gt;</summary>
		<author><name>Andrew</name></author>
	</entry>
	<entry>
		<id>https://www.den4b.com/w/index.php?title=ReNamer:Pascal_Script:Types&amp;diff=2286</id>
		<title>ReNamer:Pascal Script:Types</title>
		<link rel="alternate" type="text/html" href="https://www.den4b.com/w/index.php?title=ReNamer:Pascal_Script:Types&amp;diff=2286"/>
		<updated>2011-11-26T22:36:08Z</updated>

		<summary type="html">&lt;p&gt;Andrew: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Expand}}&lt;br /&gt;
&lt;br /&gt;
This page lists and explains all supported types in [[ReNamer:Pascal Script|Pascal Script]] used within ReNamer.&lt;br /&gt;
&lt;br /&gt;
== Integer types ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Type&lt;br /&gt;
! Size&lt;br /&gt;
! Range&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Byte&#039;&#039;&#039;&lt;br /&gt;
| 1 byte&lt;br /&gt;
| align=&amp;quot;center&amp;quot; | 0 .. 255&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;ShortInt&#039;&#039;&#039;&lt;br /&gt;
| 1 byte&lt;br /&gt;
| align=&amp;quot;center&amp;quot; | -128 .. 127&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Word&#039;&#039;&#039;&lt;br /&gt;
| 2 bytes&lt;br /&gt;
| align=&amp;quot;center&amp;quot; | 0 .. 65535&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;SmallInt&#039;&#039;&#039;&lt;br /&gt;
| 2 bytes&lt;br /&gt;
| align=&amp;quot;center&amp;quot; | -32768 .. 32767&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Cardinal&#039;&#039;&#039;&lt;br /&gt;
| 4 bytes&lt;br /&gt;
| align=&amp;quot;center&amp;quot; | 0 .. 4294967295&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Integer&#039;&#039;&#039;&lt;br /&gt;
| 4 bytes&lt;br /&gt;
| align=&amp;quot;center&amp;quot; | -2147483648 .. 2147483647&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Floating point types ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Type&lt;br /&gt;
! Size&lt;br /&gt;
! Range&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Single&#039;&#039;&#039;&lt;br /&gt;
| 4 bytes&lt;br /&gt;
| align=&amp;quot;center&amp;quot; | 1.5 x 10&amp;lt;sup&amp;gt;-45&amp;lt;/sup&amp;gt; .. 3.4 x 10&amp;lt;sup&amp;gt;38&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Double&#039;&#039;&#039;&lt;br /&gt;
| 8 bytes&lt;br /&gt;
| align=&amp;quot;center&amp;quot; | 5.0 x 10&amp;lt;sup&amp;gt;-324&amp;lt;/sup&amp;gt; .. 1.7 x 10&amp;lt;sup&amp;gt;308&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Extended&#039;&#039;&#039;&lt;br /&gt;
| 10 bytes&lt;br /&gt;
| align=&amp;quot;center&amp;quot; | 3.6 x 10&amp;lt;sup&amp;gt;-4951&amp;lt;/sup&amp;gt; .. 1.1 x 10&amp;lt;sup&amp;gt;4932&amp;lt;/sup&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== String types ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Type&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Char&#039;&#039;&#039;&lt;br /&gt;
| Stores a single Ansi character&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;String&#039;&#039;&#039;&lt;br /&gt;
| Holds a sequence of Ansi characters of any length&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;WideChar&#039;&#039;&#039;&lt;br /&gt;
| Stores a single Unicode character&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;WideString&#039;&#039;&#039;&lt;br /&gt;
| Holds a sequence of Unicode characters of any length&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; [[Unicode]] article highlights the difference between Unicode and Ansi.&lt;br /&gt;
&lt;br /&gt;
== Pointer types ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Type&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;PChar&#039;&#039;&#039;&lt;br /&gt;
| Pointer to a Char value, and can also be used to point to characters within a string&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Other types ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Type&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Boolean&#039;&#039;&#039;&lt;br /&gt;
| Provides an enumeration of the logical &#039;&#039;&#039;True&#039;&#039;&#039; and &#039;&#039;&#039;False&#039;&#039;&#039; values&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Array&#039;&#039;&#039;&lt;br /&gt;
| Single and multi dimensional indexable sequences of data&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Record&#039;&#039;&#039;&lt;br /&gt;
| Provides means of collecting together a set of different data types into one named structure&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Variant&#039;&#039;&#039;&lt;br /&gt;
| Provides a flexible general purpose data type&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Enumerations and Sets ==&lt;br /&gt;
&lt;br /&gt;
For example, the Boolean data type is itself an enumeration, with two possible values: True and False. If you try to assign a different value to a Boolean variable, the code will not compile.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Example&lt;br /&gt;
! Description &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
type&lt;br /&gt;
  TDay = (Mon, Tue, Wed, Thu, Fri, Sat, Sun);&lt;br /&gt;
var&lt;br /&gt;
  Day: TDay;&lt;br /&gt;
begin&lt;br /&gt;
  Day := Mon;&lt;br /&gt;
  if Day &amp;lt;&amp;gt; Tue then&lt;br /&gt;
    Day := Wed;&lt;br /&gt;
end.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| An enumeration is simply a fixed range of named values&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
type&lt;br /&gt;
  TDay = (Mon, Tue, Wed, Thu, Fri, Sat, Sun);&lt;br /&gt;
  TDays = set of TDay;&lt;br /&gt;
var&lt;br /&gt;
  Days: TDays;&lt;br /&gt;
begin&lt;br /&gt;
  Days := [Mon, Tue, Wed];&lt;br /&gt;
  if Sun in Days then&lt;br /&gt;
    Days := Days - [Sun];&lt;br /&gt;
end.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
| Whereas enumerations allow a variable to have one, and only one, value from a fixed number of values, sets allow you to have any combination of the given values&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Custom types ==&lt;br /&gt;
&lt;br /&gt;
Several types are custom defined to simplify the usage of some functions.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Type&lt;br /&gt;
! Declared as&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;TDateTime&#039;&#039;&#039;&lt;br /&gt;
| Double&lt;br /&gt;
| Holds date and time&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;TStringsArray&#039;&#039;&#039;&lt;br /&gt;
| Array of WideString&lt;br /&gt;
| Holds an indexable sequence of WideString&lt;br /&gt;
|}&lt;br /&gt;
[[Category:ReNamer]]&lt;/div&gt;</summary>
		<author><name>Andrew</name></author>
	</entry>
</feed>