Function library:
//Find the string that best matches the target string
function MaxMatchStr(DestStr:String;Strs:array of String):String;
//Remove spaces in Text
function FmtText(Text:String):String;
//Format floating point numbers and correct floating point errors.
function FmtFloat(Value:Extended;Digits:Integer=4):Double;
//Replace substring in Str
procedure ReplaceStr(var Str:String;const SourceStr,DestStr:String);
//Whether the expression Expression contains the item Item
function IncludeItem(Expression,Item:String):Boolean;
//Display message box
function MsgBox(const Handle:THandle;Text,Caption:String;
Flag:Integer):Integer;
//display message
procedure ShowMsg(Sender:TCustomForm;Msg:String);
//Display errors and terminate the current event
procedure ShowError(Sender:TCustomForm;Error:String);
//display error
procedure ErrorMsg(Sender:TCustomForm;Error:String);
//Show warning
procedure ShowWarning(Sender:TCustomForm;Warning:String);
//Read registry data name and value
procedure GetNamesAndValues(Registry:TRegistry;NamesValues:TStrings);
//Write data to the registry
procedure WriteValues(Registry:TRegistry;ValueNames:array of String;Values:array of Variant);
//Read the string value in the registry
function ReadRegistString(ARootKey:HKEY;Key,Name:String;DefaultValue:String= ):String;
//Write string value to registry
procedure WriteRegistString(ARootKey:HKEY;Key,Name,Value:String);
//Read the integer value in the registry
function ReadRegistInteger(ARootKey:HKEY;Key,Name:String;DefaultValue:Integer=0):Integer;
//Write an integer value to the registry
procedure WriteRegistWord(ARootKey:HKEY;Key,Name:String;Value:Integer);
//Read the Boolean value in the registry
function ReadRegistBool(ARootKey:HKEY;Key,Name:String;DefaultValue:Boolean=False):Boolean;
//Write a boolean value to the registry
procedure WriteRegistBool(ARootKey:HKEY;Key,Name:String;Value:Boolean);
//Represent date in Chinese format: XXXX year XX month XX day
function DateToChinese(ADate:TDate):String;
//Get the local machine name
function GetComputerName:String;
//Get the temporary file directory
function GetWinTempDir:String;
//Get system directory
function GetSystemDir:String;
//Generate temporary file name
function GetTempFile(PathName,PrefixStr:String;UniqueID:Integer=0):String;