zoukankan      html  css  js  c++  java
  • delphi:函数大全 2(SysUtils.pas)(转载)

    首部 function Languages: TLanguages;
    功能 返回系统语言对象
    说明 通过此函数可以得到系统的语言环境
    参考 type SysUtils.TLanguages
    例子
    ///////Begin Languages
    procedure TForm1.Button1Click(Sender: TObject);
    var
    I: Integer;
    begin
    Memo1.Clear;
    for I := 0 to Languages.Count - 1 do
    Memo1.Lines.Add(Languages.Name[I]);
    end;
    ///////End Languages
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function AllocMem(Size: Cardinal): Pointer;
    功能 返回一个指定大小Size的内存块
    说明 配合用FreeMem释放资源
    参考 function System.GetMem
    例子
    ///////Begin AllocMem
    procedure TForm1.Button1Click(Sender: TObject);
    var
    I: PInteger;
    begin
    I := AllocMem(SizeOf(Integer));
    I^ := 100;
    Edit1.Text := IntToStr(I^);
    FreeMem(I, SizeOf(Integer));
    end;
    ///////End AllocMem
    ━━━━━━━━━━━━━━━━━━━━━
    首部 procedure AddExitProc(Proc: TProcedure);
    功能 添加一个退出处理的过程
    说明 建议用finalization部分取代
    参考 <NULL>
    例子
    ////////Begin AddExitProc
    uses
    ShellApi;
    procedure ExitProc;
    begin
    ShellExecute(0, 'Open', 'Calc.exe', nil, nil, SW_SHOW);
    end;
    procedure TForm1.Button1Click(Sender: TObject);
    begin
    AddExitProc(ExitProc);
    end;
    ////////End AddExitProc
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function NewStr(const S: string): PString; deprecated;
    功能 返回一个新的字符串指针地址
    说明 字符串S为空时返回NullStr
    参考 procedure System.New
    例子
    ////////Begin NewStr,DisposeStr
    procedure TForm1.Button1Click(Sender: TObject);
    var
    P: PString;
    begin
    P := NewStr(Edit1.Text);
    Edit2.Text := P^;
    DisposeStr(P);
    end;
    ////////End NewStr,DisposeStr
    ━━━━━━━━━━━━━━━━━━━━━
    首部 procedure DisposeStr(P: PString); deprecated;
    功能 释放字符串指针P资源
    说明 配合函数NewStr使用
    参考 procedure System.Dispose
    例子 <如上参见,如下参见>
    ━━━━━━━━━━━━━━━━━━━━━
    首部 procedure AssignStr(var P: PString; const S: string); deprecated;
    功能 将字符串S更新给字符串指针P
    说明 更新值时会释放以前字符串指针的资源
    参考 function SysUtils.NewStr;function SysUtils.DisposeStr
    例子
    ////////Begin AssignStr
    procedure TForm1.Button1Click(Sender: TObject);
    var
    P: PString;
    begin
    P := nil;
    AssignStr(P, Edit1.Text);
    Edit2.Text := P^;
    DisposeStr(P);
    end;
    ////////End AssignStr
    ━━━━━━━━━━━━━━━━━━━━━
    首部 procedure AppendStr(var Dest: string; const S: string); deprecated;
    功能 在字符串Dest后追加字符串S
    说明 相当于Dest := Dest + S;Delphi6已经不建议使用
    参考 <NULL>
    例子
    ////////Begin AppendStr
    procedure TForm1.Button1Click(Sender: TObject);
    var
    S: string;
    begin
    S := Edit2.Text;
    AppendStr(S, Edit1.Text);
    Edit2.Text := S;
    end;
    ////////End AppendStr
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function UpperCase(const S: string): string;
    功能 返回字符串S的大写形式
    说明 非小写字符不处理
    参考 procedure System.SetLength
    例子 Edit2.Text := UpperCase(Edit1.Text);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function LowerCase(const S: string): string;
    功能 返回字符串S的小写形式
    说明 非大写字符不处理
    参考 procedure System.SetLength
    例子 Edit2.Text := LowerCase(Edit1.Text);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function CompareStr(const S1, S2: string): Integer;
    功能 返回比较两个字符
    说明 当S1>S2返回值>0;当S1<S2返回值<0;当S1=S2返回值=0;区分大小写
    参考 <NULL>
    例子 SpinEdit1.Value := CompareStr(Edit1.Text, Edit2.Text);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function CompareMem(P1, P2: Pointer; Length: Integer): Boolean; assembler;
    功能 返回比较两个内存指针
    说明 CompareMem(PChar('12a'), PChar('12c'), 2)=True;CompareMem(PChar('12a'), PChar('12c'), 3)=False
    参考 <NULL>
    例子 CheckBox1.Checked := CompareMem(Self, Form1, 8);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function CompareText(const S1, S2: string): Integer;
    功能 返回比较两个字符串
    说明 不区分大小写
    参考 <NULL>
    例子 SpinEdit1.Value := CompareText(Edit1.Text, Edit2.Text);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function SameText(const S1, S2: string): Boolean;
    功能 返回两个字符串是否相等
    说明 不区分大小写
    参考 <NULL>
    例子 CheckBox1.Checked := SameText(Edit1.Text, Edit2.Text);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function AnsiUpperCase(const S: string): string;
    功能 返回字符串S的大写形式
    说明 ANSI(American National Standards Institute)美国国家标准协会;非小写的字符不变
    参考 function Windows.CharUpperBuff
    例子 Edit2.Text := AnsiUpperCase(Edit1.Text);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function AnsiLowerCase(const S: string): string;
    功能 返回字符串S的小写形式
    说明 非大写字符不处理
    参考 function Windows.CharLowerBuff
    例子 Edit2.Text := AnsiLowerCase(Edit1.Text);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function AnsiCompareStr(const S1, S2: string): Integer;
    功能 反回比较两个字符串
    说明 当S1>S2返回值>0;当S1<S2返回值<0;当S1=S2返回值=0;区分大小写
    参考 function Windows.CompareString
    例子 SpinEdit1.Value := AnsiCompareStr(Edit1.Text, Edit2.Text);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function AnsiSameStr(const S1, S2: string): Boolean;
    功能 返回两个字符串是否相等
    说明 区分大小写
    参考 function SysUtils.AnsiCompareStr
    例子 CheckBox1.Checked := AnsiSameStr(Edit1.Text, Edit2.Text);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function AnsiCompareText(const S1, S2: string): Integer;
    功能 反回比较两个字符串
    说明 当S1>S2返回值>0;当S1<S2返回值<0;当S1=S2返回值=0;不区分大小写
    参考 function Windows.CompareString
    例子 SpinEdit1.Value := AnsiCompareText(Edit1.Text, Edit2.Text);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function AnsiSameText(const S1, S2: string): Boolean;
    功能 返回两个字符串是否相等
    说明 不区分大小写
    参考 function SysUtils.AnsiCompareText
    例子 CheckBox1.Checked := AnsiSameText(Edit1.Text, Edit2.Text);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function AnsiStrComp(S1, S2: PChar): Integer;
    功能 返回比较两个指针字符串
    说明 当S1>S2返回值>0;当S1<S2返回值<0;当S1=S2返回值=0;区分大小写
    参考 function System.CompareString
    例子 SpinEdit1.Value := AnsiStrComp(PChar(Edit1.Text), PChar(Edit2.Text))
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function AnsiStrIComp(S1, S2: PChar): Integer;
    功能 返回比较两个指针字符串
    说明 当S1>S2返回值>0;当S1<S2返回值<0;当S1=S2返回值=0;不区分大小写;Ignore(忽略)
    参考 function Windows.CompareString
    例子 SpinEdit1.Value := AnsiStrIComp(PChar(Edit1.Text), PChar(Edit2.Text))
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function AnsiStrLComp(S1, S2: PChar; MaxLen: Cardinal): Integer;
    功能 返回比较两个指针字符串指定长度
    说明 当S1>S2返回值>0;当S1<S2返回值<0;当S1=S2返回值=0;区分大小写;Length(长度)
    参考 function Windows.CompareString
    例子 SpinEdit1.Value := AnsiStrLComp(PChar(Edit1.Text), PChar(Edit2.Text), SpinEdit2.Value)
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function AnsiStrLIComp(S1, S2: PChar; MaxLen: Cardinal): Integer;
    功能 返回比较两个指针字符串指定长度
    说明 当S1>S2返回值>0;当S1<S2返回值<0;当S1=S2返回值=0;不区分大小写
    参考 function Windows.CompareString
    例子 SpinEdit1.Value := AnsiStrLIComp(PChar(Edit1.Text), PChar(Edit2.Text), SpinEdit2.Value)
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function AnsiStrLower(Str: PChar): PChar;
    功能 返回指针字符串小写形式
    说明 非大写字符不处理
    参考 function Windows.CharLower
    例子 Edit2.Text := AnsiStrLower(PChar(Edit1.Text));
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function AnsiStrUpper(Str: PChar): PChar;
    功能 返回指针字符串大写形式
    说明 非小写字符不处理
    参考 function Windows.CharUpper
    例子 Edit2.Text := AnsiStrUpper(PChar(Edit1.Text));
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function AnsiLastChar(const S: string): PChar;
    功能 返回字符串S的最后一个指针字符
    说明 当字符串S为空串则返回空指针
    参考 function SysUtils.ByteType
    例子 Edit2.Text := AnsiLastChar(Edit1.Text);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function AnsiStrLastChar(P: PChar): PChar;
    功能 返回指针字符串P的最后一个指针字符
    说明 当字符串P为空空指针则返回空指针
    参考 function SysUtils.ByteType
    例子 Edit2.Text := AnsiLastChar(PChar(Edit1.Text));
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function WideUpperCase(const S: WideString): WideString;
    功能 返回双字节字符串的大写形式
    说明 WideChar双字节字符
    参考 function Windows.CharUpperBuffW
    例子 Edit2.Text := WideUpperCase(Edit1.Text);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function WideLowerCase(const S: WideString): WideString;
    功能 返回双字节字符串的小写形式
    说明 我怎么就测试不出来呢
    参考 function Windows.CharLowerBuffW
    例子 Edit2.Text := WideLowerCase(Edit1.Text);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function WideCompareStr(const S1, S2: WideString): Integer;
    功能 返回比较两个双字节字符串
    说明 当S1>S2返回值>0;当S1<S2返回值<0;当S1=S2返回值=0;区分大小写
    参考 function Windows.CompareStringW
    例子 SpinEdit1.Value := WideCompareStr(Edit1.Text, Edit2.Text);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function WideSameStr(const S1, S2: WideString): Boolean;
    功能 返回两个双字节字符串是否相同
    说明 区分大小写
    参考 function SysUtils.WideCompareStr
    例子 CheckBox1.Checked := WideSameStr(Edit1.Text, Edit2.Text);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function WideCompareText(const S1, S2: WideString): Integer;
    功能 返回比较两个双字节字符串
    说明 当S1>S2返回值>0;当S1<S2返回值<0;当S1=S2返回值=0;不区分大小写
    参考 function Windows.CompareStringW
    例子 SpinEdit1.Value := WideCompareText(Edit1.Text, Edit2.Text);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function WideSameText(const S1, S2: WideString): Boolean;
    功能 返回两个双字节字符串是否相同
    说明 不区分大小写
    参考 function SysUtils.WideCompareText
    例子 CheckBox1.Checked := WideSameText(Edit1.Text, Edit2.Text);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function Trim(const S: string): string; overload;
    首部 function Trim(const S: WideString): WideString; overload;
    功能 返回除去字符串S左右不可见字符
    说明 小于#32的字符看作不可见字符
    参考 function System.Copy
    例子 Edit2.Text := Trim(Edit1.Text);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function TrimLeft(const S: string): string; overload;
    首部 function TrimLeft(const S: WideString): WideString; overload;
    功能 返回除去字符串S左边不可见字符
    说明 小于#32的字符看作不可见字符
    参考 function System.Copy
    例子 Edit2.Text := TrimLeft(Edit1.Text);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function TrimRight(const S: string): string; overload;
    首部 function TrimRight(const S: WideString): WideString; overload;
    功能 返回除去字符串S右边不可见字符
    说明 小于#32的字符看作不可见字符
    参考 function System.Copy
    例子 Edit2.Text := TrimRight(Edit1.Text);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function QuotedStr(const S: string): string;
    功能 返回字符串S在pascal中的表现形式
    说明 单引号中的一个单引号将转成两个
    参考 procedure System.Insert
    例子 Edit2.Text := QuotedStr(Edit1.Text);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function AnsiQuotedStr(const S: string; Quote: Char): string;
    功能 返回字符串S以字符Quote为引号的表现形式
    说明 AnsiQuotedStr('hello"world', '@')='@hello"world@';AnsiQuotedStr('hello"world', '"')='"hello""world"'
    参考 function SysUtils.AnsiStrScan
    例子 Edit2.Text := AnsiQuotedStr(Edit1.Text, '"');
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function AnsiExtractQuotedStr(var Src: PChar; Quote: Char): string;
    功能 返回以字符Quote为引号的表现形式原形
    说明 表现形式非法时Src不变否则为空
    参考 function SysUtils.AnsiStrScan
    例子
    ///////Begin AnsiExtractQuotedStr
    procedure TForm1.Button1Click(Sender: TObject);
    var
    P: PChar;
    begin
    P := PChar(Edit1.Text);
    Edit2.Text := AnsiExtractQuotedStr(P, '"');
    Edit3.Text := P;
    end;
    ///////End AnsiExtractQuotedStr
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function AnsiDequotedStr(const S: string; AQuote: Char): string;
    功能 返回以字符AQuote为引号的表现形式原形
    说明 表现形式非法时则返回S
    参考 function SysUtils.AnsiExtractQuotedStr
    例子 Edit2.Text := AnsiDequotedStr(Edit1.Text, '"');
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function AdjustLineBreaks(const S: string; Style: TTextLineBreakStyle = {$IFDEF LINUX} tlbsLF {$ENDIF} {$IFDEF MSWINDOWS} tlbsCRLF {$ENDIF}): string;
    功能 返回将给定字符串的行分隔符调整为CR/LF序列
    说明 AdjustLineBreaks('1'#13'2'#13)='1'#13#10'2'#13#10;AdjustLineBreaks('1'#10'2'#10)='1'#13#10'2'#13#10
    参考 function SysUtils.StrNextChar
    例子 <NULL>
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function IsValidIdent(const Ident: string): Boolean;
    功能 返回字符串Ident是否是正确的标识符
    说明 标识符::字母|下划线[字母|下划线|数字]...
    参考 <NULL>
    例子 CheckBox1.Checked := IsValidIdent(Edit1.Text);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function IntToStr(Value: Integer): string; overload;
    首部 function IntToStr(Value: Int64): string; overload;
    功能 返回整数Value转换成字符串
    说明 Format('%d', [Value])
    参考 function SysUtils.FmtStr
    例子 Edit2.Text := IntToStr(SpinEdit1.Value);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function IntToHex(Value: Integer; Digits: Integer): string; overload;
    首部 function IntToHex(Value: Int64; Digits: Integer): string; overload;
    功能 返回整数Value转换成十六进制表现结果;Format('%.*x', [Digits, Value])
    说明 参数Digits指定字符最小宽度;最小宽度不足时将用0填充
    参考 function SysUtils.FmtStr
    例子 Edit2.Text := IntToHex(SpinEdit1.Value, SpinEdit2.Value);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function StrToInt(const S: string): Integer;
    功能 返回字符串S转换成整数
    说明 字符串非整数表达时将引起异常
    参考 procedure System.Val
    例子 SpinEdit1.Value := StrToInt(Edit1.Text);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function StrToIntDef(const S: string; Default: Integer): Integer;
    功能 返回字符串S转换成整数
    说明 字符串非整数表达时则返回默认值Default
    参考 procedure System.Val
    例子 SpinEdit1.Value := StrToIntDef(Edit1.Text, 0);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function TryStrToInt(const S: string; out Value: Integer): Boolean;
    功能 返回字符串S转换成整数Value是否成功
    说明 字符串非整数表达时返回False并且Value将输出为0
    参考 procedure System.Val
    例子
    ///////Begin TryStrToInt
    procedure TForm1.Button1Click(Sender: TObject);
    var
    I: Integer;
    begin
    CheckBox1.Checked := TryStrToInt(Edit1.Text, I);
    SpinEdit1.Value := I;
    end;
    ///////End TryStrToInt
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function StrToInt64(const S: string): Int64;
    功能 返回字符串S转换成六十四位整数
    说明 字符串非六十四位整数表达时将引起异常
    参考 procedure System.Val
    例子 SpinEdit1.Value := StrToInt64(Edit1.Text);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function StrToInt64Def(const S: string; const Default: Int64): Int64;
    功能 返回字符串S转换成六十四位整数
    说明 字符串非六十四位整数表达时则返回默认值Default
    参考 procedure System.Val
    例子 SpinEdit1.Value := StrToInt64Def(Edit1.Text, 0);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function TryStrToInt64(const S: string; out Value: Int64): Boolean;
    功能 返回字符串S转换成六十四位整数Value是否成功
    说明 字符串非六十四位整数表达时返回False并且Value将输出为0
    参考 procedure System.Val
    例子
    ///////Begin TryStrToInt64
    procedure TForm1.Button1Click(Sender: TObject);
    var
    I: Int64;
    begin
    CheckBox1.Checked := TryStrToInt64(Edit1.Text, I);
    SpinEdit1.Value := I;
    end;
    ///////End TryStrToInt64
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function StrToBool(const S: string): Boolean;
    功能 返回字符串S转换成逻辑值
    说明 字符非逻辑表达时将引起异常
    参考 function SysUtils.TryStrToBool
    例子 CheckBox1.Checked := StrToBool(Edit1.Text);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function StrToBoolDef(const S: string; const Default: Boolean): Boolean;
    功能 返回字符串S转换成逻辑值
    说明 字符非逻辑表达时则返回默认值Default
    参考 function SysUtils.TryStrToBool
    例子 CheckBox1.Checked := StrToBoolDef(Edit1.Text, False);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function TryStrToBool(const S: string; out Value: Boolean): Boolean;
    功能 返回字符串S转换成逻辑值Value是否成功
    说明 [注意]0为假非0为真;不是'True'和'False';Delphi6 Bug 如下修正
    参考 function SysUtils.AnsiSameText;var SysUtils.TrueBoolStrs;var SysUtils.FalseBoolStrs
    例子
    ///////Begin TryStrToBool
    procedure TForm1.Button1Click(Sender: TObject);
    var
    B: Boolean;
    begin
    SetLength(TrueBoolStrs, 2);
    SetLength(FalseBoolStrs, 2);
    TrueBoolStrs[0] := 'True';
    FalseBoolStrs[0] := 'False';
    TrueBoolStrs[1] := 'Yes';
    FalseBoolStrs[1] := 'No';
    CheckBox1.Checked := TryStrToBool(Edit1.Text, B);
    CheckBox2.Checked := B;
    end;
    ///////End TryStrToBool
    附加
    ///////Begin TryStrToBool
    function TryStrToBool(const S: string; out Value: Boolean): Boolean;
    function CompareWith(const aArray: array of string): Boolean;
    var
    I: Integer;
    begin
    Result := False;
    for I := Low(aArray) to High(aArray) do
    if AnsiSameText(S, aArray[I]) then
    begin
    Result := True;
    Break;
    end;
    end;
    var
    LResult: Extended;
    begin
    Result := TryStrToFloat(S, LResult);
    if Result then
    Value := LResult <> 0
    else
    begin
    Result := True; //修正处
    VerifyBoolStrArray;
    if CompareWith(TrueBoolStrs) then
    Value := True
    else if CompareWith(FalseBoolStrs) then
    Value := False
    else
    Result := False;
    end;
    end;
    ///////End TryStrToBool
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function BoolToStr(B: Boolean; UseBoolStrs: Boolean = False): string;
    功能 返回逻辑值B转换成字符串
    说明 BoolToStr(False, False)='0';BoolToStr(False, True)='-1'
    参考 var SysUtils.TrueBoolStrs;var SysUtils.FalseBoolStrs
    例子 Edit1.Text := BoolToStr(CheckBox1.Checked, CheckBox2.Checked);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function LoadStr(Ident: Integer): string;
    功能 返回根据标识Ident的字符串资源
    说明 字符串资源是指程序的内部资源
    参考 function SysUtils.FindStringResource
    例子 Edit2.Text := LoadStr(StrToIntDef(Edit1.Text, 0));
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function FmtLoadStr(Ident: Integer; const Args: array of const): string;
    功能 返回格式化的字符串资源
    说明 字符串资源是指程序的内部资源
    参考 function SysUtils.FmtStr;function SysUtils.FindStringResource
    例子 <NULL>;
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function FileOpen(const FileName: string; Mode: LongWord): Integer;
    功能 返回打开文件果
    说明 Mode指定打开文件的模式(fmOpenRead,fmOpenWrite,fmOpenReadWrite....);打开失败则返回负数
    参考 function Windows.CreateFile
    例子
    ///////Begin FileOpen,FileClose
    procedure TForm1.Button1Click(Sender: TObject);
    var
    I: Integer;
    begin
    I := FileOpen(Edit1.Text, fmOpenRead);
    CheckBox1.Checked := I > 0;
    FileClose(I);
    end;
    ///////Begin FileOpen,FileClose
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function FileCreate(const FileName: string): Integer; overload;
    首部 function FileCreate(const FileName: string; Rights: Integer): Integer; overload;
    功能 返回创建文件
    说明 创建失败则返回负数
    参考 function Windows.CreateFile
    例子
    ///////Begin FileCreate
    procedure TForm1.Button1Click(Sender: TObject);
    var
    I: Integer;
    begin
    I := FileCreate(Edit1.Text);
    CheckBox1.Checked := I > 0;
    FileClose(I);
    end;
    ///////End FileCreate
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function FileRead(Handle: Integer; var Buffer; Count: LongWord): Integer;
    功能 返回读取文件缓冲区的大小
    说明 读取失败则返回负数
    参考 function Windows.ReadFile
    例子 <参见FileOpen>
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function FileWrite(Handle: Integer; const Buffer; Count: LongWord): Integer;
    功能 返回写入文件缓冲区的大小
    说明 写入失败则返回负数
    参考 function Windows.WriteFile
    例子 <参见FileCreate>
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function FileSeek(Handle, Offset, Origin: Integer): Integer; overload;
    首部 function FileSeek(Handle: Integer; const Offset: Int64; Origin: Integer): Int64; overload;
    功能 返回指定文件偏移量
    说明 Offset指定偏移量;Origin指定原点(Origin为0时指文件首;为1时指当前位置;为2时指文件尾)
    参考 function Windows.SetFilePointer
    例子 <参见FileOpen>
    ━━━━━━━━━━━━━━━━━━━━━
    首部 procedure FileClose(Handle: Integer);
    功能 返回关闭文件
    说明 不关闭打开的文件会占用系统资源
    参考 function Windows.CloseHandle
    例子 <参见FileOpen>
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function FileAge(const FileName: string): Integer;
    功能 返回文件创建的时间
    说明 文件不存在则返回-1
    参考 function Windows.FindFirstFile
    例子
    ///////Begin FileAge,DateTimeToStr,FileDateToDateTime
    procedure TForm1.Button1Click(Sender: TObject);
    begin
    SpinEdit1.Value := FileAge(Edit1.Text);
    if SpinEdit1.Value > 0 then
    Edit2.Text := DateTimeToStr(FileDateToDateTime(SpinEdit1.Value));
    end;
    ///////End FileAge,DateTimeToStr,FileDateToDateTime
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function FileExists(const FileName: string): Boolean;
    功能 返回文件名FileName是否有实体存在
    说明 包括隐藏文件
    参考 function SysUtils.FileAge
    例子 CheckBox1.Checked := FileExists(Edit1.Text);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function DirectoryExists(const Directory: string): Boolean;
    功能 返回目录名FileName是否有实体存在
    说明 包括隐藏目录
    参考 function Windows.GetFileAttributes
    例子 CheckBox1.Checked := DirectoryExists(Edit1.Text);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function ForceDirectories(Dir: string): Boolean;
    功能 返回创建子目录是否成功
    说明 直接创建多级目录
    参考 function SysUtils.CreateDir
    例子 CheckBox1.Checked := ForceDirectories(Edit1.Text);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function FindFirst(const Path: string; Attr: Integer; var F: TSearchRec): Integer;
    功能 返回设置文件搜索
    说明 搜索成功则返回0
    参考 function Windows.FindFirstFile
    例子
    ///////Begin FindFirst,FindNext,FindClose
    procedure TForm1.Button1Click(Sender: TObject);
    var
    vSearchRec: TSearchRec;
    I: Integer;
    begin
    Memo1.Clear;
    I := FindFirst(Edit1.Text, faAnyFile, vSearchRec);
    while I = 0 do begin
    Memo1.Lines.Add(vSearchRec.Name);
    I := FindNext(vSearchRec);
    end;
    FindClose(vSearchRec);
    end;
    ///////End FindFirst,FindNext,FindClose
    ━━━━━━━━━━━━━━━━━━━━━

    首部 function FindNext(var F: TSearchRec): Integer;
    功能 返回继续文件搜索
    说明 搜索成功则返回0
    参考 function Windows.FindNextFile
    例子 <参见FindFirst>
    ━━━━━━━━━━━━━━━━━━━━━
    首部 procedure FindClose(var F: TSearchRec);
    功能 结束当前文件搜索
    说明 不关闭查询会占用系统资源
    参考 function Windows.FindClose
    例子 <参见FindFirst>
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function FileGetDate(Handle: Integer): Integer;
    功能 返回文件的修改时间
    说明 读取失败则返回-1
    参考 function Windows.GetFileTime
    例子
    ///////Begin FileGetDate
    procedure TForm1.Button1Click(Sender: TObject);
    var
    I: Integer;
    begin
    I := FileOpen(Edit1.Text, fmOpenRead);
    if I < 0 then Exit;
    SpinEdit1.Value := FileGetDate(I);
    Edit2.Text := DateTimeToStr(FileDateToDateTime(SpinEdit1.Value));
    FileClose(I);
    end;
    ///////End FileGetDate
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function FileSetDate(const FileName: string; Age: Integer): Integer; overload;
    首部 function FileSetDate(Handle: Integer; Age: Integer): Integer; overload; platform;
    功能 返回设置文件的修改时间
    说明 修改成功则返回0
    参考 function Windows.SetFileTime
    例子 SpinEdit1.Value := FileSetDate(Edit1.Text, DateTimeToFileDate(StrToDateTime(Edit2.Text)));
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function FileGetAttr(const FileName: string): Integer; platform;
    功能 返回文件的属性
    说明 读取失败则返回$FFFFFFFF
    参考 function Windows.GetFileAttributes
    例子 SpinEdit1.Value := FileGetAttr(Edit1.Text);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function FileSetAttr(const FileName: string; Attr: Integer): Integer; platform;
    功能 返回设置文件的属性
    说明 设置成功则返回0
    参考 function Windows.SetFileAttributes
    例子 SpinEdit1.Value := FileSetAttr(Edit1.Text, SpinEdit2.Value);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function FileIsReadOnly(const FileName: string): Boolean;
    功能 返回文件是否只读
    说明 文件不存在看作只读
    参考 function Windows.GetFileAttributes
    例子 CheckBox1.Checked := FileIsReadOnly(Edit1.Text);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function FileSetReadOnly(const FileName: string; ReadOnly: Boolean): Boolean;
    功能 返回设置文件是否只读是否成功
    说明 文件不存在则返回False
    参考 function Windows.GetFileAttributes;function Windows.SetFileAttributes
    例子 CheckBox1.Checked := FileSetReadOnly(Edit1.Text, CheckBox2.Checked);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function DeleteFile(const FileName: string): Boolean;
    功能 返回删除文件是否成功
    说明 文件不存在则返回False
    参考 function Windows.DeleteFile
    例子 CheckBox1.Checked := DeleteFile(Edit1.Text);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function RenameFile(const OldName, NewName: string): Boolean;
    功能 返回重命名文件是否成功
    说明 文件不存在则返回False
    参考 function Windows.MoveFile
    例子 CheckBox1.Checked := RenameFile(Edit1.Text, Edit2.Text);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function ChangeFileExt(const FileName, Extension: string): string;
    功能 返回改变扩展名后的文件名
    说明 [注意]扩展名Extension前要加点;ChangeFileExt('a.jpg', 'bmp')='abmp'
    参考 function SysUtils.LastDelimiter;function System.Copy
    例子 Edit1.Text := ChangeFileExt(Edit2.Text, Edit3.Text);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function ExtractFilePath(const FileName: string): string;
    功能 返回文件名所在的路径
    说明 ExtractFilePath('C:/')='C:/';ExtractFilePath('//Server/Tool/Calc.exe')='//Server/Tool/'
    参考 function SysUtils.LastDelimiter;function System.Copy
    例子 Edit1.Text := ExtractFilePath(Edit2.Text);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function ExtractFileDir(const FileName: string): string;
    功能 返回文件名所在的目录
    说明 ExtractFileDir('C:/')='C:/';ExtractFileDir('//Server/Tool/Calc.exe')='//Server/Tool'
    参考 function SysUtils.LastDelimiter;function System.Copy
    例子 Edit1.Text := ExtractFileDir(Edit2.Text);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function ExtractFileDrive(const FileName: string): string;
    功能 返回文件名所在驱动器
    说明 ExtractFileDrive('C:/')='C:';ExtractFileDrive('//Server/Tool/Calc.exe')='//Server/Tool'
    参考 function System.Copy
    例子 Edit1.Text := ExtractFileDrive(Edit2.Text);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function ExtractFileName(const FileName: string): string;
    功能 返回绝对文件名
    说明 ExtractFileName('C:/')='';ExtractFileName('//Server/Tool/Calc.exe')='Calc.exe'
    参考 function SysUtils.LastDelimiter;function System.Copy
    例子 Edit1.Text := ExtractFileName(Edit2.Text);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function ExtractFileExt(const FileName: string): string;
    功能 返回文件名的扩展名
    说明 ExtractFileExt('C:/')='';ExtractFileExt('//Server/Tool/Calc.exe')='.exe'
    参考 function SysUtils.LastDelimiter;function System.Copy
    例子 Edit1.Text := ExtractFileExt(Edit2.Text);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function ExpandFileName(const FileName: string): string;
    功能 返回文件名的完整表示
    说明 ExpandFileName('hello.pas')='C:/Program Files/Borland/Delphi6/Projects/hello.pas'
    参考 function Windows.GetFullPathName
    例子 Edit1.Text := ExpandFileName(Edit2.Text);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function ExpandFileNameCase(const FileName: string; out MatchFound: TFilenameCaseMatch): string;
    功能 分情况返回文件名的完整表示
    说明 type TFilenameCaseMatch = (mkNone, mkExactMatch, mkSingleMatch, mkAmbiguous);
    参考 function Windows.GetFullPathName;function SysUtils.SameFileName;function SysUtils.FindFirst
    例子
    ///////Begin ExpandFileNameCase
    procedure TForm1.Button1Click(Sender: TObject);
    var
    vFilenameCaseMatch: TFilenameCaseMatch;
    begin
    Edit1.Text := ExpandFileNameCase(Edit2.Text, vFilenameCaseMatch);
    SpinEdit1.Value := Ord(vFilenameCaseMatch);
    end;
    ///////End ExpandFileNameCase
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function ExpandUNCFileName(const FileName: string): string;
    功能 返回LINUX文件名的完整表示
    说明 ExpandUNCFileName('C:/')='C:/'
    参考 function SysUtils.ExpandFileName
    例子 Edit1.Text := ExpandUNCFileName(Edit2.Text);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function ExtractRelativePath(const BaseName, DestName: string): string;
    功能 返回参数的相对路径
    说明 ExtractRelativePath('C:/Windows/', 'C:/Windows/System')='System'
    参考 function SysUtils.SameFilename;function SysUtils.ExtractFileDrive
    例子 Edit1.Text := ExtractRelativePath(Edit2.Text, Edit3.Text);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function ExtractShortPathName(const FileName: string): string;
    功能 返回参数的DOS路径
    说明 ExtractShortPathName('C:/Program Files/Borland')='C:/PROGRA~1/BORLAND'
    参考 function Windows.GetShortPathName
    例子 Edit1.Text := ExtractShortPathName(Edit2.Text);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function FileSearch(const Name, DirList: string): string;
    功能 返回目录列表中DirList搜索的第一个结果
    说明 FileSearch('Calc.exe', 'd:/winxp/system32;c:/windows')='d:/winxp/system32/calc.exe'
    参考 function SysUtils.FileExists;function SysUtils.AnsiLastChar
    例子 Edit1.Text := FileSearch(Edit2.Text, Edit3.Text);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function DiskFree(Drive: Byte): Int64;
    功能 返回驱动器可用空间
    说明 参数Drive为0表示当前路径,为1表示=A驱,为2表示=B驱...;获取失败则返回-1
    参考 function Windows.GetDiskFreeSpaceExA
    例子 SpinEdit1.Value := DiskFree(SpinEdit2.Value);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function DiskSize(Drive: Byte): Int64;
    功能 返回驱动器全部空间
    说明 参数Drive为0表示当前路径,为1表示=A驱,为2表示=B驱...;获取失败则返回-1
    参考 function Windows.GetDiskFreeSpaceExA
    例子 SpinEdit1.Value := DiskSize(SpinEdit2.Value);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function FileDateToDateTime(FileDate: Integer): TDateTime;
    功能 返回将文件日期时间类型转换日期时间类型
    说明 FileDate非法是将触发异常
    参考 function SysUtils.EncodeDate;function SysUtils.EncodeTime
    例子 <参见FileAge>
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function DateTimeToFileDate(DateTime: TDateTime): Integer;
    功能 返回将日期时间类型转换文件日期时间类型
    说明 年份在1980到2107之外则返回0
    参考 function SysUtils.DecodeDate;function SysUtils.DecodeTime
    例子 <参见FileSetDate>
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function GetCurrentDir: string;
    功能 返回当前操作目录
    说明 [注意]调用文件对话框会改变当前操作目录
    参考 function System.GetDir
    例子 Edit1.Text := GetCurrentDir;
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function SetCurrentDir(const Dir: string): Boolean;
    功能 返回设置当前操作目录是否成功
    说明 [注意]调用文件对话框会改变当前操作目录
    参考 function Windows.SetCurrentDirectory
    例子 CheckBox1.Checked := SetCurrentDir(Edit1.Text);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function CreateDir(const Dir: string): Boolean;
    功能 返回创建目录是否成功
    说明 不支持多级目录;已经存在则返回False
    参考 function Windows.CreateDirectory
    例子 CheckBox1.Checked := CreateDir(Edit1.Text);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function RemoveDir(const Dir: string): Boolean;
    功能 返回删除目录是否成功
    说明 必须是空目录
    参考 function Windows.RemoveDirectory
    例子 CheckBox1.Checked := RemoveDir(Edit1.Text);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function StrLen(const Str: PChar): Cardinal;
    功能 返回指针字符串的长度
    说明 当指针字符串Str为nil时将触发异常
    参考 <NULL>
    例子 SpinEdit2.Value := StrLen(PChar(Edit1.Text));
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function StrEnd(const Str: PChar): PChar;
    功能 返回指针字符串的结尾
    说明 当指针字符串Str为nil时将触发异常
    参考 <NULL>
    例子 Edit2.Text := StrEnd(PChar(Edit1.Text)) - SpinEdit1.Value;
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function StrMove(Dest: PChar; const Source: PChar; Count: Cardinal): PChar;
    功能 返回将指针字符串Source指定内存数量Count复制覆盖到指针字符串Dest中
    说明 Dest没有分配资源将触发异常s
    参考 function System.Move
    例子
    ///////Begin StrMove
    procedure TForm1.Button1Click(Sender: TObject);
    var
    vBuffer: PChar;
    begin
    vBuffer := '0123456789';
    StrMove(vBuffer, PChar(Edit1.Text), SpinEdit1.Value);
    Edit2.Text := vBuffer;
    end;
    ///////End StrMove
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function StrCopy(Dest: PChar; const Source: PChar): PChar;
    功能 返回将指针字符串Source复制到指针字符串Dest中
    说明 Dest应已经分配足够的空间非则将触发异常
    参考 <NULL>
    例子
    ///////Begin StrCopy
    procedure TForm1.Button1Click(Sender: TObject);
    var
    vBuffer: PChar;
    begin
    GetMem(vBuffer, Length(Edit1.Text) + 1);
    StrCopy(vBuffer, PChar(Edit1.Text));
    Edit2.Text := vBuffer;
    FreeMem(vBuffer);
    end;
    ///////End StrCopy
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function StrECopy(Dest:PChar; const Source: PChar): PChar;
    功能 返回将指针字符串Source复制到指针字符串Dest中的结尾
    说明 可以连接指针字符串
    参考 <NULL>
    例子
    ///////Begin StrECopy
    procedure TForm1.Button1Click(Sender: TObject);
    var
    vBuffer: array[0..255] of Char;
    begin
    StrECopy(StrECopy(vBuffer, PChar(Edit1.Text)), PChar(Edit2.Text));
    Edit3.Text := vBuffer;
    end;
    ///////End StrECopy
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function StrLCopy(Dest: PChar; const Source: PChar; MaxLen: Cardinal): PChar;
    功能 返回将指针字符串Source指定长度MaxLen复制到指针字符串Dest中
    说明 Dest应已经分配足够的空间非则将触发异常
    参考 <NULL>
    例子
    ///////Begin StrLCopy
    procedure TForm1.Button1Click(Sender: TObject);
    var
    vBuffer: array[0..255] of Char;
    begin
    StrLCopy(vBuffer, PChar(Edit1.Text), SpinEdit1.Value);
    Edit2.Text := vBuffer;
    end;
    ///////End StrLCopy
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function StrPCopy(Dest: PChar; const Source: string): PChar;
    功能 返回将指针字符串Source复制到指针字符串Dest中
    说明 StrLCopy(Dest, PChar(Source), Length(Source))
    参考 function SysUtils.StrLCopy
    例子
    ///////Begin StrPCopy
    procedure TForm1.Button1Click(Sender: TObject);
    var
    vBuffer: array[0..255] of Char;
    begin
    StrPCopy(vBuffer, PChar(Edit1.Text));
    Edit2.Text := vBuffer;
    end;
    ///////End StrPCopy
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function StrPLCopy(Dest: PChar; const Source: string; MaxLen: Cardinal): PChar;
    功能 返回将字符串Source指定长度MaxLen复制到指针字符串Dest中
    说明 StrLCopy(Dest, PChar(Source), MaxLen)
    参考 function SysUtils.StrLCopy
    例子
    ///////Begin StrPLCopy
    procedure TForm1.Button1Click(Sender: TObject);
    var
    vBuffer: array[0..255] of Char;
    begin
    StrPLCopy(vBuffer, Edit1.Text, SpinEdit1.Value);
    Edit2.Text := vBuffer;
    end;
    ///////End StrPLCopy
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function StrCat(Dest: PChar; const Source: PChar): PChar;
    功能 返回连接指针字符串Dest和指针字符串Source
    说明 StrCopy(StrEnd(Dest), Source)
    参考 function SysUntils.StrCopy
    例子
    ///////Begin StrCat
    procedure TForm1.Button1Click(Sender: TObject);
    var
    vBuffer: array[0..255] of Char;
    begin
    StrPCopy(vBuffer, Edit1.Text);
    StrCat(vBuffer, PChar(Edit2.Text));
    Edit3.Text := vBuffer;
    end;
    ///////End StrCat
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function StrLCat(Dest: PChar; const Source: PChar; MaxLen: Cardinal): PChar;
    功能 返回连接指针字符串Dest和指针字符串Source
    说明 [注意]MaxLen指定连接后的最大长度不是指针字符串Source的长度
    参考 <NULL>
    例子
    ///////Begin StrLCat
    procedure TForm1.Button1Click(Sender: TObject);
    var
    vBuffer: array[0..255] of Char;
    begin
    StrPCopy(vBuffer, Edit1.Text);
    StrLCat(vBuffer, PChar(Edit2.Text), SpinEdit1.Value);
    Edit3.Text := vBuffer;
    end;
    ///////End StrLCat
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function StrComp(const Str1, Str2: PChar): Integer;
    功能 返回比较两个指针字符串
    说明 当S1>S2返回值>0;当S1<S2返回值<0;当S1=S2返回值=0;区分大小写;[注意]返回第一个出现不同字符的差异
    参考 <NULL>
    例子 SpinEdit1.Value := StrComp(PChar(Edit1.Text), PChar(Edit2.Text));
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function StrIComp(const Str1, Str2: PChar): Integer;
    功能 返回比较两个指针字符串
    说明 当S1>S2返回值>0;当S1<S2返回值<0;当S1=S2返回值=0;不区分大小写;[注意]返回第一个出现不同字符的差异
    参考 <NULL>
    例子 SpinEdit1.Value := StrIComp(PChar(Edit1.Text), PChar(Edit2.Text));
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function StrLComp(const Str1, Str2: PChar; MaxLen: Cardinal): Integer;
    功能 返回比较两个指针字符串指定长度
    说明 当S1>S2返回值>0;当S1<S2返回值<0;当S1=S2返回值=0;区分大小写;Length(长度);[注意]返回第一个出现不同字符的差异
    参考 <NULL>
    例子 SpinEdit1.Value := StrLComp(PChar(Edit1.Text), PChar(Edit2.Text), SpinEdit2.Value)
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function StrLIComp(const Str1, Str2: PChar; MaxLen: Cardinal): Integer;
    功能 返回比较两个指针字符串指定长度
    说明 当S1>S2返回值>0;当S1<S2返回值<0;当S1=S2返回值=0;不区分大小写;[注意]返回第一个出现不同字符的差异
    参考 <NULL>
    例子 SpinEdit1.Value := StrLIComp(PChar(Edit1.Text), PChar(Edit2.Text), SpinEdit2.Value)
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function StrScan(const Str: PChar; Chr: Char): PChar;
    功能 返回在指针字符串Str搜索字符Chr第一个出现的地址
    说明 没有找到则返回空指针
    参考 <NULL>
    例子 Edit2.Text := StrScan(PChar(Edit1.Text), '*');
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function StrRScan(const Str: PChar; Chr: Char): PChar;
    功能 返回在指针字符串Str搜索字符Chr最后一个出现的地址
    说明 没有找到则返回空指针
    参考 <NULL>
    例子 Edit2.Text := StrRScan(PChar(Edit1.Text), '*');
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function StrPos(const Str1, Str2: PChar): PChar;
    功能 返回指针字符串Str2在Str1中第一个出现的地址
    说明 没有找到则返回空指针;StrPos('12345', '3') = '345'
    参考 <NULL>
    例子 Edit3.Text := StrPos(PChar(Edit1.Text), PChar(Edit2.Text));
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function StrUpper(Str: PChar): PChar;
    功能 返回指针字符串Str大写
    说明 非小写字符不处理
    参考 <NULL>
    例子 Edit1.Text := StrUpper(PChar(Edit2.Text));
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function StrLower(Str: PChar): PChar;
    功能 返回指针字符串Str小写
    说明 非大写字符不处理
    参考 <NULL>
    例子 Edit1.Text := StrLower(PChar(Edit2.Text));
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function StrPas(const Str: PChar): string;
    功能 返回指针字符串Str转换成字符串
    说明 也可以直接赋值
    参考 <NULL>
    例子 Edit1.Text := StrPas(PChar(Edit2.Text));
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function StrAlloc(Size: Cardinal): PChar;
    功能 返回分配指定空间的内存资源给指针字符串
    说明 空间的大小也将保存;用StrDispose才能全部释放
    参考 function System.GetMem
    例子
    ///////Begin StrAlloc
    procedure TForm1.Button1Click(Sender: TObject);
    var
    P: PChar;
    begin
    P := StrAlloc(SpinEdit1.Value);
    ShowMessage(IntToStr(StrLen(P)));
    Dec(P, SizeOf(Cardinal));
    ShowMessage(IntToStr(Cardinal(Pointer(P)^)));
    Inc(P, SizeOf(Cardinal));
    StrDispose(P);
    end;
    ///////End StrAlloc
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function StrBufSize(const Str: PChar): Cardinal;
    功能 返回通过函数StrAlloc分配的缓冲区大小
    说明 出现异常情况则返回不可预知的结果
    参考 function System.SizeOf
    例子 SpinEdit1.Value := StrBufSize(StrAlloc(SpinEdit2.Value));
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function StrNew(const Str: PChar): PChar;
    功能 返回复制一个新的指针字符串
    说明 如果Str为nil则返回nil
    参考 function SysUtils.StrLen;function SysUtils.StrMove;function SysUtils.StrAlloc
    例子
    ///////Begin StrNew,StrDispose
    procedure TForm1.Button1Click(Sender: TObject);
    var
    P: PChar;
    begin
    P := StrNew(PChar(Edit1.Text));
    ShowMessage(P);
    StrDispose(P);
    end;
    ///////End StrNew,StrDispose
    ━━━━━━━━━━━━━━━━━━━━━
    首部 procedure StrDispose(Str: PChar);
    功能 释放指针字符串Str内存资源
    说明 如果Str为nil则不作任何处理;并且释放空间大小信息
    参考 function System.Dec;function System.SizeOf;function System.FreeMem
    例子 <参见StrNew>
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function Format(const Format: string; const Args: array of const): string;
    功能 返回按指定方式格式化一个数组常量的字符形式
    说明 这个函数是我在Delphi中用得最多的函数,现在就列举几个例子给你个直观的理解
    "%" [索引 ":"] ["-"] [宽度] ["." 摘要] 类型
    Format('x=%d', [12]); //'x=12' //最普通
    Format('x=%3d', [12]); //'x= 12' //指定宽度
    Format('x=%f', [12.0]); //'x=12.00' //浮点数
    Format('x=%.3f', [12.0]); //'x=12.000' //指定小数
    Format('x=%.*f', [5, 12.0]); //'x=12.00000' //动态配置
    Format('x=%.5d', [12]); //'x=00012' //前面补充0
    Format('x=%.5x', [12]); //'x=0000C' //十六进制
    Format('x=%1:d%0:d', [12, 13]); //'x=1312' //使用索引
    Format('x=%p', [nil]); //'x=00000000' //指针
    Format('x=%1.1e', [12.0]); //'x=1.2E+001' //科学记数法
    Format('x=%%', []); //'x=%' //得到"%"
    S := Format('%s%d', [S, I]); //S := S + StrToInt(I); //连接字符串
    参考 proceduer SysUtils.FmtStr
    例子 Edit1.Text := Format(Edit2.Text, [StrToFloatDef(Edit.3.Text, 0)]);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 procedure FmtStr(var Result: string; const Format: string; const Args: array of const);
    功能 按指定方式格式化一个数组常量的字符形式返回
    说明 <参见Format>
    参考 function SysUtils.FormatBuf;function System.Length;function System.SetLength
    例子 <参见Format>
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function StrFmt(Buffer, Format: PChar; const Args: array of const): PChar;
    功能 返回按指定方式格式化一个数组常量的字符指针形式
    说明 如果Buffer和Format其中只要有一个为nil则返回nil
    参考 function SysUtils.FormatBuf
    例子 <参见Format>
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function StrLFmt(Buffer: PChar; MaxBufLen: Cardinal; Format: PChar; const Args: array of const): PChar;
    功能 返回按指定方式和长度格式化一个数组常量的字符指针形式
    说明 StrLFmt(vBuffer, 6, '%d|12345', [1024]) = '1024|1';
    参考 function SysUtils.FormatBuf
    例子 <参见Format>
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function FormatBuf(var Buffer; BufLen: Cardinal; const Format; FmtLen: Cardinal; const Args: array of const): Cardinal;
    功能 返回按指定方式格式化一个数组常量到缓冲区Buffer中
    说明 <NULL>
    参考 <NULL>
    例子 <参见Format>
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function WideFormat(const Format: WideString; const Args: array of const): WideString;
    功能 返回按指定方式格式化一个数组常量的多字节字符形式
    说明 <NULL>
    参考 procedure SysUtils.WideFmtStr
    例子 <参见Format>
    ━━━━━━━━━━━━━━━━━━━━━
    首部 procedure WideFmtStr(var Result: WideString; const Format: WideString; const Args: array of const);
    功能 按指定方式格式化一个数组常量的多字节字符形式返回
    说明 <NULL>
    参考 function SysUtils.WideFormatBuf
    例子 <参见Format>
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function WideFormatBuf(var Buffer; BufLen: Cardinal; const Format; FmtLen: Cardinal; const Args: array of const): Cardinal;
    功能 返回按指定方式格式化一个数组常量到缓冲区Buffer中
    说明 <NULL>
    参考 <NULL>
    例子 <参见Format>
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function FloatToStr(Value: Extended): string;
    功能 返回浮点数Value转换成字符串
    说明 当浮点数大等于1E15将采用科学记数法
    参考 function SysUtils.FloatToText
    例子 Edit1.Text := FloatToStr(Now);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function CurrToStr(Value: Currency): string;
    功能 返回货币数Value转换成字符串
    说明 货币数只保留四位小数
    参考 function SysUtils.FloatToText
    例子 Edit1.Text := CurrToStr(Now);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function FloatToCurr(const Value: Extended): Currency;
    功能 返回浮点数Value转换成货币数
    说明 如果浮点数Value超出范围则将触发异常
    参考 const SysUtiles.MinCurrency;const SysUtiles.MaxCurrency
    例子 Edit1.Text := CurrToStr(FloatToCurr(Now));
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function FloatToStrF(Value: Extended; Format: TFloatFormat; Precision, Digits: Integer): string;
    功能 返回浮点数以指定格式转换成字符串
    说明 Precision指定精度;Digits指定小数宽度
    参考 function SysUtils.FloatToText
    例子
    ///////Begin FloatToStrF
    procedure TForm1.Button1Click(Sender: TObject);
    begin
    Memo1.Lines.Values['ffGeneral'] := FloatToStrF(StrToFloatDef(Edit1.Text, 0),
    ffGeneral, SpinEdit1.Value, SpinEdit2.Value);
    Memo1.Lines.Values['ffExponent'] := FloatToStrF(StrToFloatDef(Edit1.Text, 0),
    ffExponent, SpinEdit1.Value, SpinEdit2.Value);
    Memo1.Lines.Values['ffFixed'] := FloatToStrF(StrToFloatDef(Edit1.Text, 0),
    ffFixed, SpinEdit1.Value, SpinEdit2.Value);
    Memo1.Lines.Values['ffNumber'] := FloatToStrF(StrToFloatDef(Edit1.Text, 0),
    ffNumber, SpinEdit1.Value, SpinEdit2.Value);
    Memo1.Lines.Values['ffCurrency'] := FloatToStrF(StrToFloatDef(Edit1.Text, 0),
    ffCurrency, SpinEdit1.Value, SpinEdit2.Value);
    end;
    ///////End FloatToStrF
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function CurrToStrF(Value: Currency; Format: TFloatFormat; Digits: Integer): string;
    功能 返回货币类型以指定格式转换成字符串
    说明 Digits指定小数宽度
    参考 function SysUtils.FloatToText
    例子
    ///////Begin CurrToStrF
    procedure TForm1.Button1Click(Sender: TObject);
    begin
    Memo1.Lines.Values['ffGeneral'] := CurrToStrF(StrToCurrDef(Edit1.Text, 0),
    ffGeneral, SpinEdit1.Value);
    Memo1.Lines.Values['ffExponent'] := CurrToStrF(StrToCurrDef(Edit1.Text, 0),
    ffExponent, SpinEdit1.Value);
    Memo1.Lines.Values['ffFixed'] := CurrToStrF(StrToCurrDef(Edit1.Text, 0),
    ffFixed, SpinEdit1.Value);
    Memo1.Lines.Values['ffNumber'] := CurrToStrF(StrToCurrDef(Edit1.Text, 0),
    ffNumber, SpinEdit1.Value);
    Memo1.Lines.Values['ffCurrency'] := CurrToStrF(StrToCurrDef(Edit1.Text, 0),
    ffCurrency, SpinEdit1.Value);
    end;
    ///////End CurrToStrF
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function FloatToText(BufferArg: PChar; const Value; ValueType: TFloatValue; Format: TFloatFormat; Precision, Digits: Integer): Integer;
    功能 返回浮点数以指定格式转换成指针字符串的内存大小
    说明 Precision指定精度;Digits指定小数宽度
    参考 <NULL>
    例子
    ///////Begin FloatToText
    procedure TForm1.Button1Click(Sender: TObject);
    var
    vBuffer: array[0..255] of Char;
    E: Extended;
    begin
    E := StrToFloatDef(Edit1.Text, 0);
    SpinEdit3.Value := FloatToText(vBuffer, E,
    fvExtended, ffNumber, SpinEdit1.Value, SpinEdit2.Value);
    Edit2.Text := Copy(vBuffer, 1, SpinEdit3.Value);
    end;
    ///////End FloatToText(
    ━━━━━━━━━━━━━━━━━━━━━ 

    首部 function FormatFloat(const Format: string; Value: Extended): string;
    功能 返回浮点数类型以指定格式字符串Format转换成字符串
    说明 FormatFloat(',.00', 1234567890) = '1,234,567,890.00'
    参考 function SysUtils.FloatToTextFmt
    例子 Edit1.Text := FormatFloat(Edit2.Text, StrToFloatDef(Edit3.Text, 0));
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function FormatCurr(const Format: string; Value: Currency): string;
    功能 返回货币类型以指定格式字符串Format转换成字符串
    说明 FormatCurr(',.00', 1234567890) = '1,234,567,890.00'
    参考 function SysUtils.FloatToTextFmt
    例子 Edit1.Text := FormatCurr(Edit2.Text, StrToCurrDef(Edit3.Text, 0));
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function FloatToTextFmt(Buf: PChar; const Value; ValueType: TFloatValue; Format: PChar): Integer;
    功能 返回浮点数以指定格式字符串Format转换成指针字符串的内存大小
    说明 ValueType指定无类型参数Value的类型
    参考 <NULL>
    例子
    ///////Begin FloatToTextFmt
    procedure TForm1.Button1Click(Sender: TObject);
    var
    vBuffer: array[0..255] of Char;
    E: Extended;
    begin
    E := StrToFloatDef(Edit1.Text, 0);
    SpinEdit1.Value := FloatToTextFmt(vBuffer, E,
    fvExtended, PChar(Edit2.Text));
    Edit3.Text := Copy(vBuffer, 1, SpinEdit1.Value);
    end;
    ///////End FloatToTextFmt
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function StrToFloat(const S: string): Extended;
    功能 返回字符串S转换成浮点数
    说明 字符串非浮点数表达时将引起异常
    参考 function SysUtils.TextToFloat
    例子 var E: Extended; begin E := StrToFloat(Edit1.Text); end;
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function StrToFloatDef(const S: string; const Default: Extended): Extended;
    功能 返回字符串S转换成浮点数
    说明 字符串非浮点数表达时则返回默认值Default
    参考 function SysUtils.TextToFloat
    例子 var E: Extended; begin E := StrToFloatDef(Edit1.Text, 0); end;
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function TryStrToFloat(const S: string; out Value: Extended): Boolean; overload;
    首部 function TryStrToFloat(const S: string; out Value: Single): Boolean; overload;
    首部 function TryStrToFloat(const S: string; out Value: Double): Boolean; overload;
    功能 返回字符串S转换成浮点数Value是否成功
    说明 字符串非浮点数表达时返回False并且Value将输出为不确定的值
    参考 function SysUtils.TextToFloat
    例子
    ///////Begin TryStrToFloat
    procedure TForm1.Button1Click(Sender: TObject);
    var
    E: Extended;
    begin
    CheckBox1.Checked := TryStrToFloat(Edit1.Text, E);
    Edit2.Text := FormatFloat('', E);
    end;
    ///////End TryStrToFloat
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function StrToCurr(const S: string): Currency;
    功能 返回字符串S转换成货币数
    说明 字符串非货币数表达时将引起异常
    参考 function SysUtils.TextToFloat
    例子 var C: Currency; begin C := StrToCurr(Edit1.Text); end;
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function StrToCurrDef(const S: string; const Default: Currency): Currency;
    功能 返回字符串S转换成货币数
    说明 字符串非货币数表达时则返回默认值Default
    参考 function SysUtils.TextToFloat
    例子 var C: Currency; begin C := StrToCurrDef(Edit1.Text, 0); end;
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function TryStrToCurr(const S: string; out Value: Currency): Boolean;
    功能 返回字符串S转换成货币数Value是否成功
    说明 字符串非货币数表达时返回False并且Value将输出为不确定的值
    参考 function SysUtils.TextToFloat
    例子
    ///////Begin TryStrToCurr
    procedure TForm1.Button1Click(Sender: TObject);
    var
    C: Currency;
    begin
    CheckBox1.Checked := TryStrToCurr(Edit1.Text, C);
    Edit2.Text := FormatCurr('', C);
    end;
    ///////End TryStrToCurr
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function TextToFloat(Buffer: PChar; var Value; ValueType: TFloatValue): Boolean;
    功能 返回将指针字符串Buffer转换成无类型变量Value
    说明 ValueType指定无类型参数Value的类型
    参考 <NULL>
    例子
    ///////Begin TextToFloat
    procedure TForm1.Button1Click(Sender: TObject);
    var
    E: Extended;
    begin
    CheckBox1.Checked := TextToFloat(PChar(Edit1.Text), E,
    fvExtended);
    Edit2.Text := FormatFloat('', E);
    end;
    ///////End TextToFloat
    ━━━━━━━━━━━━━━━━━━━━━
    首部 procedure FloatToDecimal(var Result: TFloatRec; const Value; ValueType: TFloatValue; Precision, Decimals: Integer);
    功能 将浮点数转换成浮点结构类型并返回到Result
    说明 ValueType指定类型;Precision指定精度;Decimals指定小数
    参考 type SysUtils.TFloatRec
    例子 <NULL>
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function DateTimeToTimeStamp(DateTime: TDateTime): TTimeStamp;
    功能 返回日期时间类型转换成时间结构类型
    说明 <NULL>
    参考 type SysUtils.TTimeStamp
    例子 <NULL>
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function TimeStampToDateTime(const TimeStamp: TTimeStamp): TDateTime;
    功能 返回时间结构类型转换成日期时间类型
    说明 <NULL>
    参考 type SysUtils.TTimeStamp
    例子 <NULL>
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function MSecsToTimeStamp(MSecs: Comp): TTimeStamp;
    功能 返回微妙转换成时间结构类型
    说明 <NULL>
    参考 type SysUtils.TTimeStamp
    例子 <NULL>
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function TimeStampToMSecs(const TimeStamp: TTimeStamp): Comp;
    功能 返回时间结构类型转换成微妙
    说明 <NULL>
    参考 type SysUtils.TTimeStamp
    例子 <NULL>
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function EncodeDate(Year, Month, Day: Word): TDateTime;
    功能 返回合并年、月、日得到的日期
    说明 当出现非法组合时将触发异常
    参考 function SysUtils.TryEncodeDate
    例子 Edit1.Text := DateToStr(EncodeDate(SpinEdit1.Value, SpinEdit2.Value, SpinEdit3.Value));
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function EncodeTime(Hour, Min, Sec, MSec: Word): TDateTime;
    功能 返回合并时、分、秒、微秒得到的时间
    说明 当出现非法组合时将触发异常
    参考 function SysUtils.TryEncodeTime
    例子 Edit1.Text := TimeToStr(EncodeTime(SpinEdit1.Value, SpinEdit2.Value, SpinEdit3.Value, SpinEdit4.Value));
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function TryEncodeDate(Year, Month, Day: Word; out Date: TDateTime): Boolean;
    功能 返回合并年、月、日得到的日期是否成功
    说明 当出现非法组合时将返回False并且Date输出为0
    参考 function SysUtils.IsLeapYear
    例子
    ///////Begin TryEncodeDate
    procedure TForm1.Button1Click(Sender: TObject);
    var
    vDate: TDate;
    begin
    CheckBox1.Checked := TryEncodeDate(SpinEdit1.Value, SpinEdit2.Value,
    SpinEdit3.Value, TDateTime(vDate));
    Edit1.Text := DateToStr(vDate);
    end;
    ///////End TryEncodeDate
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function TryEncodeTime(Hour, Min, Sec, MSec: Word; out Time: TDateTime): Boolean;
    功能 返回合并时、分、秒、微秒得到的时间是否成功
    说明 当出现非法组合时将返回False并且Time输出为0
    参考 const SysUtils.MSecsPerDay
    例子
    ///////Begin TryEncodeTime
    procedure TForm1.Button1Click(Sender: TObject);
    var
    vTime: TTime;
    begin
    CheckBox1.Checked := TryEncodeTime(SpinEdit1.Value, SpinEdit2.Value,
    SpinEdit3.Value, SpinEdit3.Value, TDateTime(vTime));
    Edit1.Text := TimeToStr(vTime);
    end;
    ///////End TryEncodeTime
    ━━━━━━━━━━━━━━━━━━━━━
    首部 procedure DecodeDate(const DateTime: TDateTime; var Year, Month, Day: Word);
    功能 分解日期为年、月、日
    说明 <NULL>
    参考 function SysUtils.DecodeDateFully
    例子
    ///////Begin DecodeDate
    procedure TForm1.Button1Click(Sender: TObject);
    var
    Year, Month, Day: Word;
    begin
    DecodeDate(Date, Year, Month, Day);
    SpinEdit1.Value := Year;
    SpinEdit2.Value := Month;
    SpinEdit3.Value := Day;
    end;
    ///////End DecodeDate
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function DecodeDateFully(const DateTime: TDateTime; var Year, Month, Day, DOW: Word): Boolean;
    功能 分解日期为年、月、日、星期
    说明 [DOW:Day Of Week]
    参考 function SysUtils.DateTimeToTimeStamp
    例子
    ///////Begin DecodeDateFully
    procedure TForm1.Button1Click(Sender: TObject);
    var
    Year, Month, Day, DOW: Word;
    begin
    DecodeDateFully(Date, Year, Month, Day, DOW);
    SpinEdit1.Value := Year;
    SpinEdit2.Value := Month;
    SpinEdit3.Value := Day;
    SpinEdit4.Value := DOW;
    end;
    ///////End DecodeDateFully
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function InternalDecodeDate(const DateTime: TDateTime; var Year, Month, Day, DOW: Word): Boolean;
    功能 <NULL>
    说明 Kylix函数
    参考 function SysUtils.DecodeDateFully
    例子 <NULL>
    ━━━━━━━━━━━━━━━━━━━━━
    首部 procedure DecodeTime(const DateTime: TDateTime; var Hour, Min, Sec, MSec: Word);
    功能 分解时间为时、分、秒、微妙
    说明 <NULL>
    参考 function SysUtils.DateTimeToTimeStamp
    例子
    ///////Begin DecodeTime
    procedure TForm1.Button1Click(Sender: TObject);
    var
    Hour, Min, Sec, MSec: Word;
    begin
    DecodeTime(Time, Hour, Min, Sec, MSec);
    SpinEdit1.Value := Hour;
    SpinEdit2.Value := Min;
    SpinEdit3.Value := Sec;
    SpinEdit4.Value := MSec;
    end;
    ///////End DecodeTime
    ━━━━━━━━━━━━━━━━━━━━━
    首部 procedure DateTimeToSystemTime(const DateTime: TDateTime; var SystemTime: TSystemTime);
    功能 返回日期时间类型转换成系统时间类型
    说明 <NULL>
    参考 function SysUtils.DecodeDateFully;function SysUtils.DecodeTime
    例子 <NULL>
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function SystemTimeToDateTime(const SystemTime: TSystemTime): TDateTime;
    功能 返回系统时间类型转换成日期时间类型
    说明 <NULL>
    参考 function SysUtils.EncodeDate;function SysUtils.EncodeTime
    例子 <NULL>
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function DayOfWeek(const DateTime: TDateTime): Word;
    功能 返回日期时间DateTime所在的星期
    说明 1(星期天),2(星期一),3(星期二),4(星期三),5(星期四),6(星期五),7(星期六)
    参考 function SysUtils.DateTimeToTimeStamp
    例子
    ///////Begin DayOfWeek
    procedure TForm1.Button1Click(Sender: TObject);
    const
    cWeekCn: array[1..7] of string =
    ('星期天', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六');
    begin
    Edit1.Text := cWeekCn[DayOfWeek(Now)];
    end;
    ///////End DayOfWeek
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function Date: TDateTime;
    功能 返回当前日期
    说明 Date - Int(Date)=0;
    参考 function SysUtils.DateTimeToString
    例子 Edit1.Text := DateToStr(Date);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function Time: TDateTime;
    功能 返回当前时间
    说明 Time - Frac(Time)=0;
    参考 function Windows.GetLocalTime;function SysUtils.EncodeTime
    例子 Edit1.Text := TimeToStr(Time);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function Now: TDateTime;
    功能 返回当前日期时间
    说明 Date + Time=Now
    参考 function Windows.GetLocalTime;function SysUtils.EncodeDate;function SysUtils.EncodeTime
    例子 Edit1.Text := DateTimeToStr(Now);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function CurrentYear: Word;
    功能 返回当前年份
    说明 <NULL>
    参考 function Windows.GetLocalTime
    例子 SpinEdit1.Value := CurrentYear;
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function IncMonth(const DateTime: TDateTime; NumberOfMonths: Integer = 1): TDateTime;
    功能 返回增加月份给日期
    说明 NumberOfMonths为负数时则减月份
    参考 procedure SysUtils.DecodeDate;procedure SysUtils.IncAMonth;function SysUtils.EncodeDate;procedure SysUtils.ReplaceTime
    例子 DateTimePicker1.Date := IncMonth(Date, SpinEdit1.Value);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 procedure IncAMonth(var Year, Month, Day: Word; NumberOfMonths: Integer = 1);
    功能 返回增加月份给年月日
    说明 NumberOfMonths为负数时则减月份
    参考 procedure System.Inc
    例子
    ///////Begin IncAMonth
    procedure TForm1.Button1Click(Sender: TObject);
    var
    vYear, vMonth, vDay: Word;
    begin
    DecodeDate(Date, vYear, vMonth, vDay);
    IncAMonth(vYear, vMonth, vDay, SpinEdit1.Value);
    DateTimePicker1.Date := EncodeDate(vYear, vMonth, vDay);
    end;
    ///////End IncAMonth
    ━━━━━━━━━━━━━━━━━━━━━
    首部 procedure ReplaceTime(var DateTime: TDateTime; const NewTime: TDateTime);
    功能 用时间NewTime替换日期时间DateTime的时间部分
    说明 Int(DateTime) + Frac(NewTime)
    参考 function System.Trunc;function System.Abs;function System.Frac
    例子
    ///////Begin ReplaceTime
    procedure TForm1.Button1Click(Sender: TObject);
    var
    vDateTime: TDateTime;
    begin
    vDateTime := Now;
    ReplaceTime(vDateTime, DateTimePicker1.Time);
    Edit1.Text := DateTimeToStr(vDateTime);
    end;
    ///////End ReplaceTime
    ━━━━━━━━━━━━━━━━━━━━━
    首部 procedure ReplaceDate(var DateTime: TDateTime; const NewDate: TDateTime);
    功能 用日期NewDate替换日期时间DateTime的日期部分
    说明 Int(NewTime) + Frac(DateTime)
    参考 procedure SysUtils.ReplaceTime
    例子
    ///////Begin ReplaceDate
    procedure TForm1.Button1Click(Sender: TObject);
    var
    vDateTime: TDateTime;
    begin
    vDateTime := Now;
    ReplaceDate(vDateTime, DateTimePicker1.Date);
    Edit1.Text := DateTimeToStr(vDateTime);
    end;
    ///////End ReplaceDate
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function IsLeapYear(Year: Word): Boolean;
    功能 返回年份Year是否是闰年
    说明 (Year mod 4 = 0) and ((Year mod 100 <> 0) or (Year mod 400 = 0))
    参考 <NULL>
    例子 CheckBox1.Checked := IsLeapYear(SpinEdit1.Value);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function DateToStr(const DateTime: TDateTime): string;
    功能 返回日期DateTime转换成字符串
    说明 转换格式由系统变量ShortDateFormat控制
    参考 function SysUtils.DateTimeToString;var SysUtils.ShortDateFormat
    例子 Edit1.Text := DateToStr(Date);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function TimeToStr(const DateTime: TDateTime): string;
    功能 返回时间DateTime转换成字符串
    说明 转换格式由系统变量LongTimeFormat控制
    参考 function SysUtils.DateTimeToString;var SysUtils.LongTimeFormat
    例子 Edit1.Text := TimeToStr(Date);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function DateTimeToStr(const DateTime: TDateTime): string;
    功能 返回日期时间DateTime转换成字符串
    说明 转换格式由系统变量ShortDateFormat和LongTimeFormat控制
    参考 function SysUtils.DateTimeToString
    例子 Edit1.Text := DateTimeToStr(Now);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function StrToDate(const S: string): TDateTime;
    功能 返回字符串S转换成日期
    说明 字符非日期表达时将引起异常
    参考 function SysUtils.TryStrToDate
    例子 DateTimePicker1.Date := StrToDate(Edit1.Text);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function StrToDateDef(const S: string; const Default: TDateTime): TDateTime;
    功能 返回字符串S转换成日期
    说明 字符非日期表达时则返回默认值Default
    参考 function SysUtils.TryStrToDate
    例子 DateTimePicker1.Date := StrToDateDef(Edit1.Text, Date);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function TryStrToDate(const S: string; out Value: TDateTime): Boolean;
    功能 返回字符串S转换成日期Value是否成功
    说明 字符非日期表达时返回False并且Value将输出为0
    参考 <NULL>
    例子
    ///////Begin TryStrToDate
    procedure TForm1.Button1Click(Sender: TObject);
    var
    vDateTime: TDateTime;
    begin
    CheckBox1.Checked := TryStrToDate(Edit1.Text, vDateTime);
    DateTimePicker1.Date := vDateTime;
    end;
    ///////End TryStrToDate
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function StrToTime(const S: string): TDateTime;
    功能 返回字符串S转换成时间
    说明 字符非时间表达时将引起异常
    参考 function SysUtils.TryStrToTime
    例子 DateTimePicker1.Time := StrToTime(Edit1.Text);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function StrToTimeDef(const S: string; const Default: TDateTime): TDateTime;
    功能 返回字符串S转换成时间
    说明 字符非时间表达时则返回默认值Default
    参考 function SysUtils.TryStrToTime
    例子 DateTimePicker1.Time := StrToTimeDef(Edit1.Text, Time);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function TryStrToTime(const S: string; out Value: TDateTime): Boolean;
    功能 返回字符串S转换成时间Value是否成功
    说明 字符非时间表达时返回False并且Value将输出为0
    参考 <NULL>
    例子
    ///////Begin TryStrToTime
    procedure TForm1.Button1Click(Sender: TObject);
    var
    vDateTime: TDateTime;
    begin
    CheckBox1.Checked := TryStrToTime(Edit1.Text, vDateTime);
    DateTimePicker1.Time := vDateTime;
    end;
    ///////End TryStrToTime
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function StrToDateTime(const S: string): TDateTime;
    功能 返回字符串S转换成日期时间
    说明 字符非日期时间表达时将引起异常
    参考 function SysUtils.TryStrToDateTime
    例子 Edit1.Text := DateTimeToStr(StrToDateTime(Edit2.Text));
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function StrToDateTimeDef(const S: string; const Default: TDateTime): TDateTime;
    功能 返回字符串S转换成日期时间
    说明 字符非日期时间表达时则返回默认值Default
    参考 function SysUtils.TryStrToDateTime
    例子 Edit1.Text := DateTimeToStr(StrToDateTimeDef(Edit2.Text, Now));
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function TryStrToDateTime(const S: string; out Value: TDateTime): Boolean;
    功能 返回字符串S转换成日期时间Value是否成功
    说明 字符非日期时间表达时返回False并且Value将输出为0
    参考 <NULL>
    例子
    ///////Begin TryStrToDateTime
    procedure TForm1.Button1Click(Sender: TObject);
    var
    vDateTime: TDateTime;
    begin
    CheckBox1.Checked := TryStrToDateTime(Edit1.Text, vDateTime);
    Edit2.Text := DateTimeToStr(vDateTime);
    end;
    ///////End TryStrToDateTime
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function FormatDateTime(const Format: string; DateTime: TDateTime): string;
    功能 返回用指定的格式Format来格式化日期时间DateTime
    说明 FormatDateTime('YYYY"年"MM"月"DD"日"', StrToDate('2002-03-09')) = '2002年03月09日'
    参考 function SysUtils.DateTimeToString
    例子 Edit2.Text := FormatDateTime(Edit1.Text, Now);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 procedure DateTimeToString(var Result: string; const Format: string; DateTime: TDateTime);
    功能 用指定的格式Format来格式化日期时间DateTime并返回到字符串Result中
    说明 <参见FormatDateTime>
    参考 function System.SetString
    例子 <参见FormatDateTime>
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function FloatToDateTime(const Value: Extended): TDateTime;
    功能 返回浮点数转换成日期时间类型
    说明 如果浮点数超出范围将触发异常
    参考 function System.Int
    例子 Edit2.Text := DateTimeToStr(FloatToDateTime(StrToFloatDef(Edit1.Text, 0)));
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function SysErrorMessage(ErrorCode: Integer): string;
    功能 返回系统中错误代码所对应的信息
    说明 此函可以有助于已习惯Windows编程的用户使用
    参考 function Windows.FormatMessage;function System.SetString
    例子 Edit1.Text := SysErrorMessage(SpinEdit1.Value);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function GetLocaleStr(Locale, LocaleType: Integer; const Default: string): string; platform;
    功能 返回当前系统指定参数的字符串值
    说明 GetLocaleStr(GetThreadLocale, LOCALE_SLANGUAGE, '') = '中文(中国)'
    参考 function Windows.GetLocaleInfo
    例子 Edit1.Text := GetLocaleStr(GetThreadLocale, SpinEdit1.Value, '<NULL>');
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function GetLocaleChar(Locale, LocaleType: Integer; Default: Char): Char; platform;
    功能 返回当前系统指定参数的字符值
    说明 GetLocaleChar(GetThreadLocale, LOCALE_STHOUSAND, #0) = ','
    参考 function Windows.GetLocaleInfo
    例子 Edit1.Text := GetLocaleChar(GetThreadLocale, LOCALE_SLANGUAGE, #0);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 procedure GetFormatSettings;
    功能 恢复系统参数设置
    说明 日期时间格式等
    参考 function Windows.GetThreadLocale;function Windows.GetLocaleStr
    例子
    ///////Begin GetFormatSettings
    procedure TForm1.Button1Click(Sender: TObject);
    begin
    ShortDateFormat := 'YYYY"年"MM"月"DD"日"';
    ShowMessage(DateToStr(Date));
    GetFormatSettings;
    ShowMessage(DateToStr(Date));
    end;
    ///////End GetFormatSettings
    ━━━━━━━━━━━━━━━━━━━━━ 

    首部 function InquireSignal(RtlSigNum: Integer): TSignalState;
    功能 <NULL>
    说明 Kylix函数
    参考 <NULL>
    例子 <NULL>
    ━━━━━━━━━━━━━━━━━━━━━
    首部 procedure AbandonSignalHandler(RtlSigNum: Integer);
    功能 <NULL>
    说明 Kylix函数
    参考 <NULL>
    例子 <NULL>
    ━━━━━━━━━━━━━━━━━━━━━
    首部 procedure HookSignal(RtlSigNum: Integer);
    功能 <NULL>
    说明 Kylix函数
    参考 <NULL>
    例子 <NULL>
    ━━━━━━━━━━━━━━━━━━━━━
    首部 procedure UnhookSignal(RtlSigNum: Integer; OnlyIfHooked: Boolean = True);
    功能 <NULL>
    说明 Kylix函数
    参考 <NULL>
    例子 <NULL>
    ━━━━━━━━━━━━━━━━━━━━━
    首部 procedure HookOSExceptions;
    功能 <NULL>
    说明 Kylix函数
    参考 <NULL>
    例子 <NULL>
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function MapSignal(SigNum: Integer; Context: PSigContext): LongWord;
    功能 <NULL>
    说明 Kylix函数
    参考 <NULL>
    例子 <NULL>
    ━━━━━━━━━━━━━━━━━━━━━
    首部 procedure SignalConverter(ExceptionEIP: LongWord; FaultAddr: LongWord; ErrorCode: LongWord);
    功能 <NULL>
    说明 Kylix函数
    参考 <NULL>
    例子 <NULL>
    ━━━━━━━━━━━━━━━━━━━━━
    首部 procedure SetSafeCallExceptionMsg(Msg: String);
    功能 <NULL>
    说明 Kylix函数
    参考 <NULL>
    例子 <NULL>
    ━━━━━━━━━━━━━━━━━━━━━
    首部 procedure SetSafeCallExceptionAddr(Addr: Pointer);
    功能 <NULL>
    说明 Kylix函数
    参考 <NULL>
    例子 <NULL>
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function GetSafeCallExceptionMsg: String;
    功能 <NULL>
    说明 Kylix函数
    参考 <NULL>
    例子 <NULL>
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function GetSafeCallExceptionAddr: Pointer;
    功能 <NULL>
    说明 Kylix函数
    参考 <NULL>
    例子 <NULL>
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function LoadLibrary(ModuleName: PChar): HMODULE;
    功能 <NULL>
    说明 Kylix函数
    参考 <NULL>
    例子 <NULL>
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function FreeLibrary(Module: HMODULE): LongBool;
    功能 <NULL>
    说明 Kylix函数
    参考 <NULL>
    例子 <NULL>
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function GetProcAddress(Module: HMODULE; Proc: PChar): Pointer;
    功能 <NULL>
    说明 Kylix函数
    参考 <NULL>
    例子 <NULL>
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function GetModuleHandle(ModuleName: PChar): HMODULE;
    功能 <NULL>
    说明 Kylix函数
    参考 <NULL>
    例子 <NULL>
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function GetPackageModuleHandle(PackageName: PChar): HMODULE;
    功能 <NULL>
    说明 Kylix函数
    参考 <NULL>
    例子 <NULL>
    ━━━━━━━━━━━━━━━━━━━━━
    首部 procedure Sleep(milliseconds: Cardinal);{$IFDEF MSWINDOWS} stdcall; {$ENDIF}
    功能 让程序休眠一段时间
    说明 以微米为单位
    参考 <NULL>
    例子 Sleep(3000);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function GetModuleName(Module: HMODULE): string;
    功能 返回动态连接库的名称
    说明 如果参数为0则返回当前程序的名称
    参考 function Windows.GetModuleFileName
    例子
    ///////Begin GetModuleName
    procedure TForm1.Button1Click(Sender: TObject);
    var
    vHandle: THandle;
    begin
    vHandle := LoadLibrary(PChar(Edit1.Text));
    Caption := GetModuleName(vHandle);
    FreeLibrary(vHandle);
    end;
    ///////End GetModuleName
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function ExceptionErrorMessage(ExceptObject: TObject; ExceptAddr: Pointer; Buffer: PChar; Size: Integer): Integer;
    功能 返回操作指针失败的信息长度
    说明 信息放在缓冲Buffer中
    参考 function Windows.VirtualQuery;function Windows.GetModuleFilename
    例子
    ///////Begin ExceptionErrorMessage
    procedure TForm1.Button1Click(Sender: TObject);
    var
    vBuffer: array[0..255] of Char;
    begin
    ExceptionErrorMessage(Self, Self, vBuffer, 255);
    Caption := vBuffer;
    end;
    ///////End ExceptionErrorMessage
    ━━━━━━━━━━━━━━━━━━━━━
    首部 procedure ShowException(ExceptObject: TObject; ExceptAddr: Pointer);
    功能 提示一个操作指针失败的错误
    说明 支持控制台程序
    参考 function SysUtils.ExceptionErrorMessage;var System.IsConsole;function System.FindResourceHInstance
    例子 ShowException(Self, Self);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 procedure Abort;
    功能 引起放弃的意外处理
    说明 不显示任何错误信息
    参考 type SysUtils.EAbort
    例子 Abort;
    ━━━━━━━━━━━━━━━━━━━━━
    首部 procedure OutOfMemoryError;
    功能 触发内存益出异常
    说明 <NULL>
    参考 var SysUtils.OutOfMemory
    例子 OutOfMemoryError;
    ━━━━━━━━━━━━━━━━━━━━━
    首部 procedure Beep;
    功能 触发计算机出声
    说明 MessageBeep(0);
    参考 function Windows.MessageBeep
    例子 Beep;
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function ByteType(const S: string; Index: Integer): TMbcsByteType;
    功能 返回字符串S位置Index上的字符在MBCS中类型
    说明 多字节字符系统:Multi-Byte Character System (MBCS)
    参考 var SysUtils.SysLocale
    例子 SpinEdit1.Value := Ord(ByteType(Edit1.Text, SpinEdit2.Value));
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function StrByteType(Str: PChar; Index: Cardinal): TMbcsByteType;
    功能 返回指针字符串Str位置Index上的字符在MBCS中类型
    说明 Index从0开始
    参考 var SysUtils.SysLocale
    例子 SpinEdit1.Value := Ord(StrByteType(PChar(Edit1.Text), SpinEdit2.Value));
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function ByteToCharLen(const S: string; MaxLen: Integer): Integer;
    功能 返回字符串S中有多少个多字节字符
    说明 MaxLen指定处理字符个数
    参考 function SysUtils.ByteToCharIndex
    例子 SpinEdit1.Value := ByteToCharLen(Edit1.Text, SpinEdit2.Value);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function CharToByteLen(const S: string; MaxLen: Integer): Integer;
    功能 返回字符串S中有多少个字符
    说明 MaxLen指定处理多字节字符个数
    参考 var SysUtils.SysLocale
    例子 SpinEdit1.Value := CharToByteLen(Edit1.Text, SpinEdit2.Value);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function ByteToCharIndex(const S: string; Index: Integer): Integer;
    功能 返回字符位置对应的多字节字符位置
    说明 ByteToCharIndex('你好', 2) = 1;ByteToCharIndex('你好', 3) = 2
    参考 function SysUtils.NextCharIndex
    例子 SpinEdit1.Value := ByteToCharIndex(Edit1.Text, SpinEdit2.Value);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function CharToByteIndex(const S: string; Index: Integer): Integer;
    功能 返回多字节字符位置对应的字符起始位置
    说明 CharToByteIndex('你好', 1) = 1;CharToByteIndex('你好', 2) = 3
    参考 function System.Length
    例子 SpinEdit1.Value := CharToByteIndex(Edit1.Text, SpinEdit2.Value);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function StrCharLength(const Str: PChar): Integer;
    功能 返回第一个字符的宽度
    说明 参数为空则返回0
    参考 function Windows.CharNext
    例子 SpinEdit1.Value := StrCharLength(PChar(Edit1.Text));
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function StrNextChar(const Str: PChar): PChar;
    功能 返回字符指针Str的下一个字符指针
    说明 StrNextChar('1234') = '234';
    参考 function Windows.CharNext
    例子 Edit2.Text := StrNextChar(PChar(Edit1.Text));
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function CharLength(const S: String; Index: Integer): Integer;
    功能 返回字符串中指定位置的字符宽度
    说明 CharLength('English汉', 1) = 1;CharLength('English汉', 8) = 2
    参考 function System.Assert;function SysUtils.StrCharLength
    例子 SpinEdit1.Value := CharLength(Edit1.Text, SpinEdit2.Value);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function NextCharIndex(const S: String; Index: Integer): Integer;
    功能 返回下一个字符的位置
    说明 CharLength('你好', 1) = 3;CharLength('你好', 3) = 5
    参考 function System.Assert;function SysUtils.StrCharLength
    例子 SpinEdit1.Value := NextCharIndex(Edit1.Text, SpinEdit2.Value);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function IsPathDelimiter(const S: string; Index: Integer): Boolean;
    功能 返回字符串S中指定位置Index上是否是一个路径分隔符
    说明 IsPathDelimiter('C:/Windows', 3) = True
    参考 const SysUtils.PathDelim;function SysUtils.ByteType
    例子 CheckBox1.Checked := IsPathDelimiter(Edit1.Text, SpinEdit1.Value);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function IsDelimiter(const Delimiters, S: string; Index: Integer): Boolean;
    功能 返回字符串S中指定位置Index上是否是一个分隔符Delimiters
    说明 IsDelimiter('@', 'wjhu111@21cn.com', 8) = True
    参考 function SysUtils.ByteType
    例子 CheckBox1.Checked := IsDelimiter(Edit1.Text, Edit2.Text, SpinEdit1.Value);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function IncludeTrailingPathDelimiter(const S: string): string;
    功能 返回包括最后路径分隔符
    说明 最后一个字符是路径分隔符则不变;否则加上一个路径分隔符返回
    参考 function SysUtils.IsPathDelimiter;function System.Length
    例子 Edit1.Text := IncludeTrailingPathDelimiter(Edit2.Text);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function IncludeTrailingBackslash(const S: string): string; platform;
    功能 返回包括最后斜线
    说明 Result := IncludeTrailingPathDelimiter(S);
    参考 function SysUtils.IncludeTrailingPathDelimiter
    例子 Edit1.Text := IncludeTrailingBackslash(Edit2.Text);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function ExcludeTrailingPathDelimiter(const S: string): string;
    功能 返回排除最后路径分隔符
    说明 最后一个字符不是路径分隔符则不变;否则减去最后的路径分隔符返回
    参考 function SysUtils.IsPathDelimiter;function System.Length;function System.SetLength
    例子 Edit1.Text := ExcludeTrailingPathDelimiter(Edit2.Text);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function ExcludeTrailingBackslash(const S: string): string; platform;
    功能 返回排除最后斜线
    说明 Result := ExcludeTrailingPathDelimiter(S)
    参考 function SysUtils.ExcludeTrailingPathDelimiter
    例子 Edit1.Text := ExcludeTrailingBackslash(Edit2.Text);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function LastDelimiter(const Delimiters, S: string): Integer;
    功能 返回最后一个分隔符的位置
    说明 LastDelimiter('.', 'kingron.myetang.com') = 16
    参考 function SysUtils.StrScan;function SysUtils.ByteType
    例子 SpinEdit1.Value := LastDelimiter(Edit1.Text, Edit2.Text);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function AnsiCompareFileName(const S1, S2: string): Integer;
    功能 返回比较两个文件名
    说明 当S1>S2返回值>0;当S1<S2返回值<0;当S1=S2返回值=0;区分大小写
    参考 function SysUtils.AnsiCompareStr
    例子 SpinEdit1.Value := AnsiCompareFileName(Edit1.Text, Edit2.Text);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function SameFileName(const S1, S2: string): Boolean;
    功能 返回两个文件名是否相等
    说明 区分大小写
    参考 function SysUtils.AnsiCompareFileName
    例子 CheckBox1.Checked := SameFileName(Edit1.Text, Edit2.Text);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function AnsiLowerCaseFileName(const S: string): string;
    功能 返回小写文件名
    说明 在非多字节字符系统上相当于AnsiLowerCase
    参考 function SysUtils.AnsiLowerCase
    例子 Edit2.Text := AnsiLowerCaseFileName(Edit1.Text);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function AnsiUpperCaseFileName(const S: string): string;
    功能 返回大写文件名
    说明 在非多字节字符系统上相当于AnsiUpperCase
    参考 function SysUtils.AnsiUpperCase
    例子 Edit2.Text := AnsiUpperCaseFileName(Edit1.Text);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function AnsiPos(const Substr, S: string): Integer;
    功能 返回子串Substr在字符中第一次出现的位置
    说明 不存在则返回0
    参考 SysUtils.AnsiStrPos
    例子 SpinEdit1.Value := AnsiPos(Edit1.Text, Edit2.Text);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function AnsiStrPos(Str, SubStr: PChar): PChar;
    功能 返回指针子串Substr在指针字符中第一次出现的指针位置
    说明 不存在则返回nil
    参考 function SysUtils.StrByteType
    例子 Edit3.Text := AnsiStrPos(PChar(Edit1.Text), PChar(Edit2.Text));
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function AnsiStrRScan(Str: PChar; Chr: Char): PChar;
    功能 返回在指针字符串Str搜索字符Chr最后一个出现的地址
    说明 支持多字节字符系统;AnsiStrRScan('kingron.myetang.com', '.') = '.com'
    参考 function SysUtils.AnsiStrScan
    例子 Edit2.Text := AnsiStrScan(PChar(Edit1.Text), '.');
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function AnsiStrScan(Str: PChar; Chr: Char): PChar;
    功能 返回在指针字符串Str搜索字符Chr第一个出现的地址
    说明 支持多字节字符系统;AnsiStrRScan('kingron.myetang.com', '.') = '.myetang.com'
    参考 function SysUtils.StrScan
    例子 Edit2.Text := AnsiStrScan(PChar(Edit1.Text), '.');
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function StringReplace(const S, OldPattern, NewPattern: string; Flags: TReplaceFlags): string;
    功能 返回替换后的字符串
    说明 rfReplaceAll为替换全部内容;rfIgnoreCase为忽略大小写
    参考 function SysUtils.AnsiUpperCase;function SysUtils.AnsiPos;function System.Copy
    例子
    ///////Begin StringReplace
    procedure TForm1.Button1Click(Sender: TObject);
    begin
    Memo1.Lines.Values['[]'] :=
    StringReplace(Edit1.Text, Edit2.Text, Edit3.Text, []);
    Memo1.Lines.Values['[rfReplaceAll]'] :=
    StringReplace(Edit1.Text, Edit2.Text, Edit3.Text, [rfReplaceAll]);
    Memo1.Lines.Values['[rfIgnoreCase]'] :=
    StringReplace(Edit1.Text, Edit2.Text, Edit3.Text, [rfIgnoreCase]);
    Memo1.Lines.Values['[rfReplaceAll, rfIgnoreCase]'] :=
    StringReplace(Edit1.Text, Edit2.Text, Edit3.Text, [rfReplaceAll, rfIgnoreCase]);
    end;
    ///////End StringReplace
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function WrapText(const Line, BreakStr: string; const BreakChars: TSysCharSet; MaxCol: Integer): string; overload;
    首部 function WrapText(const Line: string; MaxCol: Integer = 45): string; overload;
    功能 返回对字符串自动换行
    说明 Result := WrapText(Line, sLineBreak, [' ', '-', #9], MaxCol);
    参考 function SysUtils.CharLength;function SysUtils.CompareText
    例子 Memo1.Text := WrapText(Memo2.Text, SpinEdit1.Value);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function FindCmdLineSwitch(const Switch: string; const Chars: TSysCharSet; IgnoreCase: Boolean): Boolean; overload;
    首部 function FindCmdLineSwitch(const Switch: string): Boolean; overload;
    首部 function FindCmdLineSwitch(const Switch: string; IgnoreCase: Boolean): Boolean; overload;
    功能 返回程序命令参数是否找到
    说明 Result := FindCmdLineSwitch(Switch, SwitchChars, True);
    参考 function System.ParamCount;function System.ParamStr;function SysUtils.AnsiCompareText
    例子 CheckBox1.Checked := FindCmdLineSwitch(Edit1.Text);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 procedure FreeAndNil(var Obj);
    功能 释放对象Obj并赋为空
    说明 如果对象已经释放资源将触发异常
    参考 type System.TObject
    例子
    ///////Begin FreeAndNil
    procedure TForm1.Button1Click(Sender: TObject);
    var
    Temp: TObject;
    begin
    Temp := TObject.Create;
    Temp.Free;
    ShowMessage(Format('%p', [Pointer(Temp)]));
    Temp := TObject.Create;
    FreeAndNil(Temp);
    ShowMessage(Format('%p', [Pointer(Temp)]));
    end;
    ///////End FreeAndNil
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function Supports(const Instance: IInterface; const IID: TGUID; out Intf): Boolean; overload;
    首部 function Supports(const Instance: TObject; const IID: TGUID; out Intf): Boolean; overload;
    首部 function Supports(const Instance: IInterface; const IID: TGUID): Boolean; overload;
    首部 function Supports(const Instance: TObject; const IID: TGUID): Boolean; overload;
    首部 function Supports(const AClass: TClass; const IID: TGUID): Boolean; overload;
    功能 返回对象是否支持指定的接口
    说明 Result := AClass.GetInterfaceEntry(IID) <> nil;
    参考 type System.TObject
    例子 <NULL>
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function CreateGUID(out Guid: TGUID): HResult;
    功能 返回创建全局标识是否成功
    说明 返回S_OK表示成功
    参考 function Windows.CoCreateGuid
    例子
    ///////Begin CreateGUID
    procedure TForm1.Button1Click(Sender: TObject);
    var
    vGUID: TGUID;
    begin
    CreateGUID(vGUID);
    Edit1.Text := GUIDToString(vGUID);
    end;
    ///////End CreateGUID
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function StringToGUID(const S: string): TGUID;
    功能 返回字符串S转换成全局标识
    说明 如果字符串非法将触发异常
    参考 fuction Windows.Succeeded
    例子 Edit2.Text := GUIDToString(StringToGUID(Edit1.Text));
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function GUIDToString(const GUID: TGUID): string;
    功能 返回全局标识GUID转换成字符串
    说明 <NULL>
    参考 fuction Windows.Succeeded
    例子 Edit2.Text := GUIDToString(StringToGUID(Edit1.Text));
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function IsEqualGUID(const guid1, guid2: TGUID): Boolean;
    功能 返回两个全局标识是否相同
    说明 function IsEqualGUID; external 'ole32.dll' name 'IsEqualGUID';
    参考 <NULL>
    例子 CheckBox1.Checked := IsEqualGUID(StringToGUID(Edit1.Text), StringToGUID(Edit2.Text));
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function LoadPackage(const Name: string): HMODULE;
    功能 返回载入包资源
    说明 <NULL>
    参考 function SysUtils.SafeLoadLibrary;function SysUtils.InitializePackage;function Windows.FreeLibrary
    例子 <NULL>
    ━━━━━━━━━━━━━━━━━━━━━
    首部 procedure UnloadPackage(Module: HMODULE);
    功能 取消载入包资源
    说明 <NULL>
    参考 function SysUtils.FinalizePackage;function Windows.FreeLibrary
    例子 <NULL>
    ━━━━━━━━━━━━━━━━━━━━━
    首部 procedure GetPackageInfo(Module: HMODULE; Param: Pointer; var Flags: Integer; InfoProc: TPackageInfoProc);
    功能 返回包的信息
    说明 <NULL>
    参考 <NULL>
    例子 <NULL>
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function GetPackageDescription(ModuleName: PChar): string;
    功能 返回包的描述
    说明 <NULL>
    参考 function System.LoadResourceModule;function Windows.LoadLibraryEx
    例子 <NULL>
    ━━━━━━━━━━━━━━━━━━━━━
    首部 procedure InitializePackage(Module: HMODULE);
    功能 初始化包
    说明 <NULL>
    参考 function Windos.GetProcAddress
    例子 <NULL>
    ━━━━━━━━━━━━━━━━━━━━━
    首部 procedure FinalizePackage(Module: HMODULE);
    功能 终止化包
    说明 <NULL>
    参考 function Windos.GetProcAddress
    例子 <NULL>
    ━━━━━━━━━━━━━━━━━━━━━
    首部 procedure RaiseLastOSError;
    功能 触发操作系统的最后一个异常
    说明 如果没有出现异常则默认调用Api函数异常
    参考 function Windows.GetLastError
    例子 RaiseLastOSError;
    ━━━━━━━━━━━━━━━━━━━━━
    首部 procedure RaiseLastWin32Error; deprecated;
    功能 触发Win32系统的最后一个异常
    说明 如果没有出现异常则默认调用Api函数异常
    参考 function SysUtils.RaiseLastOSError;
    例子 RaiseLastWin32Error;
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function Win32Check(RetVal: BOOL): BOOL; platform;
    功能 返回检测调用系统Api函数返回结果
    说明 如果RetVal为False则触发异常
    参考 function SysUtils.RaiseLastOSError
    例子 CheckBox2.Checked := Win32Check(CheckBox1.Checked);
    ━━━━━━━━━━━━━━━━━━━━━
    首部 procedure AddTerminateProc(TermProc: TTerminateProc);
    功能 添加一个退出过程到系统中
    说明 执行AddTerminateProc(nil)将导致系统异常
    参考 const System.TerminateProcList
    例子
    ///////Begin AddTerminateProc
    function NewTerminateProc: Boolean;
    begin
    Result := True;
    ShowMessage('NewTerminateProc');
    end;
    procedure TForm1.Button1Click(Sender: TObject);
    begin
    AddTerminateProc(NewTerminateProc);
    end;
    ///////End AddTerminateProc
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function CallTerminateProcs: Boolean;
    功能 返回调用退出过程是否成功
    说明 不建议调用
    参考 const System.TerminateProcList
    例子 CallTerminateProcs;
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function GDAL: LongWord;
    功能 <NULL>
    说明 <NULL>
    参考 <NULL>
    例子 <NULL>
    ━━━━━━━━━━━━━━━━━━━━━
    首部 procedure RCS;
    功能 <NULL>
    说明 <NULL>
    参考 <NULL>
    例子 <NULL>
    ━━━━━━━━━━━━━━━━━━━━━
    首部 procedure RPR;
    功能 <NULL>
    说明 <NULL>
    参考 <NULL>
    例子 <NULL>
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function SafeLoadLibrary(const Filename: string; ErrorMode: UINT = SEM_NOOPENFILEERRORBOX): HMODULE;
    功能 返回安全方式载入动态连接库资源
    说明 <参见LoadLibrary>
    参考 function Windows.LoadLibrary
    例子 <NULL>
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function GetEnvironmentVariable(const Name: string): string; overload;
    功能 返回过程环境变量
    说明 配合SetEnvironmentVariable函数使用
    参考 function Windows.GetEnvironmentVariable
    例子 Edit1.Text := GetEnvironmentVariable(Edit2.Text);
    ///////Begin GetEnvironmentVariable
    procedure TForm1.Button1Click(Sender: TObject);
    begin
    SetEnvironmentVariable(PChar(Edit2.Text), PChar(Edit3.Text));
    Edit1.Text := GetEnvironmentVariable(Edit2.Text);
    end;
    ///////End GetEnvironmentVariable
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function InterlockedIncrement(var I: Integer): Integer;
    功能 <NULL>
    说明 Kylix函数
    参考 <NULL>
    例子 <NULL>
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function InterlockedDecrement(var I: Integer): Integer;
    功能 <NULL>
    说明 Kylix函数
    参考 <NULL>
    例子 <NULL>
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function InterlockedExchange(var A: Integer; B: Integer): Integer;
    功能 <NULL>
    说明 Kylix函数
    参考 <NULL>
    例子 <NULL>
    ━━━━━━━━━━━━━━━━━━━━━
    首部 function InterlockedExchangeAdd(var A: Integer; B: Integer): Integer;
    功能 <NULL>
    说明 Kylix函数
    参考 <NULL>
    例子 <NULL>
    ━━━━━━━━━━━━━━━━━━━━━ 

  • 相关阅读:
    线程池问题
    高级I/O
    闹钟设计
    线程竞争问题
    线程基本函数
    SpringMvc支持跨域访问
    gitlab qq邮件配置
    gitlab断电
    docker run always
    电子书网
  • 原文地址:https://www.cnblogs.com/huiy/p/12982490.html
Copyright © 2011-2022 走看看