首部 function AnsiResemblesText(const AText, AOther: string): Boolean;
$[StrUtils.pas
功能 返回兩個(gè)字符串是否相似
說明 ANSI(American National Standards Institute)美國國家標(biāo)準(zhǔn)協(xié)會(huì);不區(qū)分大小寫
參考 function StrUtils.SoundexProc; var StrUtils.AnsiResemblesProc
例子 CheckBox1.Checked := AnsiResemblesText(Edit1.Text, Edit2.Text);
━━━━━━━━━━━━━━━━━━━━━
首部 function AnsiContainsText(const AText, ASubText: string): Boolean;
$[StrUtils.pas
功能 返回字符串AText是否包含子串ASubText
說明 不區(qū)分大小寫
參考 function StrUtils.AnsiUppercase; function StrUtils.AnsiPos
例子 CheckBox1.Checked := AnsiContainsText(Edit1.Text, Edit2.Text);
━━━━━━━━━━━━━━━━━━━━━
首部 function AnsiStartsText(const ASubText, AText: string): Boolean;
$[StrUtils.pas
功能 返回字符串AText是否以子串ASubText開頭
說明 不區(qū)分大小寫
參考 function Windows.CompareString
例子 CheckBox1.Checked := AnsiStartsText(Edit1.Text, Edit2.Text);
━━━━━━━━━━━━━━━━━━━━━
首部 function AnsiEndsText(const ASubText, AText: string): Boolean;
$[StrUtils.pas
功能 返回字符串AText是否以子串ASubText結(jié)尾
說明 不區(qū)分大小寫
參考 function Windows.CompareString
例子 CheckBox1.Checked := AnsiEndsText(Edit1.Text, Edit2.Text);
━━━━━━━━━━━━━━━━━━━━━
首部 function AnsiReplaceText(const AText, AFromText, AToText: string):
string; $[StrUtils.pas
功能 返回字符串AText中用子串AFromText替換成子串AToText的結(jié)果
說明 不區(qū)分大小寫
參考 function SysUtils.StringReplace; type SysUtils.TReplaceFlags
例子 Edit4.Text := AnsiReplaceText(Edit1.Text, Edit2.Text, Edit3.Text);
━━━━━━━━━━━━━━━━━━━━━
首部 function AnsiMatchText(const AText: string; const AValues: array of
string): Boolean; $[StrUtils.pas
功能 返回字符串?dāng)?shù)組AValues中是否包含字符串AText
說明 不區(qū)分大小寫
參考 function StrUtils.AnsiIndexText
例子 CheckBox1.Checked := AnsiMatchText(Edit1.Text, [‘a(chǎn)1‘, ‘a(chǎn)2‘, ‘a(chǎn)3‘,
‘a(chǎn)4‘]);
━━━━━━━━━━━━━━━━━━━━━
首部 function AnsiIndexText(const AText: string; const AValues: array of
string): Integer; $[StrUtils.pas
功能 返回字符串AText在字符串?dāng)?shù)組AValues中的位置
說明 不區(qū)分大小寫;如果不包含則返回-1
參考 function SysUtils.AnsiSameText
例子 SpinEdit1.Value := AnsiIndexText(Edit1.Text, [‘a(chǎn)1‘, ‘a(chǎn)2‘, ‘a(chǎn)3‘, ‘a(chǎn)4‘]);
━━━━━━━━━━━━━━━━━━━━━
首部 function AnsiContainsStr(const AText, ASubText: string): Boolean;
$[StrUtils.pas
功能 返回字符串AText是否包含子串ASubText
說明 區(qū)分大小寫
參考 function StrUtils.AnsiPos
例子 CheckBox1.Checked := AnsiContainsStr(Edit1.Text, Edit2.Text);
━━━━━━━━━━━━━━━━━━━━━
首部 function AnsiStartsStr(const ASubText, AText: string): Boolean;
$[StrUtils.pas
功能 返回字符串AText是否以子串ASubText開頭
說明 區(qū)分大小寫
參考 function SysUtils.AnsiSameStr
例子 CheckBox1.Checked := AnsiStartsStr(Edit1.Text, Edit2.Text);
━━━━━━━━━━━━━━━━━━━━━
首部 function AnsiEndsStr(const ASubText, AText: string): Boolean;
$[StrUtils.pas
功能 返回字符串AText是否以子串ASubText結(jié)尾
說明 區(qū)分大小寫
參考 function SysUtils.AnsiSameStr
例子 CheckBox1.Checked := AnsiEndsStr(Edit1.Text, Edit2.Text);
━━━━━━━━━━━━━━━━━━━━━
首部 function AnsiReplaceStr(const AText, AFromText, AToText: string):
string; $[StrUtils.pas
功能 返回字符串AText中用子串AFromText替換成子串AToText的結(jié)果
說明 區(qū)分大小寫
參考 function SysUtils.StringReplace; type SysUtils.TReplaceFlags
例子 Edit4.Text := AnsiReplaceStr(Edit1.Text, Edit2.Text, Edit3.Text);
━━━━━━━━━━━━━━━━━━━━━
首部 function AnsiMatchStr(const AText: string; const AValues: array of
string): Boolean; $[StrUtils.pas
功能 返回字符串?dāng)?shù)組AValues中是否包含字符串AText
說明 區(qū)分大小寫
參考 function StrUtils.AnsiIndexStr
例子 CheckBox1.Checked := AnsiMatchStr(Edit1.Text, [‘a(chǎn)1‘, ‘a(chǎn)2‘, ‘a(chǎn)3‘,
‘a(chǎn)4‘]);
━━━━━━━━━━━━━━━━━━━━━
首部 function AnsiIndexStr(const AText: string; const AValues: array of
string): Integer; $[StrUtils.pas
功能 返回字符串AText在字符串?dāng)?shù)組AValues中的位置
說明 區(qū)分大小寫
參考 function SysUtils.AnsiSameStr
例子 SpinEdit1.Value := AnsiIndexStr(Edit1.Text, [‘a(chǎn)1‘, ‘a(chǎn)2‘, ‘a(chǎn)3‘, ‘a(chǎn)4‘]);
━━━━━━━━━━━━━━━━━━━━━
首部 function DupeString(const AText: string; ACount: Integer): string;
$[StrUtils.pas
功能 返回字符串AText的ACount個(gè)復(fù)本
說明 當(dāng)ACount為0時(shí)返回‘‘
參考 function System.SetLength
例子 Edit3.Text := DupeString(Edit1.Text, SpinEdit1.Value);
━━━━━━━━━━━━━━━━━━━━━
首部 function ReverseString(const AText: string): string; $[StrUtils.pas
功能 返回字符串AText的反序
說明 ReverseString(‘1234‘) = ‘4321‘
參考 function System.SetLength
例子 Edit3.Text := ReverseString(Edit1.Text);
━━━━━━━━━━━━━━━━━━━━━
首部 function StuffString(const AText: string; AStart, ALength: Cardinal;
const ASubText: string): string; $[StrUtils.pas
功能 返回嵌套字符串
說明 AStart:嵌套開始位置;ALength:嵌套長度;StuffString(‘a(chǎn)bcd‘, 2, 0, ‘12‘) = ‘a(chǎn)12bcd‘
參考 function System.Copy
例子 Edit3.Text := StuffString(Edit1.Text, SpinEdit1.Value, SpinEdit2.Value,
Edit2.Text);
━━━━━━━━━━━━━━━━━━━━━
首部 function RandomFrom(const AValues: array of string): string; overload;
$[StrUtils.pas
功能 隨機(jī)返回字符串?dāng)?shù)組AValues中的一個(gè)元素
說明 之前建議執(zhí)行Randomize
參考 function System.Random
例子 Randomize; Edit3.Text := RandomFrom([‘a(chǎn)1‘, ‘a(chǎn)2‘, ‘a(chǎn)3‘, ‘a(chǎn)4‘]);
━━━━━━━━━━━━━━━━━━━━━
首部 function IfThen(AValue: Boolean; const ATrue: string; AFalse: string =
‘‘): string; overload; $[StrUtils.pas
功能 返回指定的邏輯字符串
說明 IfThen(True, ‘是‘, ‘否‘) = ‘是‘;IfThen(False, ‘是‘, ‘否‘) = ‘否‘
參考 <NULL>
例子 Edit3.Text := IfThen(CheckBox1.Checked, Edit1.Text, Edit2.Text);
━━━━━━━━━━━━━━━━━━━━━
首部 function LeftStr(const AText: string; const ACount: Integer): string;
$[StrUtils.pas
功能 返回字符串AText左邊的ACount個(gè)字符
說明 LeftStr(‘123456‘, 3) = ‘123‘
參考 function System.Copy
例子 Edit3.Text := LeftStr(Edit1.Text, SpinEdit1.Value);
━━━━━━━━━━━━━━━━━━━━━
首部 function RightStr(const AText: string; const ACount: Integer): string;
$[StrUtils.pas
功能 返回字符串AText右邊的ACount個(gè)字符
說明 RightStr(‘123456‘, 3) = ‘456‘
參考 function System.Copy
例子 Edit3.Text := RightStr(Edit1.Text, SpinEdit1.Value);
━━━━━━━━━━━━━━━━━━━━━
首部 function MidStr(const AText: string; const AStart, ACount: Integer):
string; $[StrUtils.pas
功能 返回字符串AText從AStart開始的ACount個(gè)字符
說明 其實(shí)就是Copy
參考 function System.Copy
例子 Edit3.Text := MidStr(Edit1.Text, SpinEdit1.Value, SpinEdit2.Value);
━━━━━━━━━━━━━━━━━━━━━
首部 function SearchBuf(Buf: PChar; BufLen: Integer; SelStart, SelLength:
Integer; SearchString: String; Options: TStringSearchOptions = [soDown]):
PChar; $[StrUtils.pas
功能 返回第一個(gè)搜索到的指針位置
說明 這函數(shù)常用于文本中搜索字符串
參考 <NULL>
例子
///////Begin SearchBuf
function SearchEdit(EditControl: TCustomEdit; const SearchString: String;
SearchOptions: TStringSearchOptions; FindFirst: Boolean = False): Boolean;
var
Buffer, P: PChar;
Size: Word;
begin
Result := False;
if (Length(SearchString) = 0) then Exit;
Size := EditControl.GetTextLen;
if (Size = 0) then Exit;
Buffer := StrAlloc(Size + 1);
try
EditControl.GetTextBuf(Buffer, Size + 1);
P := SearchBuf(Buffer, Size, EditControl.SelStart, EditControl.SelLength,
SearchString, SearchOptions);
if P <> nil then begin
EditControl.SelStart := P - Buffer;
EditControl.SelLength := Length(SearchString);
Result := True;
end;
finally
StrDispose(Buffer);
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
SearchOptions: TStringSearchOptions;
begin
SearchOptions := [];
if CheckBox1.Checked then
Include(SearchOptions, soDown);
if CheckBox2.Checked then
Include(SearchOptions, soMatchCase);
if CheckBox3.Checked then
Include(SearchOptions, soWholeWord);
SearchEdit(Memo1, Edit1.Text, SearchOptions);
Memo1.SetFocus;
end;
///////End SearchBuf
━━━━━━━━━━━━━━━━━━━━━
首部 function Soundex(const AText: string; ALength: TSoundexLength = 4):
string; $[StrUtils.pas
功能 返回探測字符串
說明 根據(jù)探測法(Soundex)可以找到相進(jìn)的字符串;http://www.nara.gov/genealogy/coding.html
參考 <NULL>
例子 Edit2.Text := Soundex(Edit1.Text, SpinEdit1.Value);
━━━━━━━━━━━━━━━━━━━━━
首部 function SoundexInt(const AText: string; ALength: TSoundexIntLength =
4): Integer; $[StrUtils.pas
功能 返回探測整數(shù)
說明 ALength的值越大解碼準(zhǔn)確率越高
參考 <NULL>
例子 SpinEdit2.Value := SoundexInt(Edit1.Text, SpinEdit1.Value);
━━━━━━━━━━━━━━━━━━━━━
首部 function DecodeSoundexInt(AValue: Integer): string; $[StrUtils.pas
功能 返回探測整數(shù)的解碼
說明 DecodeSoundexInt(SoundexInt(‘hello‘)) 相當(dāng)于 Soundex(‘hello‘)
參考 <NULL>
例子 Edit2.Text := DecodeSoundexInt(SpinEdit2.Value);
━━━━━━━━━━━━━━━━━━━━━
首部 function SoundexWord(const AText: string): Word; $[StrUtils.pas
功能 返回探測文字?jǐn)?shù)值
說明 沒有參數(shù)ALength已經(jīng)固定為4
參考 <NULL>
例子 SpinEdit2.Value := SoundexWord(Edit1.Text);
━━━━━━━━━━━━━━━━━━━━━
首部 function DecodeSoundexWord(AValue: Word): string; $[StrUtils.pas
功能 返回探測文字?jǐn)?shù)值的解碼
說明 DecodeSoundexWord(SoundexWord(‘hello‘)) 相當(dāng)于 Soundex(‘hello‘)
參考 <NULL>
例子 Edit2.Text := DecodeSoundexWord(SpinEdit2.Value);
━━━━━━━━━━━━━━━━━━━━━
首部 function SoundexSimilar(const AText, AOther: string; ALength:
TSoundexLength = 4): Boolean; $[StrUtils.pas
功能 返回兩個(gè)字符串的探測字符串是否相同
說明 Result := Soundex(AText, ALength) = Soundex(AOther, ALength)
參考 <NULL>
例子 CheckBox1.Checked := SoundexSimilar(Edit1.Text, Edit2.Text,
SpinEdit1.Value);
━━━━━━━━━━━━━━━━━━━━━
首部 function SoundexCompare(const AText, AOther: string; ALength:
TSoundexLength = 4): Integer; $[StrUtils.pas
功能 返回比較兩個(gè)字符串的探測字符串的結(jié)果
說明 Result := AnsiCompareStr(Soundex(AText, ALength), Soundex(AOther,
ALength))
參考 function SysUtils.AnsiCompareStr
例子 SpinEdit2.Value := SoundexCompare(Edit1.Text, Edit2.Text,
SpinEdit1.Value);
━━━━━━━━━━━━━━━━━━━━━
首部 function SoundexProc(const AText, AOther: string): Boolean;
$[StrUtils.pas
功能 調(diào)用SoundexSimilar返回兩個(gè)字符串的探測字符串是否相同
說明 系統(tǒng)變量AnsiResemblesProc的默認(rèn)值
參考 function StrUtils.AnsiResemblesText
例子 [var AnsiResemblesProc: TCompareTextProc = SoundexProc;]
━━━━━━━━━━━━━━━━━━━━━
首部 function NewStr(const S: string): PString; deprecated; $[SysUtils.pas
功能 返回一個(gè)新的字符串指針地址
說明 字符串S為空時(shí)返回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; $[SysUtils.pas
功能 釋放字符串指針P資源
說明 配合函數(shù)NewStr使用
參考 procedure System.Dispose
例子 <如上參見,如下參見>
━━━━━━━━━━━━━━━━━━━━━
首部 procedure AssignStr(var P: PString; const S: string); deprecated;
$[SysUtils.pas
功能 將字符串S更新給字符串指針P
說明 更新值時(shí)會(huì)釋放以前字符串指針的資源
參考 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;
$[SysUtils.pas
功能 在字符串Dest后追加字符串S
說明 相當(dāng)于Dest := Dest + S;Delphi6已經(jīng)不建議使用
參考 <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; $[SysUtils.pas
功能 返回字符串S的大寫形式
說明 非小寫字符不處理
參考 procedure System.SetLength
例子 Edit2.Text := UpperCase(Edit1.Text);
━━━━━━━━━━━━━━━━━━━━━
首部 function LowerCase(const S: string): string; $[SysUtils.pas
功能 返回字符串S的小寫形式
說明 非大寫字符不處理
參考 procedure System.SetLength
例子 Edit2.Text := LowerCase(Edit1.Text);
━━━━━━━━━━━━━━━━━━━━━
首部 function CompareStr(const S1, S2: string): Integer; $[SysUtils.pas
功能 返回比較兩個(gè)字符
說明 當(dāng)S1>S2返回值>0;當(dāng)S1<S2返回值<0;當(dāng)S1=S2返回值=0;區(qū)分大小寫
參考 <NULL>
例子 SpinEdit1.Value := CompareStr(Edit1.Text, Edit2.Text);
━━━━━━━━━━━━━━━━━━━━━
首部 function CompareMem(P1, P2: Pointer; Length: Integer): Boolean;
assembler; $[SysUtils.pas
功能 返回比較兩個(gè)內(nèi)存指針
說明 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; $[SysUtils.pas
功能 返回比較兩個(gè)字符串
說明 不區(qū)分大小寫
參考 <NULL>
例子 SpinEdit1.Value := CompareText(Edit1.Text, Edit2.Text);
━━━━━━━━━━━━━━━━━━━━━
首部 function SameText(const S1, S2: string): Boolean; $[SysUtils.pas
功能 返回兩個(gè)字符串是否相等
說明 不區(qū)分大小寫
參考 <NULL>
例子 CheckBox1.Checked := SameText(Edit1.Text, Edit2.Text);
━━━━━━━━━━━━━━━━━━━━━
首部 function AnsiUpperCase(const S: string): string; $[SysUtils.pas
功能 返回字符串S的大寫形式
說明 ANSI(American National Standards Institute)美國國家標(biāo)準(zhǔn)協(xié)會(huì);非小寫的字符不變
參考 function Windows.CharUpperBuff
例子 Edit2.Text := AnsiUpperCase(Edit1.Text);
━━━━━━━━━━━━━━━━━━━━━
首部 function AnsiLowerCase(const S: string): string; $[SysUtils.pas
功能 返回字符串S的小寫形式
說明 非大寫字符不處理
參考 function Windows.CharLowerBuff
例子 Edit2.Text := AnsiLowerCase(Edit1.Text);
━━━━━━━━━━━━━━━━━━━━━
首部 function AnsiCompareStr(const S1, S2: string): Integer; $[SysUtils.pas
功能 反回比較兩個(gè)字符串
說明 當(dāng)S1>S2返回值>0;當(dāng)S1<S2返回值<0;當(dāng)S1=S2返回值=0;區(qū)分大小寫
參考 function Windows.CompareString
例子 SpinEdit1.Value := AnsiCompareStr(Edit1.Text, Edit2.Text);
━━━━━━━━━━━━━━━━━━━━━
首部 function AnsiSameStr(const S1, S2: string): Boolean; $[SysUtils.pas
功能 返回兩個(gè)字符串是否相等
說明 區(qū)分大小寫
參考 function SysUtils.AnsiCompareStr
例子 CheckBox1.Checked := AnsiSameStr(Edit1.Text, Edit2.Text);
━━━━━━━━━━━━━━━━━━━━━
首部 function AnsiCompareText(const S1, S2: string): Integer; $[SysUtils.pas
功能 反回比較兩個(gè)字符串
說明 當(dāng)S1>S2返回值>0;當(dāng)S1<S2返回值<0;當(dāng)S1=S2返回值=0;不區(qū)分大小寫
參考 function Windows.CompareString
例子 SpinEdit1.Value := AnsiCompareText(Edit1.Text, Edit2.Text);
━━━━━━━━━━━━━━━━━━━━━
首部 function AnsiSameText(const S1, S2: string): Boolean; $[SysUtils.pas
功能 返回兩個(gè)字符串是否相等
說明 不區(qū)分大小寫
參考 function SysUtils.AnsiCompareText
例子 CheckBox1.Checked := AnsiSameText(Edit1.Text, Edit2.Text);
━━━━━━━━━━━━━━━━━━━━━
首部 function AnsiStrComp(S1, S2: PChar): Integer; $[SysUtils.pas
功能 返回比較兩個(gè)指針字符串
說明 當(dāng)S1>S2返回值>0;當(dāng)S1<S2返回值<0;當(dāng)S1=S2返回值=0;區(qū)分大小寫
參考 function System.CompareString
例子 SpinEdit1.Value := AnsiStrComp(PChar(Edit1.Text), PChar(Edit2.Text))
━━━━━━━━━━━━━━━━━━━━━
首部 function AnsiStrIComp(S1, S2: PChar): Integer; $[SysUtils.pas
功能 返回比較兩個(gè)指針字符串
說明 當(dāng)S1>S2返回值>0;當(dāng)S1<S2返回值<0;當(dāng)S1=S2返回值=0;不區(qū)分大小寫;Ignore(忽略)
參考 function Windows.CompareString
例子 SpinEdit1.Value := AnsiStrIComp(PChar(Edit1.Text), PChar(Edit2.Text))
━━━━━━━━━━━━━━━━━━━━━
首部 function AnsiStrLComp(S1, S2: PChar; MaxLen: Cardinal): Integer;
$[SysUtils.pas
功能 返回比較兩個(gè)指針字符串指定長度
說明 當(dāng)S1>S2返回值>0;當(dāng)S1<S2返回值<0;當(dāng)S1=S2返回值=0;區(qū)分大小寫;Length(長度)
參考 function Windows.CompareString
例子 SpinEdit1.Value := AnsiStrLComp(PChar(Edit1.Text), PChar(Edit2.Text),
SpinEdit2.Value)
━━━━━━━━━━━━━━━━━━━━━
首部 function AnsiStrLIComp(S1, S2: PChar; MaxLen: Cardinal): Integer;
$[SysUtils.pas
功能 返回比較兩個(gè)指針字符串指定長度
說明 當(dāng)S1>S2返回值>0;當(dāng)S1<S2返回值<0;當(dāng)S1=S2返回值=0;不區(qū)分大小寫
參考 function Windows.CompareString
例子 SpinEdit1.Value := AnsiStrLIComp(PChar(Edit1.Text), PChar(Edit2.Text),
SpinEdit2.Value)
━━━━━━━━━━━━━━━━━━━━━
首部 function AnsiStrLower(Str: PChar): PChar; $[SysUtils.pas
功能 返回指針字符串小寫形式
說明 非大寫字符不處理
參考 function Windows.CharLower
例子 Edit2.Text := AnsiStrLower(PChar(Edit1.Text));
━━━━━━━━━━━━━━━━━━━━━
首部 function AnsiStrUpper(Str: PChar): PChar; $[SysUtils.pas
功能 返回指針字符串大寫形式
說明 非小寫字符不處理
參考 function Windows.CharUpper
例子 Edit2.Text := AnsiStrUpper(PChar(Edit1.Text));
━━━━━━━━━━━━━━━━━━━━━
首部 function AnsiLastChar(const S: string): PChar; $[SysUtils.pas
功能 返回字符串S的最后一個(gè)指針字符
說明 當(dāng)字符串S為空串則返回空指針
參考 function SysUtils.ByteType
例子 Edit2.Text := AnsiLastChar(Edit1.Text);
━━━━━━━━━━━━━━━━━━━━━
首部 function AnsiStrLastChar(P: PChar): PChar; $[SysUtils.pas
功能 返回指針字符串P的最后一個(gè)指針字符
說明 當(dāng)字符串P為空空指針則返回空指針
參考 function SysUtils.ByteType
例子 Edit2.Text := AnsiLastChar(PChar(Edit1.Text));
━━━━━━━━━━━━━━━━━━━━━
首部 function WideUpperCase(const S: WideString): WideString; $[SysUtils.pas
功能 返回雙字節(jié)字符串的大寫形式
說明 WideChar雙字節(jié)字符
參考 function Windows.CharUpperBuffW
例子 Edit2.Text := WideUpperCase(Edit1.Text);
━━━━━━━━━━━━━━━━━━━━━
首部 function WideLowerCase(const S: WideString): WideString; $[SysUtils.pas
功能 返回雙字節(jié)字符串的小寫形式
說明 我怎么就測試不出來呢
參考 function Windows.CharLowerBuffW
例子 Edit2.Text := WideLowerCase(Edit1.Text);
━━━━━━━━━━━━━━━━━━━━━
首部 function WideCompareStr(const S1, S2: WideString): Integer;
$[SysUtils.pas
功能 返回比較兩個(gè)雙字節(jié)字符串
說明 當(dāng)S1>S2返回值>0;當(dāng)S1<S2返回值<0;當(dāng)S1=S2返回值=0;區(qū)分大小寫
參考 function Windows.CompareStringW
例子 SpinEdit1.Value := WideCompareStr(Edit1.Text, Edit2.Text);
━━━━━━━━━━━━━━━━━━━━━
首部 function WideSameStr(const S1, S2: WideString): Boolean; $[SysUtils.pas
功能 返回兩個(gè)雙字節(jié)字符串是否相同
說明 區(qū)分大小寫
參考 function SysUtils.WideCompareStr
例子 CheckBox1.Checked := WideSameStr(Edit1.Text, Edit2.Text);
━━━━━━━━━━━━━━━━━━━━━
首部 function WideCompareText(const S1, S2: WideString): Integer;
$[SysUtils.pas
功能 返回比較兩個(gè)雙字節(jié)字符串
說明 當(dāng)S1>S2返回值>0;當(dāng)S1<S2返回值<0;當(dāng)S1=S2返回值=0;不區(qū)分大小寫
參考 function Windows.CompareStringW
例子 SpinEdit1.Value := WideCompareText(Edit1.Text, Edit2.Text);
━━━━━━━━━━━━━━━━━━━━━
首部 function WideSameText(const S1, S2: WideString): Boolean;
$[SysUtils.pas
功能 返回兩個(gè)雙字節(jié)字符串是否相同
說明 不區(qū)分大小寫
參考 function SysUtils.WideCompareText
例子 CheckBox1.Checked := WideSameText(Edit1.Text, Edit2.Text);
━━━━━━━━━━━━━━━━━━━━━
首部 function Trim(const S: string): string; overload; $[SysUtils.pas
首部 function Trim(const S: WideString): WideString; overload;
$[SysUtils.pas
功能 返回除去字符串S左右不可見字符
說明 小于#32的字符看作不可見字符
參考 function System.Copy
例子 Edit2.Text := Trim(Edit1.Text);
━━━━━━━━━━━━━━━━━━━━━
首部 function TrimLeft(const S: string): string; overload; $[SysUtils.pas
首部 function TrimLeft(const S: WideString): WideString; overload;
$[SysUtils.pas
功能 返回除去字符串S左邊不可見字符
說明 小于#32的字符看作不可見字符
參考 function System.Copy
例子 Edit2.Text := TrimLeft(Edit1.Text);
━━━━━━━━━━━━━━━━━━━━━
首部 function TrimRight(const S: string): string; overload; $[SysUtils.pas
首部 function TrimRight(const S: WideString): WideString; overload;
$[SysUtils.pas
功能 返回除去字符串S右邊不可見字符
說明 小于#32的字符看作不可見字符
參考 function System.Copy
例子 Edit2.Text := TrimRight(Edit1.Text);
━━━━━━━━━━━━━━━━━━━━━
首部 function QuotedStr(const S: string): string; $[SysUtils.pas
功能 返回字符串S在pascal中的表現(xiàn)形式
說明 單引號(hào)中的一個(gè)單引號(hào)將轉(zhuǎn)成兩個(gè)
參考 procedure System.Insert
例子 Edit2.Text := QuotedStr(Edit1.Text);
━━━━━━━━━━━━━━━━━━━━━
首部 function AnsiQuotedStr(const S: string; Quote: Char): string;
$[SysUtils.pas
功能 返回字符串S以字符Quote為引號(hào)的表現(xiàn)形式
說明 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;
$[SysUtils.pas
功能 返回以字符Quote為引號(hào)的表現(xiàn)形式原形
說明 表現(xiàn)形式非法時(shí)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;
$[SysUtils.pas
功能 返回以字符AQuote為引號(hào)的表現(xiàn)形式原形
說明 表現(xiàn)形式非法時(shí)則返回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; $[SysUtils.pas
功能 返回將給定字符串的行分隔符調(diào)整為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; $[SysUtils.pas
功能 返回字符串Ident是否是正確的標(biāo)識(shí)符
說明 標(biāo)識(shí)符::字母|下劃線[字母|下劃線|數(shù)字]...
參考 <NULL>
例子 CheckBox1.Checked := IsValidIdent(Edit1.Text);
━━━━━━━━━━━━━━━━━━━━━
首部 function IntToStr(Value: Integer): string; overload; $[SysUtils.pas
首部 function IntToStr(Value: Int64): string; overload; $[SysUtils.pas
功能 返回整數(shù)Value轉(zhuǎn)換成字符串
說明 Format(‘%d‘, [Value])
參考 function SysUtils.FmtStr
例子 Edit2.Text := IntToStr(SpinEdit1.Value);
━━━━━━━━━━━━━━━━━━━━━
首部 function IntToHex(Value: Integer; Digits: Integer): string; overload;
$[SysUtils.pas
首部 function IntToHex(Value: Int64; Digits: Integer): string; overload;
$[SysUtils.pas
功能 返回整數(shù)Value轉(zhuǎn)換成十六進(jìn)制表現(xiàn)結(jié)果;Format(‘%.*x‘, [Digits, Value])
說明 參數(shù)Digits指定字符最小寬度;最小寬度不足時(shí)將用0填充
參考 function SysUtils.FmtStr
例子 Edit2.Text := IntToHex(SpinEdit1.Value, SpinEdit2.Value);
━━━━━━━━━━━━━━━━━━━━━
首部 function StrToInt(const S: string): Integer; $[SysUtils.pas
功能 返回字符串S轉(zhuǎn)換成整數(shù)
說明 字符串非整數(shù)表達(dá)時(shí)將引起異常
參考 procedure System.Val
例子 SpinEdit1.Value := StrToInt(Edit1.Text);
━━━━━━━━━━━━━━━━━━━━━
首部 function StrToIntDef(const S: string; Default: Integer): Integer;
$[SysUtils.pas
功能 返回字符串S轉(zhuǎn)換成整數(shù)
說明 字符串非整數(shù)表達(dá)時(shí)則返回默認(rèn)值Default
參考 procedure System.Val
例子 SpinEdit1.Value := StrToIntDef(Edit1.Text, 0);
━━━━━━━━━━━━━━━━━━━━━
首部 function TryStrToInt(const S: string; out Value: Integer): Boolean;
$[SysUtils.pas
功能 返回字符串S轉(zhuǎn)換成整數(shù)Value是否成功
說明 字符串非整數(shù)表達(dá)時(shí)返回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; $[SysUtils.pas
功能 返回字符串S轉(zhuǎn)換成六十四位整數(shù)
說明 字符串非六十四位整數(shù)表達(dá)時(shí)將引起異常
參考 procedure System.Val
例子 SpinEdit1.Value := StrToInt64(Edit1.Text);
━━━━━━━━━━━━━━━━━━━━━
首部 function StrToInt64Def(const S: string; const Default: Int64): Int64;
$[SysUtils.pas
功能 返回字符串S轉(zhuǎn)換成六十四位整數(shù)
說明 字符串非六十四位整數(shù)表達(dá)時(shí)則返回默認(rèn)值Default
參考 procedure System.Val
例子 SpinEdit1.Value := StrToInt64Def(Edit1.Text, 0);
━━━━━━━━━━━━━━━━━━━━━
首部 function TryStrToInt64(const S: string; out Value: Int64): Boolean;
$[SysUtils.pas
功能 返回字符串S轉(zhuǎn)換成六十四位整數(shù)Value是否成功
說明 字符串非六十四位整數(shù)表達(dá)時(shí)返回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; $[SysUtils.pas
功能 返回字符串S轉(zhuǎn)換成邏輯值
說明 字符非邏輯表達(dá)時(shí)將引起異常
參考 function SysUtils.TryStrToBool
例子 CheckBox1.Checked := StrToBool(Edit1.Text);
━━━━━━━━━━━━━━━━━━━━━
首部 function StrToBoolDef(const S: string; const Default: Boolean):
Boolean; $[SysUtils.pas
功能 返回字符串S轉(zhuǎn)換成邏輯值
說明 字符非邏輯表達(dá)時(shí)則返回默認(rèn)值Default
參考 function SysUtils.TryStrToBool
例子 CheckBox1.Checked := StrToBoolDef(Edit1.Text, False);
━━━━━━━━━━━━━━━━━━━━━
首部 function TryStrToBool(const S: string; out Value: Boolean): Boolean;
$[SysUtils.pas
功能 返回字符串S轉(zhuǎn)換成邏輯值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;
$[SysUtils.pas
功能 返回邏輯值B轉(zhuǎn)換成字符串
說明 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; $[SysUtils.pas
功能 返回根據(jù)標(biāo)識(shí)Ident的字符串資源
說明 字符串資源是指程序的內(nèi)部資源
參考 function SysUtils.FindStringResource
例子 Edit2.Text := LoadStr(StrToIntDef(Edit1.Text, 0));
━━━━━━━━━━━━━━━━━━━━━
首部 function FmtLoadStr(Ident: Integer; const Args: array of const):
string; $[SysUtils.pas
功能 返回格式化的字符串資源
說明 字符串資源是指程序的內(nèi)部資源
參考 function SysUtils.FmtStr;function SysUtils.FindStringResource
例子 <NULL>;
━━━━━━━━━━━━━━━━━━━━━
首部 function StrLen(const Str: PChar): Cardinal; $[SysUtils.pas
功能 返回指針字符串的長度
說明 當(dāng)指針字符串Str為nil時(shí)將觸發(fā)異常
參考 <NULL>
例子 SpinEdit2.Value := StrLen(PChar(Edit1.Text));
━━━━━━━━━━━━━━━━━━━━━
首部 function StrEnd(const Str: PChar): PChar; $[SysUtils.pas
功能 返回指針字符串的結(jié)尾
說明 當(dāng)指針字符串Str為nil時(shí)將觸發(fā)異常
參考 <NULL>
例子 Edit2.Text := StrEnd(PChar(Edit1.Text)) - SpinEdit1.Value;
━━━━━━━━━━━━━━━━━━━━━
首部 function StrMove(Dest: PChar; const Source: PChar; Count: Cardinal):
PChar; $[SysUtils.pas
功能 返回將指針字符串Source指定內(nèi)存數(shù)量Count復(fù)制覆蓋到指針字符串Dest中
說明 Dest沒有分配資源將觸發(fā)異常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;
$[SysUtils.pas
功能 返回將指針字符串Source復(fù)制到指針字符串Dest中
說明 Dest應(yīng)已經(jīng)分配足夠的空間非則將觸發(fā)異常
參考 <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;
$[SysUtils.pas
功能 返回將指針字符串Source復(fù)制到指針字符串Dest中的結(jié)尾
說明 可以連接指針字符串
參考 <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; $[SysUtils.pas
功能 返回將指針字符串Source指定長度MaxLen復(fù)制到指針字符串Dest中
說明 Dest應(yīng)已經(jīng)分配足夠的空間非則將觸發(fā)異常
參考 <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;
$[SysUtils.pas
功能 返回將指針字符串Source復(fù)制到指針字符串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; $[SysUtils.pas
功能 返回將字符串Source指定長度MaxLen復(fù)制到指針字符串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;
$[SysUtils.pas
功能 返回連接指針字符串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; $[SysUtils.pas
功能 返回連接指針字符串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; $[SysUtils.pas
功能 返回比較兩個(gè)指針字符串
說明 當(dāng)S1>S2返回值>0;當(dāng)S1<S2返回值<0;當(dāng)S1=S2返回值=0;區(qū)分大小寫;[注意]返回第一個(gè)出現(xiàn)不同字符的差異
參考 <NULL>
例子 SpinEdit1.Value := StrComp(PChar(Edit1.Text), PChar(Edit2.Text));
━━━━━━━━━━━━━━━━━━━━━
首部 function StrIComp(const Str1, Str2: PChar): Integer; $[SysUtils.pas
功能 返回比較兩個(gè)指針字符串
說明 當(dāng)S1>S2返回值>0;當(dāng)S1<S2返回值<0;當(dāng)S1=S2返回值=0;不區(qū)分大小寫;[注意]返回第一個(gè)出現(xiàn)不同字符的差異
參考 <NULL>
例子 SpinEdit1.Value := StrIComp(PChar(Edit1.Text), PChar(Edit2.Text));
━━━━━━━━━━━━━━━━━━━━━
首部 function StrLComp(const Str1, Str2: PChar; MaxLen: Cardinal): Integer;
$[SysUtils.pas
功能 返回比較兩個(gè)指針字符串指定長度
說明 當(dāng)S1>S2返回值>0;當(dāng)S1<S2返回值<0;當(dāng)S1=S2返回值=0;區(qū)分大小寫;Length(長度);[注意]返回第一個(gè)出現(xiàn)不同字符的差異
參考 <NULL>
例子 SpinEdit1.Value := StrLComp(PChar(Edit1.Text), PChar(Edit2.Text),
SpinEdit2.Value)
━━━━━━━━━━━━━━━━━━━━━
首部 function StrLIComp(const Str1, Str2: PChar; MaxLen: Cardinal): Integer;
$[SysUtils.pas
功能 返回比較兩個(gè)指針字符串指定長度
說明 當(dāng)S1>S2返回值>0;當(dāng)S1<S2返回值<0;當(dāng)S1=S2返回值=0;不區(qū)分大小寫;[注意]返回第一個(gè)出現(xiàn)不同字符的差異
參考 <NULL>
例子 SpinEdit1.Value := StrLIComp(PChar(Edit1.Text), PChar(Edit2.Text),
SpinEdit2.Value)
━━━━━━━━━━━━━━━━━━━━━
首部 function StrScan(const Str: PChar; Chr: Char): PChar; $[SysUtils.pas
功能 返回在指針字符串Str搜索字符Chr第一個(gè)出現(xiàn)的地址
說明 沒有找到則返回空指針
參考 <NULL>
例子 Edit2.Text := StrScan(PChar(Edit1.Text), ‘*‘);
━━━━━━━━━━━━━━━━━━━━━
首部 function StrRScan(const Str: PChar; Chr: Char): PChar; $[SysUtils.pas
功能 返回在指針字符串Str搜索字符Chr最后一個(gè)出現(xiàn)的地址
說明 沒有找到則返回空指針
參考 <NULL>
例子 Edit2.Text := StrRScan(PChar(Edit1.Text), ‘*‘);
━━━━━━━━━━━━━━━━━━━━━
首部 function StrPos(const Str1, Str2: PChar): PChar; $[SysUtils.pas
功能 返回指針字符串Str2在Str1中第一個(gè)出現(xiàn)的地址
說明 沒有找到則返回空指針;StrPos(‘12345‘, ‘3‘) = ‘345‘
參考 <NULL>
例子 Edit3.Text := StrPos(PChar(Edit1.Text), PChar(Edit2.Text));
━━━━━━━━━━━━━━━━━━━━━
首部 function StrUpper(Str: PChar): PChar; $[SysUtils.pas
功能 返回指針字符串Str大寫
說明 非小寫字符不處理
參考 <NULL>
例子 Edit1.Text := StrUpper(PChar(Edit2.Text));
━━━━━━━━━━━━━━━━━━━━━
首部 function StrLower(Str: PChar): PChar; $[SysUtils.pas
功能 返回指針字符串Str小寫
說明 非大寫字符不處理
參考 <NULL>
例子 Edit1.Text := StrLower(PChar(Edit2.Text));
━━━━━━━━━━━━━━━━━━━━━
首部 function StrPas(const Str: PChar): string; $[SysUtils.pas
功能 返回指針字符串Str轉(zhuǎn)換成字符串
說明 也可以直接賦值
參考 <NULL>
例子 Edit1.Text := StrPas(PChar(Edit2.Text));
━━━━━━━━━━━━━━━━━━━━━
首部 function StrAlloc(Size: Cardinal): PChar; $[SysUtils.pas
功能 返回分配指定空間的內(nèi)存資源給指針字符串
說明 空間的大小也將保存;用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; $[SysUtils.pas
功能 返回通過函數(shù)StrAlloc分配的緩沖區(qū)大小
說明 出現(xiàn)異常情況則返回不可預(yù)知的結(jié)果
參考 function System.SizeOf
例子 SpinEdit1.Value := StrBufSize(StrAlloc(SpinEdit2.Value));
━━━━━━━━━━━━━━━━━━━━━
首部 function StrNew(const Str: PChar): PChar; $[SysUtils.pas
功能 返回復(fù)制一個(gè)新的指針字符串
說明 如果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); $[SysUtils.pas
功能 釋放指針字符串Str內(nèi)存資源
說明 如果Str為nil則不作任何處理;并且釋放空間大小信息
參考 function System.Dec;function System.SizeOf;function System.FreeMem
例子 <參見StrNew>
━━━━━━━━━━━━━━━━━━━━━
首部 function Format(const Format: string; const Args: array of const):
string; $[SysUtils.pas
功能 返回按指定方式格式化一個(gè)數(shù)組常量的字符形式
說明 這個(gè)函數(shù)是我在Delphi中用得最多的函數(shù),現(xiàn)在就列舉幾個(gè)例子給你個(gè)直觀的理解
"%" [索引 ":"] ["-"] [寬度] ["." 摘要] 類型
Format(‘x=%d‘, [12]); //‘x=12‘ //最普通
Format(‘x=%3d‘, [12]); //‘x= 12‘ //指定寬度
Format(‘x=%f‘, [12.0]); //‘x=12.00‘ //浮點(diǎn)數(shù)
Format(‘x=%.3f‘, [12.0]); //‘x=12.000‘ //指定小數(shù)
Format(‘x=%.*f‘, [5, 12.0]); //‘x=12.00000‘ //動(dòng)態(tài)配置
Format(‘x=%.5d‘, [12]); //‘x=00012‘ //前面補(bǔ)充0
Format(‘x=%.5x‘, [12]); //‘x=0000C‘ //十六進(jìn)制
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‘ //科學(xué)記數(shù)法
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); $[SysUtils.pas
功能 按指定方式格式化一個(gè)數(shù)組常量的字符形式返回
說明 <參見Format>
參考 function SysUtils.FormatBuf;function System.Length;function
System.SetLength
例子 <參見Format>
━━━━━━━━━━━━━━━━━━━━━
首部 function StrFmt(Buffer, Format: PChar; const Args: array of const):
PChar; $[SysUtils.pas
功能 返回按指定方式格式化一個(gè)數(shù)組常量的字符指針形式
說明 如果Buffer和Format其中只要有一個(gè)為nil則返回nil
參考 function SysUtils.FormatBuf
例子 <參見Format>
━━━━━━━━━━━━━━━━━━━━━
首部 function StrLFmt(Buffer: PChar; MaxBufLen: Cardinal; Format: PChar;
const Args: array of const): PChar; $[SysUtils.pas
功能 返回按指定方式和長度格式化一個(gè)數(shù)組常量的字符指針形式
說明 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; $[SysUtils.pas
功能 返回按指定方式格式化一個(gè)數(shù)組常量到緩沖區(qū)Buffer中
說明 <NULL>
參考 <NULL>
例子 <參見Format>
━━━━━━━━━━━━━━━━━━━━━
首部 function WideFormat(const Format: WideString; const Args: array of
const): WideString; $[SysUtils.pas
功能 返回按指定方式格式化一個(gè)數(shù)組常量的多字節(jié)字符形式
說明 <NULL>
參考 procedure SysUtils.WideFmtStr
例子 <參見Format>
━━━━━━━━━━━━━━━━━━━━━
首部 procedure WideFmtStr(var Result: WideString; const Format: WideString;
const Args: array of const); $[SysUtils.pas
功能 按指定方式格式化一個(gè)數(shù)組常量的多字節(jié)字符形式返回
說明 <NULL>
參考 function SysUtils.WideFormatBuf
例子 <參見Format>
━━━━━━━━━━━━━━━━━━━━━
首部 function WideFormatBuf(var Buffer; BufLen: Cardinal; const Format;
FmtLen: Cardinal; const Args: array of const): Cardinal; $[SysUtils.pas
功能 返回按指定方式格式化一個(gè)數(shù)組常量到緩沖區(qū)Buffer中
說明 <NULL>
參考 <NULL>
例子 <參見Format>
━━━━━━━━━━━━━━━━━━━━━
首部 function FloatToStr(Value: Extended): string; $[SysUtils.pas
功能 返回浮點(diǎn)數(shù)Value轉(zhuǎn)換成字符串
說明 當(dāng)浮點(diǎn)數(shù)大等于1E15將采用科學(xué)記數(shù)法
參考 function SysUtils.FloatToText
例子 Edit1.Text := FloatToStr(Now);
━━━━━━━━━━━━━━━━━━━━━
首部 function CurrToStr(Value: Currency): string; $[SysUtils.pas
功能 返回貨幣數(shù)Value轉(zhuǎn)換成字符串
說明 貨幣數(shù)只保留四位小數(shù)
參考 function SysUtils.FloatToText
例子 Edit1.Text := CurrToStr(Now);
━━━━━━━━━━━━━━━━━━━━━
首部 function FloatToCurr(const Value: Extended): Currency; $[SysUtils.pas
功能 返回浮點(diǎn)數(shù)Value轉(zhuǎn)換成貨幣數(shù)
說明 如果浮點(diǎn)數(shù)Value超出范圍則將觸發(fā)異常
參考 const SysUtiles.MinCurrency;const SysUtiles.MaxCurrency
例子 Edit1.Text := CurrToStr(FloatToCurr(Now));
━━━━━━━━━━━━━━━━━━━━━
首部 function FloatToStrF(Value: Extended; Format: TFloatFormat; Precision,
Digits: Integer): string; $[SysUtils.pas
功能 返回浮點(diǎn)數(shù)以指定格式轉(zhuǎn)換成字符串
說明 Precision指定精度;Digits指定小數(shù)寬度
參考 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; $[SysUtils.pas
功能 返回貨幣類型以指定格式轉(zhuǎn)換成字符串
說明 Digits指定小數(shù)寬度
參考 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;
$[SysUtils.pas
功能 返回浮點(diǎn)數(shù)以指定格式轉(zhuǎn)換成指針字符串的內(nèi)存大小
說明 Precision指定精度;Digits指定小數(shù)寬度
參考 <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;
$[SysUtils.pas
功能 返回浮點(diǎn)數(shù)類型以指定格式字符串Format轉(zhuǎn)換成字符串
說明 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;
$[SysUtils.pas
功能 返回貨幣類型以指定格式字符串Format轉(zhuǎn)換成字符串
說明 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; $[SysUtils.pas
功能 返回浮點(diǎn)數(shù)以指定格式字符串Format轉(zhuǎn)換成指針字符串的內(nèi)存大小
說明 ValueType指定無類型參數(shù)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; $[SysUtils.pas
功能 返回字符串S轉(zhuǎn)換成浮點(diǎn)數(shù)
說明 字符串非浮點(diǎn)數(shù)表達(dá)時(shí)將引起異常
參考 function SysUtils.TextToFloat
例子 var E: Extended; begin E := StrToFloat(Edit1.Text); end;
━━━━━━━━━━━━━━━━━━━━━
首部 function StrToFloatDef(const S: string; const Default: Extended):
Extended; $[SysUtils.pas
功能 返回字符串S轉(zhuǎn)換成浮點(diǎn)數(shù)
說明 字符串非浮點(diǎn)數(shù)表達(dá)時(shí)則返回默認(rèn)值Default
參考 function SysUtils.TextToFloat
例子 var E: Extended; begin E := StrToFloatDef(Edit1.Text, 0); end;
━━━━━━━━━━━━━━━━━━━━━
首部 function TryStrToFloat(const S: string; out Value: Extended): Boolean;
overload; $[SysUtils.pas
首部 function TryStrToFloat(const S: string; out Value: Single): Boolean;
overload; $[SysUtils.pas
首部 function TryStrToFloat(const S: string; out Value: Double): Boolean;
overload; $[SysUtils.pas
功能 返回字符串S轉(zhuǎn)換成浮點(diǎn)數(shù)Value是否成功
說明 字符串非浮點(diǎn)數(shù)表達(dá)時(shí)返回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; $[SysUtils.pas
功能 返回字符串S轉(zhuǎn)換成貨幣數(shù)
說明 字符串非貨幣數(shù)表達(dá)時(shí)將引起異常
參考 function SysUtils.TextToFloat
例子 var C: Currency; begin C := StrToCurr(Edit1.Text); end;
━━━━━━━━━━━━━━━━━━━━━
首部 function StrToCurrDef(const S: string; const Default: Currency):
Currency; $[SysUtils.pas
功能 返回字符串S轉(zhuǎn)換成貨幣數(shù)
說明 字符串非貨幣數(shù)表達(dá)時(shí)則返回默認(rèn)值Default
參考 function SysUtils.TextToFloat
例子 var C: Currency; begin C := StrToCurrDef(Edit1.Text, 0); end;
━━━━━━━━━━━━━━━━━━━━━
首部 function TryStrToCurr(const S: string; out Value: Currency): Boolean;
$[SysUtils.pas
功能 返回字符串S轉(zhuǎn)換成貨幣數(shù)Value是否成功
說明 字符串非貨幣數(shù)表達(dá)時(shí)返回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; $[SysUtils.pas
功能 返回將指針字符串Buffer轉(zhuǎn)換成無類型變量Value
說明 ValueType指定無類型參數(shù)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
━━━━━━━━━━━━━━━━━━━━━
首部 function DateToStr(const DateTime: TDateTime): string; $[SysUtils.pas
功能 返回日期DateTime轉(zhuǎn)換成字符串
說明 轉(zhuǎn)換格式由系統(tǒng)變量ShortDateFormat控制
參考 function SysUtils.DateTimeToString;var SysUtils.ShortDateFormat
例子 Edit1.Text := DateToStr(Date);
━━━━━━━━━━━━━━━━━━━━━
首部 function TimeToStr(const DateTime: TDateTime): string; $[SysUtils.pas
功能 返回時(shí)間DateTime轉(zhuǎn)換成字符串
說明 轉(zhuǎn)換格式由系統(tǒng)變量LongTimeFormat控制
參考 function SysUtils.DateTimeToString;var SysUtils.LongTimeFormat
例子 Edit1.Text := TimeToStr(Date);
━━━━━━━━━━━━━━━━━━━━━
首部 function DateTimeToStr(const DateTime: TDateTime): string;
$[SysUtils.pas
功能 返回日期時(shí)間DateTime轉(zhuǎn)換成字符串
說明 轉(zhuǎn)換格式由系統(tǒng)變量ShortDateFormat和LongTimeFormat控制
參考 function SysUtils.DateTimeToString
例子 Edit1.Text := DateTimeToStr(Now);
━━━━━━━━━━━━━━━━━━━━━
首部 function StrToDate(const S: string): TDateTime; $[SysUtils.pas
功能 返回字符串S轉(zhuǎn)換成日期
說明 字符非日期表達(dá)時(shí)將引起異常
參考 function SysUtils.TryStrToDate
例子 DateTimePicker1.Date := StrToDate(Edit1.Text);
━━━━━━━━━━━━━━━━━━━━━
首部 function StrToDateDef(const S: string; const Default: TDateTime):
TDateTime; $[SysUtils.pas
功能 返回字符串S轉(zhuǎn)換成日期
說明 字符非日期表達(dá)時(shí)則返回默認(rèn)值Default
參考 function SysUtils.TryStrToDate
例子 DateTimePicker1.Date := StrToDateDef(Edit1.Text, Date);
━━━━━━━━━━━━━━━━━━━━━
首部 function TryStrToDate(const S: string; out Value: TDateTime): Boolean;
$[SysUtils.pas
功能 返回字符串S轉(zhuǎn)換成日期Value是否成功
說明 字符非日期表達(dá)時(shí)返回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; $[SysUtils.pas
功能 返回字符串S轉(zhuǎn)換成時(shí)間
說明 字符非時(shí)間表達(dá)時(shí)將引起異常
參考 function SysUtils.TryStrToTime
例子 DateTimePicker1.Time := StrToTime(Edit1.Text);
━━━━━━━━━━━━━━━━━━━━━
首部 function StrToTimeDef(const S: string; const Default: TDateTime):
TDateTime; $[SysUtils.pas
功能 返回字符串S轉(zhuǎn)換成時(shí)間
說明 字符非時(shí)間表達(dá)時(shí)則返回默認(rèn)值Default
參考 function SysUtils.TryStrToTime
例子 DateTimePicker1.Time := StrToTimeDef(Edit1.Text, Time);
━━━━━━━━━━━━━━━━━━━━━
首部 function TryStrToTime(const S: string; out Value: TDateTime): Boolean;
$[SysUtils.pas
功能 返回字符串S轉(zhuǎn)換成時(shí)間Value是否成功
說明 字符非時(shí)間表達(dá)時(shí)返回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; $[SysUtils.pas
功能 返回字符串S轉(zhuǎn)換成日期時(shí)間
說明 字符非日期時(shí)間表達(dá)時(shí)將引起異常
參考 function SysUtils.TryStrToDateTime
例子 Edit1.Text := DateTimeToStr(StrToDateTime(Edit2.Text));
━━━━━━━━━━━━━━━━━━━━━
首部 function StrToDateTimeDef(const S: string; const Default: TDateTime):
TDateTime; $[SysUtils.pas
功能 返回字符串S轉(zhuǎn)換成日期時(shí)間
說明 字符非日期時(shí)間表達(dá)時(shí)則返回默認(rèn)值Default
參考 function SysUtils.TryStrToDateTime
例子 Edit1.Text := DateTimeToStr(StrToDateTimeDef(Edit2.Text, Now));
━━━━━━━━━━━━━━━━━━━━━
首部 function TryStrToDateTime(const S: string; out Value: TDateTime):
Boolean; $[SysUtils.pas
功能 返回字符串S轉(zhuǎn)換成日期時(shí)間Value是否成功
說明 字符非日期時(shí)間表達(dá)時(shí)返回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
━━━━━━━━━━━━━━━━━━━━━
首部 procedure DateTimeToString(var Result: string; const Format: string;
DateTime: TDateTime); $[SysUtils.pas
功能 用指定的格式Format來格式化日期時(shí)間DateTime并返回到字符串Result中
說明 <參見FormatDateTime>
參考 function System.SetString
例子 <參見FormatDateTime>
━━━━━━━━━━━━━━━━━━━━━
首部 function GetLocaleStr(Locale, LocaleType: Integer; const Default:
string): string; platform; $[SysUtils.pas
功能 返回當(dāng)前系統(tǒng)指定參數(shù)的字符串值
說明 GetLocaleStr(GetThreadLocale, LOCALE_SLANGUAGE, ‘‘) = ‘中文(中國)‘
參考 function Windows.GetLocaleInfo
例子 Edit1.Text := GetLocaleStr(GetThreadLocale, SpinEdit1.Value, ‘<NULL>‘);
━━━━━━━━━━━━━━━━━━━━━
首部 function GetLocaleChar(Locale, LocaleType: Integer; Default: Char):
Char; platform; $[SysUtils.pas
功能 返回當(dāng)前系統(tǒng)指定參數(shù)的字符值
說明 GetLocaleChar(GetThreadLocale, LOCALE_STHOUSAND, #0) = ‘,‘
參考 function Windows.GetLocaleInfo
例子 Edit1.Text := GetLocaleChar(GetThreadLocale, LOCALE_SLANGUAGE, #0);
━━━━━━━━━━━━━━━━━━━━━
首部 function ByteType(const S: string; Index: Integer): TMbcsByteType;
$[SysUtils.pas
功能 返回字符串S位置Index上的字符在MBCS中類型
說明 多字節(jié)字符系統(tǒng):Multi-Byte Character System (MBCS)
參考 var SysUtils.SysLocale
例子 SpinEdit1.Value := Ord(ByteType(Edit1.Text, SpinEdit2.Value));
━━━━━━━━━━━━━━━━━━━━━
首部 function StrByteType(Str: PChar; Index: Cardinal): TMbcsByteType;
$[SysUtils.pas
功能 返回指針字符串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;
$[SysUtils.pas
功能 返回字符串S中有多少個(gè)多字節(jié)字符
說明 MaxLen指定處理字符個(gè)數(shù)
參考 function SysUtils.ByteToCharIndex
例子 SpinEdit1.Value := ByteToCharLen(Edit1.Text, SpinEdit2.Value);
━━━━━━━━━━━━━━━━━━━━━
首部 function CharToByteLen(const S: string; MaxLen: Integer): Integer;
$[SysUtils.pas
功能 返回字符串S中有多少個(gè)字符
說明 MaxLen指定處理多字節(jié)字符個(gè)數(shù)
參考 var SysUtils.SysLocale
例子 SpinEdit1.Value := CharToByteLen(Edit1.Text, SpinEdit2.Value);
━━━━━━━━━━━━━━━━━━━━━
首部 function ByteToCharIndex(const S: string; Index: Integer): Integer;
$[SysUtils.pas
功能 返回字符位置對應(yīng)的多字節(jié)字符位置
說明 ByteToCharIndex(‘你好‘, 2) = 1;ByteToCharIndex(‘你好‘, 3) = 2
參考 function SysUtils.NextCharIndex
例子 SpinEdit1.Value := ByteToCharIndex(Edit1.Text, SpinEdit2.Value);
━━━━━━━━━━━━━━━━━━━━━
首部 function CharToByteIndex(const S: string; Index: Integer): Integer;
$[SysUtils.pas
功能 返回多字節(jié)字符位置對應(yīng)的字符起始位置
說明 CharToByteIndex(‘你好‘, 1) = 1;CharToByteIndex(‘你好‘, 2) = 3
參考 function System.Length
例子 SpinEdit1.Value := CharToByteIndex(Edit1.Text, SpinEdit2.Value);
━━━━━━━━━━━━━━━━━━━━━
首部 function StrCharLength(const Str: PChar): Integer; $[SysUtils.pas
功能 返回第一個(gè)字符的寬度
說明 參數(shù)為空則返回0
參考 function Windows.CharNext
例子 SpinEdit1.Value := StrCharLength(PChar(Edit1.Text));
━━━━━━━━━━━━━━━━━━━━━
首部 function StrNextChar(const Str: PChar): PChar; $[SysUtils.pas
功能 返回字符指針Str的下一個(gè)字符指針
說明 StrNextChar(‘1234‘) = ‘234‘;
參考 function Windows.CharNext
例子 Edit2.Text := StrNextChar(PChar(Edit1.Text));
━━━━━━━━━━━━━━━━━━━━━
首部 function CharLength(const S: String; Index: Integer): Integer;
$[SysUtils.pas
功能 返回字符串中指定位置的字符寬度
說明 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;
$[SysUtils.pas
功能 返回下一個(gè)字符的位置
說明 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;
$[SysUtils.pas
功能 返回字符串S中指定位置Index上是否是一個(gè)路徑分隔符
說明 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; $[SysUtils.pas
功能 返回字符串S中指定位置Index上是否是一個(gè)分隔符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;
$[SysUtils.pas
功能 返回包括最后路徑分隔符
說明 最后一個(gè)字符是路徑分隔符則不變;否則加上一個(gè)路徑分隔符返回
參考 function SysUtils.IsPathDelimiter;function System.Length
例子 Edit1.Text := IncludeTrailingPathDelimiter(Edit2.Text);
━━━━━━━━━━━━━━━━━━━━━
首部 function IncludeTrailingBackslash(const S: string): string; platform;
$[SysUtils.pas
功能 返回包括最后斜線
說明 Result := IncludeTrailingPathDelimiter(S);
參考 function SysUtils.IncludeTrailingPathDelimiter
例子 Edit1.Text := IncludeTrailingBackslash(Edit2.Text);
━━━━━━━━━━━━━━━━━━━━━
首部 function ExcludeTrailingPathDelimiter(const S: string): string;
$[SysUtils.pas
功能 返回排除最后路徑分隔符
說明 最后一個(gè)字符不是路徑分隔符則不變;否則減去最后的路徑分隔符返回
參考 function SysUtils.IsPathDelimiter;function System.Length;function
System.SetLength
例子 Edit1.Text := ExcludeTrailingPathDelimiter(Edit2.Text);
━━━━━━━━━━━━━━━━━━━━━
首部 function ExcludeTrailingBackslash(const S: string): string; platform;
$[SysUtils.pas
功能 返回排除最后斜線
說明 Result := ExcludeTrailingPathDelimiter(S)
參考 function SysUtils.ExcludeTrailingPathDelimiter
例子 Edit1.Text := ExcludeTrailingBackslash(Edit2.Text);
━━━━━━━━━━━━━━━━━━━━━
首部 function LastDelimiter(const Delimiters, S: string): Integer;
$[SysUtils.pas
功能 返回最后一個(gè)分隔符的位置
說明 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;
$[SysUtils.pas
功能 返回比較兩個(gè)文件名
說明 當(dāng)S1>S2返回值>0;當(dāng)S1<S2返回值<0;當(dāng)S1=S2返回值=0;區(qū)分大小寫
參考 function SysUtils.AnsiCompareStr
例子 SpinEdit1.Value := AnsiCompareFileName(Edit1.Text, Edit2.Text);
━━━━━━━━━━━━━━━━━━━━━
首部 function SameFileName(const S1, S2: string): Boolean; $[SysUtils.pas
功能 返回兩個(gè)文件名是否相等
說明 區(qū)分大小寫
參考 function SysUtils.AnsiCompareFileName
例子 CheckBox1.Checked := SameFileName(Edit1.Text, Edit2.Text);
━━━━━━━━━━━━━━━━━━━━━
首部 function AnsiLowerCaseFileName(const S: string): string; $[SysUtils.pas
功能 返回小寫文件名
說明 在非多字節(jié)字符系統(tǒng)上相當(dāng)于AnsiLowerCase
參考 function SysUtils.AnsiLowerCase
例子 Edit2.Text := AnsiLowerCaseFileName(Edit1.Text);
━━━━━━━━━━━━━━━━━━━━━
首部 function AnsiUpperCaseFileName(const S: string): string; $[SysUtils.pas
功能 返回大寫文件名
說明 在非多字節(jié)字符系統(tǒng)上相當(dāng)于AnsiUpperCase
參考 function SysUtils.AnsiUpperCase
例子 Edit2.Text := AnsiUpperCaseFileName(Edit1.Text);
━━━━━━━━━━━━━━━━━━━━━
首部 function AnsiPos(const Substr, S: string): Integer; $[SysUtils.pas
功能 返回子串Substr在字符中第一次出現(xiàn)的位置
說明 不存在則返回0
參考 SysUtils.AnsiStrPos
例子 SpinEdit1.Value := AnsiPos(Edit1.Text, Edit2.Text);
━━━━━━━━━━━━━━━━━━━━━
首部 function AnsiStrPos(Str, SubStr: PChar): PChar; $[SysUtils.pas
功能 返回指針子串Substr在指針字符中第一次出現(xiàn)的指針位置
說明 不存在則返回nil
參考 function SysUtils.StrByteType
例子 Edit3.Text := AnsiStrPos(PChar(Edit1.Text), PChar(Edit2.Text));
━━━━━━━━━━━━━━━━━━━━━
首部 function AnsiStrRScan(Str: PChar; Chr: Char): PChar; $[SysUtils.pas
功能 返回在指針字符串Str搜索字符Chr最后一個(gè)出現(xiàn)的地址
說明 支持多字節(jié)字符系統(tǒng);AnsiStrRScan(‘kingron.myetang.com‘, ‘.‘) = ‘.com‘
參考 function SysUtils.AnsiStrScan
例子 Edit2.Text := AnsiStrScan(PChar(Edit1.Text), ‘.‘);
━━━━━━━━━━━━━━━━━━━━━
首部 function AnsiStrScan(Str: PChar; Chr: Char): PChar; $[SysUtils.pas
功能 返回在指針字符串Str搜索字符Chr第一個(gè)出現(xiàn)的地址
說明 支持多字節(jié)字符系統(tǒng);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; $[SysUtils.pas
功能 返回替換后的字符串
說明 rfReplaceAll為替換全部內(nèi)容;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 StringToGUID(const S: string): TGUID; $[SysUtils.pas
功能 返回字符串S轉(zhuǎn)換成全局標(biāo)識(shí)
說明 如果字符串非法將觸發(fā)異常
參考 fuction Windows.Succeeded
例子 Edit2.Text := GUIDToString(StringToGUID(Edit1.Text));
━━━━━━━━━━━━━━━━━━━━━
首部 function GUIDToString(const GUID: TGUID): string; $[SysUtils.pas
功能 返回全局標(biāo)識(shí)GUID轉(zhuǎn)換成字符串
說明 <NULL>
參考 fuction Windows.Succeeded
例子 Edit2.Text := GUIDToString(StringToGUID(Edit1.Text));
━━━━━━━━━━━━━━━━━━━━━
Delphi函數(shù)手冊
abort 函數(shù) 引起放棄的意外處理
abs 函數(shù) 絕對值函數(shù)
addexitproc 函數(shù) 將一過程添加到運(yùn)行時(shí)庫的結(jié)束過程表中
addr 函數(shù) 返回指定對象的地址
adjustlinebreaks 函數(shù) 將給定字符串的行分隔符調(diào)整為cr/lf序列
align 屬性 使控件位于窗口某部分
alignment 屬性 控件標(biāo)簽的文字位置
allocmem 函數(shù) 在堆棧上分配給定大小的塊
allowgrayed 屬性 允許一個(gè)灰度選擇
ansicomparestr 函數(shù) 比較字符串(區(qū)分大小寫)
ansicomparetext 函數(shù) 比較字符串(不區(qū)分大小寫)
ansilowercase 函數(shù) 將字符轉(zhuǎn)換為小寫
ansiuppercase 函數(shù) 將字符轉(zhuǎn)換為大寫
append 函數(shù) 以附加的方式打開已有的文件
arctan 函數(shù) 余切函數(shù)
assignfile 函數(shù) 給文件變量賦一外部文件名
assigned 函數(shù) 測試函數(shù)或過程變量是否為空
autosize 屬性 自動(dòng)控制標(biāo)簽的大小
backgrounddi2001.jpg 屬性 背景色
beginthread 函數(shù) 以適當(dāng)?shù)姆绞浇⒂糜趦?nèi)存管理的線程
bevelinner 屬性 控件方框的內(nèi)框方式
bevelouter 屬性 控件方框的外框方式
bevelwidth 屬性 控件方框的外框?qū)挾?
blockread 函數(shù) 讀一個(gè)或多個(gè)記錄到變量中
blockwrite 函數(shù) 從變量中寫一個(gè)或多個(gè)記錄
borderstyle 屬性 邊界類型
borderwidth 屬性 邊界寬度
break 命令 終止for、while、repeat循環(huán)語句
brush 屬性 畫刷
caption 屬性 標(biāo)簽文字的內(nèi)容
changefileext 函數(shù) 改變文件的后綴
chdir 函數(shù) 改變當(dāng)前目錄
checked 屬性 確定復(fù)選框選中狀態(tài)
chr 函數(shù) 返回指定序數(shù)的字符
closefile 命令 關(guān)閉打開的文件
color 屬性 標(biāo)簽的顏色
columns 屬性 顯示的列數(shù)
comparestr 函數(shù) 比較字符串(區(qū)分大小寫)
concat 函數(shù) 合并字符串
continue 命令 繼續(xù)for、while、repeat的下一個(gè)循環(huán)
copy 函數(shù) 返回一字符串的子串
cos 函數(shù) 余弦函數(shù)
ctl3d 屬性 是否具有3d效果
cursor 屬性 鼠標(biāo)指針移入后的形狀
date 函數(shù) 返回當(dāng)前的日期
datetimetofiledate 函數(shù) 將delphi的日期格式轉(zhuǎn)換為dos的日期格式
datetimetostr 函數(shù) 將日期時(shí)間格式轉(zhuǎn)換為字符串
datetimetostring 函數(shù) 將日期時(shí)間格式轉(zhuǎn)換為字符串
datetostr 函數(shù) 將日期格式轉(zhuǎn)換為字符串
dayofweek 函數(shù) 返回星期的數(shù)值
dec 函數(shù) 遞減變量值
decodedate 函數(shù) 將日期格式分解為年月日
decodetime 函數(shù) 將時(shí)間格式分解為時(shí)、分、秒、毫秒
delete 函數(shù) 從字符串中刪除子串
deletefile 命令 刪除文件
diskfree 函數(shù) 返回剩余磁盤空間的大小
disksize 函數(shù) 返回指定磁盤的容量
dispose 函數(shù) 釋放動(dòng)態(tài)變量所占的空間
disposestr 函數(shù) 釋放字符串在堆棧中的內(nèi)存空間
ditherbackgrounddi2001.jpg?使背景色的色彩加重或減少50%
dragcursor 屬性 當(dāng)鼠標(biāo)按下時(shí)光標(biāo)的形狀
dragmode 屬性 按動(dòng)的作用方式
dropdowncount 屬性 容許的顯示數(shù)據(jù)項(xiàng)的數(shù)目
editmask 屬性 編輯模式
enabled 屬性 是否使標(biāo)簽呈現(xiàn)打開狀態(tài)
encodedate 函數(shù) 將年月日合成為日期格式
encodetime 函數(shù) 將時(shí)、分、秒、毫秒合成為時(shí)間格式
endmargin 屬性 末尾邊緣
eof 函數(shù) 對有類型或無類型文件測試是否到文件尾
eoln 函數(shù) 返回文本文件的行結(jié)束狀態(tài)
erase 命令 刪除外部文件
exceptaddr 函數(shù) 返回引起當(dāng)前意外的地址
exclude 函數(shù) 從集合中刪除一些元素
exceptobject 函數(shù) 返回當(dāng)前意外的索引
exit 命令 立即從當(dāng)前的語句塊中退出
exp 函數(shù) 指數(shù)函數(shù)
expandfilename 函數(shù) 返回包含絕對路徑的字符串
extendedselect 屬性 是否允許存在選擇模式,true時(shí),multiselect才有意義
extractfiledir 函數(shù) 返回驅(qū)動(dòng)器和路徑
extractfileext 函數(shù) 返回文件的后綴
extractfilename 函數(shù) 返回文件名
extractfilepath 函數(shù) 返回指定文件的路徑
fileage 函數(shù) 返回文件已存在的時(shí)間
fileclose 命令 關(guān)閉指定的文件
filecreate 命令 用指定的文件名建立新文件
filedatetodatetime 函數(shù) 將dos的日期格式轉(zhuǎn)換為delphi的日期格式
fileexists 函數(shù) 檢查文件是否存在
filegatattr 函數(shù) 返回文件的屬性
filegetdate 函數(shù) 返回文件的dos日期時(shí)間標(biāo)記
fileopen 命令 用指定的存取模式打開指定的文件
filepos 函數(shù) 返回文件的當(dāng)前指針位置
fileread 命令 從指定的文件讀取
filesearch 命令 在目錄中搜索指定的文件
fileseek 函數(shù) 改變文件的指針
filesetattr 函數(shù) 設(shè)置文件屬性
filesetdate 函數(shù) 設(shè)置文件的dos日期時(shí)間標(biāo)記
filesize 函數(shù) 返回當(dāng)前文件的大小
filewrite 函數(shù) 對指定的文件做寫操作
fillchar 函數(shù) 用指定的值填充連續(xù)字節(jié)的數(shù)
findclose 命令 終止findfirst/findnext序列
findfirst 命令 對指定的文件名及屬性搜索目錄
findnext 命令 返回與文件名及屬性匹配的下一入口
floattodecimal 函數(shù) 將浮點(diǎn)數(shù)轉(zhuǎn)換為十進(jìn)制數(shù)
floattostrf 函數(shù) 將浮點(diǎn)數(shù)轉(zhuǎn)換為字符串
floattostr 函數(shù) 將浮點(diǎn)數(shù)轉(zhuǎn)換為字符串
floattotext 函數(shù) 將給定的浮點(diǎn)數(shù)轉(zhuǎn)換為十進(jìn)制數(shù)
floattotextfmt 函數(shù) 將給定的浮點(diǎn)數(shù)轉(zhuǎn)換為十進(jìn)制數(shù)
flush 函數(shù) 將緩沖區(qū)的內(nèi)容刷新到輸出的文本文件中
fmtloadstr 函數(shù) 從程序的資源字符串表中裝載字符串
fmtstr 函數(shù) 格式化一系列的參數(shù),其結(jié)果以參數(shù)result返回
font 屬性 設(shè)置字體
format 函數(shù) 格式化一系列的參數(shù)并返回pascal字符串
formatbuf 函數(shù) 格式化一系列的參數(shù)
formatdatetime 函數(shù) 用指定的格式來格式化日期和時(shí)間
formatfloat 函數(shù) 指定浮點(diǎn)數(shù)格式
frac 函數(shù) 返回參數(shù)的小數(shù)部分
freemem 函數(shù) 按給定大小釋放動(dòng)態(tài)變量所占的空間
getdir 返回指定驅(qū)動(dòng)器的當(dāng)前目錄
getheapstatus 返回內(nèi)存管理器的當(dāng)前狀態(tài)
getmem 建立一指定大小的動(dòng)態(tài)變量,并將指針指向該處
getmemorymanager 返回內(nèi)存管理器的入口點(diǎn)
glyph 函數(shù) 按鈕上的圖象
halt 停止程序的執(zhí)行并返回到操作系統(tǒng)
hi 返回參數(shù)的高地址位
high 返回參數(shù)的上限值
hint 屬性 提示信息
int 返回參數(shù)的整數(shù)部分
include 添加元素到集合中
insert 在字符串中插入子串
inttohex 將整型數(shù)轉(zhuǎn)換為十六進(jìn)制數(shù)
inttostr 將整型數(shù)轉(zhuǎn)換為字符串
ioresult 返回最新的i/o操作完成狀態(tài)
isvalidident 測試字符串是否為有效的標(biāo)識(shí)符
items 屬性 默認(rèn)顯示的節(jié)點(diǎn)
kind 屬性 擺放樣式
largechange 屬性 最大改變值
layout 屬性 圖象布局
length 函數(shù) 返回字符串的動(dòng)態(tài)長度
lines 屬性 缺省顯示內(nèi)容
ln 函數(shù) 自然對數(shù)函數(shù)
lo 函數(shù) 返回參數(shù)的低地址位
loadstr 函數(shù) 從應(yīng)用程序的可執(zhí)行文件中裝載字符資源
lowercase 函數(shù) 將給定的字符串變?yōu)樾?
low 函數(shù) 返回參數(shù)的下限值
max 屬性 最大值
maxlength 屬性 最大長度
min 屬性 最小值
mkdir 命令 建立一子目錄
move 函數(shù) 從源到目標(biāo)復(fù)制字節(jié)
multiselect 屬性 允許同時(shí)選擇幾個(gè)數(shù)據(jù)項(xiàng)
name 屬性 控件的名字
new 函數(shù) 建立新的動(dòng)態(tài)變量并設(shè)置一指針變量指向他
newstr 函數(shù) 在堆棧上分配新的字符串
now 函數(shù) 返回當(dāng)前的日期和時(shí)間
odd 測試參數(shù)是否為奇數(shù)
onactivate 事件 焦點(diǎn)移到窗體上時(shí)觸發(fā)
onclick 事件 單擊窗體空白區(qū)域觸發(fā)
ondblclick 事件 雙擊窗體空白區(qū)域觸發(fā)
onclosequery 事件 使用者試圖關(guān)閉窗體觸發(fā)
onclose 事件 窗體關(guān)閉后才觸發(fā)
oncreate 事件 窗體第一次創(chuàng)建時(shí)觸發(fā)
ondeactivate 事件 用戶切換到另一應(yīng)用程序觸發(fā)
ondragdrop 事件 鼠標(biāo)拖放操作結(jié)束時(shí)觸發(fā)
ondragover 事件 有其他控件從他上面移過觸發(fā)
onmousedown 事件 按下鼠標(biāo)鍵時(shí)觸發(fā)
onmouseup 事件 釋放鼠標(biāo)鍵時(shí)觸發(fā)
onmousemove 事件 移動(dòng)鼠標(biāo)時(shí)觸發(fā)
onhide 事件 隱藏窗體時(shí)觸發(fā)
onkeydown 事件 按下鍵盤某鍵時(shí)觸發(fā)
onkeypress 事件 按下鍵盤上的單個(gè)字符鍵時(shí)觸發(fā)
onkeyup 事件 釋放鍵盤上的某鍵時(shí)觸發(fā)
onpaint 事件 窗體上有新部分暴露出來觸發(fā)
onresize 事件 重新調(diào)整窗體大小觸發(fā)
onshow 事件 在窗體實(shí)際顯示之前瞬間觸發(fā)
ord 返回序數(shù)類的序數(shù)
outlinestyle 屬性 類型
outofmemoryerror 引起outofmemory意外
pageindex 屬性 頁索引
pages 屬性 頁
paramcount 函數(shù) 返回在命令行上傳遞給程序的參數(shù)數(shù)量
paramstr 函數(shù) 返回指定的命令行參數(shù)
pen 屬性 畫刷設(shè)置
pi 函數(shù) 返回圓周率pi
picture 屬性 顯示圖象
pictureclosed 屬性 設(shè)置closed位圖
pictureleaf 屬性 設(shè)置leaf位圖
pictureminus 屬性 設(shè)置minus位圖
pictureopen 屬性 設(shè)置open位圖
pictureplus 屬性 設(shè)置plus位圖
pos 函數(shù) 在字符串中搜索子串
pred 函數(shù) 返回先前的參數(shù)
random 函數(shù) 返回一隨機(jī)函數(shù)
randomize 函數(shù) 用一隨機(jī)數(shù)初始化內(nèi)置的隨機(jī)數(shù)生成器
read 函數(shù) 對有格式的文件,讀一文件組件到變量中;
對文本文件,讀一個(gè)或多個(gè)值到一個(gè)或多個(gè)變量中
readln 函數(shù) 執(zhí)行read過程,然后跳到文件下一行
readonly 屬性 只讀屬性
reallocmem 函數(shù) 分配一動(dòng)態(tài)變量
rename 函數(shù) 重命名外部文件
renamefile 函數(shù) 對文件重命名
reset 函數(shù) 打開已有的文件
rewrite 函數(shù) 建立并打開一新的文件
rmdir 函數(shù) 刪除空的子目錄
round 函數(shù) 將實(shí)數(shù)值舍入為整型值
runerror 函數(shù) 停止程序的執(zhí)行
scrollbars 屬性 滾動(dòng)條狀態(tài)
seek 函數(shù) 將文件的當(dāng)前指針移動(dòng)到指定的組件上
seekeof 函數(shù) 返回文件的文件結(jié)束狀態(tài)
seekeoln 函數(shù) 返回文件的行結(jié)束狀態(tài)
selectedcolor 屬性 選中顏色
setmemorymanager 函數(shù) 設(shè)置內(nèi)存管理器的入口點(diǎn)
settextbuf 函數(shù) 給文本文件指定i/o緩沖區(qū)
shape 屬性 顯示的形狀
showexception 函數(shù) 顯示意外消息與地址
sin 函數(shù) 正弦函數(shù)
sizeof 函數(shù) 返回參數(shù)所占的字節(jié)數(shù)
smallchange 屬性 最小改變值
sorted 屬性 是否允許排序
sqr 函數(shù) 平方函數(shù)
sqrt 函數(shù) 平方根函數(shù)
startmargin 屬性 開始邊緣
state 屬性 控件當(dāng)前狀態(tài)
str 函數(shù) 將數(shù)值轉(zhuǎn)換為字符串
stralloc 函數(shù) 給以null結(jié)束的字符串分配最大長度-1的緩沖區(qū)
strbufsize 函數(shù) 返回存儲(chǔ)在由stralloc分配的字符緩沖區(qū)的最大字符數(shù)
strcat 函數(shù) 將一字符串附加到另一字符串尾并返回合并的字符串
strcomp 函數(shù) 比較兩個(gè)字符串
strcopy 函數(shù) 將一個(gè)字符串復(fù)制到另一個(gè)字符串中
strdispose 函數(shù) 釋放堆棧上的字符串
strecopy 函數(shù) 將一字符串復(fù)制到另一個(gè)字符串并返回結(jié)果字符串尾部的指針
strend 函數(shù) 返回指向字符串尾部的指針
stretch 屬性 自動(dòng)適應(yīng)控件的大小
strfmt 函數(shù) 格式化一系列的參數(shù)
stricomp 函數(shù) 比較兩個(gè)字符串(不區(qū)分大小寫)
stringtowidechar 函數(shù) 將ansi字符串轉(zhuǎn)換為unicode字符串
strlcat 函數(shù) 將一字符串中的字符附加到另一字符串尾并返回合并的字符串
strlcomp 函數(shù) 以最大長度比較兩個(gè)字符串
strlcopy 函數(shù) 將一個(gè)字符串中的字符復(fù)制到另一個(gè)字符串中
strlen 函數(shù) 返回字符串中的字符數(shù)
strlfmt 函數(shù) 格式化一系列的參數(shù),其結(jié)果中包含有指向目標(biāo)緩沖區(qū)的指針
strlicomp 函數(shù) 以最大長度比較兩個(gè)字符串(不區(qū)分大小寫)
strlower 函數(shù) 將字符串中的字符轉(zhuǎn)換為小寫
strmove 函數(shù) 將一個(gè)字符串中的字符復(fù)制到另一個(gè)字符串中
strnew 函數(shù) 在堆棧上分配一個(gè)字符串
strpas 函數(shù) 將以null結(jié)束的字符串轉(zhuǎn)換為pascal類的字符串
strpcopy 函數(shù) 將pascal類的字符串復(fù)制為以null結(jié)束的字符串
strplcopy 函數(shù) 從pascal類的最大長度字符串復(fù)制為以null結(jié)束的字符串
strpos 函數(shù) 返回一個(gè)字符串在另一個(gè)字符串中首次出現(xiàn)指針
strrscan 函數(shù) 返回字符串中最后出現(xiàn)字符的指針
strscan 函數(shù) 返回字符串中出現(xiàn)首字符的指針
strtodate 函數(shù) 將字符串轉(zhuǎn)換為日期格式
strtodatetime 函數(shù) 將字符串轉(zhuǎn)換為日期/時(shí)間格式
strtofloat 函數(shù) 將給定的字符串轉(zhuǎn)換為浮點(diǎn)數(shù)
strtoint 函數(shù) 將字符串轉(zhuǎn)換為整型
strtointdef 函數(shù) 將字符串轉(zhuǎn)換為整型或默認(rèn)值
strtotime 函數(shù) 將字符串轉(zhuǎn)換為時(shí)間格式
strupper 函數(shù) 將字符串中的字符轉(zhuǎn)換為大寫
style 屬性 類型選擇
suce 函數(shù) 返回后繼的參數(shù)
swap 函數(shù) 交換參數(shù)的高低地址位
tabs 屬性 標(biāo)記每一項(xiàng)的內(nèi)容
tabindex 屬性 標(biāo)記索引
text 屬性 顯示的文本
texttofloat 函數(shù) 將字符串(以null結(jié)束的格式)轉(zhuǎn)換為浮點(diǎn)數(shù)
time 函數(shù) 返回當(dāng)前的時(shí)間
timetostr 函數(shù) 將時(shí)間格式轉(zhuǎn)換為字符串
trim 函數(shù) 從給定的字符串中刪除前導(dǎo)和尾部的空格及控制字符
trimleft 函數(shù) 從給定的字符串中刪除首部的空格及控制字符
trimright 函數(shù) 從給定的字符串中刪除尾部的空格及控制字符
trunc 函數(shù) 將實(shí)型值截取為整型值
truncate 函數(shù) 截去當(dāng)前文件位置后的內(nèi)容
unselectedcolor 屬性 未選中顏色
upcase 將字符轉(zhuǎn)換為大寫
uppercase 將給定的字符串變?yōu)榇髮?
val 函數(shù) 將字符串轉(zhuǎn)換為整型值
vararraycreate 函數(shù) 以給定的界限和維數(shù)建立變體數(shù)組
vararraydimcount 函數(shù) 返回給定變體的維數(shù)
vararrayhighbound 函數(shù) 返回給定變體數(shù)組維數(shù)的上界
vararraylock 函數(shù) 鎖定給定的變體數(shù)組
vararraylowbound 函數(shù) 返回給定變體數(shù)組維數(shù)的下界
vararrayof 函數(shù) 返回指定變體的數(shù)組元素
vararrayredim 函數(shù) 通過改變上限來調(diào)整變體的大小
vararrayunlock 函數(shù) 解鎖指定的變體數(shù)組
varastype 函數(shù) 將變體轉(zhuǎn)換為指定的類型
varcase 函數(shù) 將變體轉(zhuǎn)換為指定的類型并保存他
varclear 函數(shù) 清除指定的變體
varcopy 函數(shù) 將指定的變體復(fù)制為指定的變體
varformdatetime 函數(shù) 返回包含日期時(shí)間的變體
varisarray 函數(shù) 測試變體是否為數(shù)組
varisempty 函數(shù) 測試變體是否為unassigned
varisnull 函數(shù) 測試變體是否為null
vartodatetime 函數(shù) 將給定的變體轉(zhuǎn)換為日期時(shí)間
vartype 函數(shù) 將變體轉(zhuǎn)換為指定的類型并保存他
visible 屬性 控件的可見性
wantreturns 屬性 為true時(shí),按回車鍵產(chǎn)生一個(gè)回車符;
為false時(shí),按下ctrl+enter才產(chǎn)生回車符
write 命令 對有格式的文件,寫一變量到文件組件中;
對文本文件,寫一個(gè)或多個(gè)值到文件中
writeln 命令 執(zhí)行write過程,然后輸出一行結(jié)束標(biāo)志
widecharlentostring 函數(shù) 將ansi字符串轉(zhuǎn)換為unicode字符串
widecharlentostrwar 函數(shù) 將unicode字符串轉(zhuǎn)換為ansi字符串變量
widechartostring 函數(shù) 將unicode字符串轉(zhuǎn)換為ansi字符串
widechartostrvar 函數(shù) 將unicode字符串轉(zhuǎn)換為ansi字符串變量