Delphi carefully collected function

Author:Anonymous    Updated:2008-2-26 21:58:44
Delphi6 function Encyclopaedia (1)
<>

First function AnsiResemblesText (const AText, AOther: string): Boolean; $ [StrUtils.pas
Function similar to the return of the two strings
The ANSI (American National Standards Institute) American National Standards Institute; not case-sensitive
Reference function StrUtils.SoundexProc; var StrUtils.AnsiResemblesProc
CheckBox1.Checked example: = AnsiResemblesText (Edit1.Text, Edit2.Text);
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
First function AnsiContainsText (const AText, ASubText: string): Boolean; $ [StrUtils.pas
AText functions return a string of whether the string ASubText
That does not distinguish between upper and lower case
Reference function StrUtils.AnsiUppercase; function StrUtils.AnsiPos
CheckBox1.Checked example: = AnsiContainsText (Edit1.Text, Edit2.Text);
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
First function AnsiStartsText (const ASubText, AText: string): Boolean; $ [StrUtils.pas
AText functions return string whether substring beginning ASubText
That does not distinguish between upper and lower case
Reference function Windows.CompareString
CheckBox1.Checked example: = AnsiStartsText (Edit1.Text, Edit2.Text);
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
First function AnsiEndsText (const ASubText, AText: string): Boolean; $ [StrUtils.pas
AText functions return a string of whether to end string ASubText
That does not distinguish between upper and lower case
Reference function Windows.CompareString
CheckBox1.Checked example: = AnsiEndsText (Edit1.Text, Edit2.Text);
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
First function AnsiReplaceText (const AText, AFromText, AToText: string): string; $ [StrUtils.pas
AText used functions return string substring AFromText replaced by the results-string AToText
That does not distinguish between upper and lower case
Reference function SysUtils.StringReplace; type SysUtils.TReplaceFlags
Edit4.Text example: = AnsiReplaceText (Edit1.Text, Edit2.Text, Edit3.Text);
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
First function AnsiMatchText (const AText: string; const AValues: array of string): Boolean; $ [StrUtils.pas
AValues functions return string array included in the string AText
That does not distinguish between upper and lower case
Reference function StrUtils.AnsiIndexText
CheckBox1.Checked example: = AnsiMatchText (Edit1.Text, [ 'a1', 'a2', 'a3', 'a4']);
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
First function AnsiIndexText (const AText: string; const AValues: array of string): Integer; $ [StrUtils.pas
AText string functions return a string in the position of the array AValues
That is not case-sensitive; if it does not include the return -1
Reference function SysUtils.AnsiSameText
SpinEdit1.Value example: = AnsiIndexText (Edit1.Text, [ 'a1', 'a2', 'a3', 'a4']);
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
First function AnsiContainsStr (const AText, ASubText: string): Boolean; $ [StrUtils.pas
AText functions return a string of whether the string ASubText
That distinction case
Reference function StrUtils.AnsiPos
CheckBox1.Checked example: = AnsiContainsStr (Edit1.Text, Edit2.Text);
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
First function AnsiStartsStr (const ASubText, AText: string): Boolean; $ [StrUtils.pas
AText functions return string whether substring beginning ASubText
That distinction case
Reference function SysUtils.AnsiSameStr
CheckBox1.Checked example: = AnsiStartsStr (Edit1.Text, Edit2.Text);
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
First function AnsiEndsStr (const ASubText, AText: string): Boolean; $ [StrUtils.pas
AText functions return a string of whether to end string ASubText
That distinction case
Reference function SysUtils.AnsiSameStr
CheckBox1.Checked example: = AnsiEndsStr (Edit1.Text, Edit2.Text);
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
First function AnsiReplaceStr (const AText, AFromText, AToText: string): string; $ [StrUtils.pas
AText used functions return string substring AFromText replaced by the results-string AToText
That distinction case
Reference function SysUtils.StringReplace; type SysUtils.TReplaceFlags
Edit4.Text example: = AnsiReplaceStr (Edit1.Text, Edit2.Text, Edit3.Text);
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
First function AnsiMatchStr (const AText: string; const AValues: array of string): Boolean; $ [StrUtils.pas
AValues functions return string array included in the string AText
That distinction case
Reference function StrUtils.AnsiIndexStr
CheckBox1.Checked example: = AnsiMatchStr (Edit1.Text, [ 'a1', 'a2', 'a3', 'a4']);
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
First function AnsiIndexStr (const AText: string; const AValues: array of string): Integer; $ [StrUtils.pas
AText string functions return a string in the position of the array AValues
That distinction case
Reference function SysUtils.AnsiSameStr
SpinEdit1.Value example: = AnsiIndexStr (Edit1.Text, [ 'a1', 'a2', 'a3', 'a4']);
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
First function DupeString (const AText: string; ACount: Integer): string; $ [StrUtils.pas
AText string functions return a copy of the ACount
That when ACount return for the 0:00''
Reference function System.SetLength
Edit3.Text example: = DupeString (Edit1.Text, SpinEdit1.Value);
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
First function ReverseString (const AText: string): string; $ [StrUtils.pas
AText functions return a string of anti-sequence
Note ReverseString ('1234 ') ='4321'
Reference function System.SetLength
Edit3.Text example: = ReverseString (Edit1.Text);
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
First function StuffString (const AText: string; AStart, ALength: Cardinal; const ASubText: string): string; $ [StrUtils.pas
Nested functions return string
AStart Note: nested start position; ALength: nested length; StuffString ( 'abcd', 2, 0,'12 ') =' a12bcd '
Reference function System.Copy
Edit3.Text example: = StuffString (Edit1.Text, SpinEdit1.Value, SpinEdit2.Value, Edit2.Text);
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
First function RandomFrom (const AValues: array of string): string; overload; $ [StrUtils.pas
Random functions return a string in an array elements AValues
Before the implementation of the recommendations Randomize
Reference function System.Random
Examples Randomize; Edit3.Text: = RandomFrom ([ 'a1', 'a2', 'a3', 'a4']);
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
First function IfThen (AValue: Boolean; const ATrue: string; AFalse: string =''): string; overload; $ [StrUtils.pas
Return to the logic of functions specified string
Note IfThen (True, the 'yes',' no ') =' '; IfThen (False,' yes', 'no') = 'no'
Reference
Edit3.Text example: = IfThen (CheckBox1.Checked, Edit1.Text, Edit2.Text);
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
First function LeftStr (const AText: string; const ACount: Integer): string; $ [StrUtils.pas
AText string function to return to the left of ACount characters
Note LeftStr ('123456 ', 3) ='123'
Reference function System.Copy
Edit3.Text example: = LeftStr (Edit1.Text, SpinEdit1.Value);
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
First function RightStr (const AText: string; const ACount: Integer): string; $ [StrUtils.pas
Function to return to the right of the string AText ACount characters
Note RightStr ('123456 ', 3) ='456'
Reference function System.Copy
Edit3.Text example: = RightStr (Edit1.Text, SpinEdit1.Value);
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
First function MidStr (const AText: string; const AStart, ACount: Integer): string; $ [StrUtils.pas
AText functions return a string from the beginning of AStart ACount characters
Copy is the fact that
Reference function System.Copy
Edit3.Text example: = MidStr (Edit1.Text, SpinEdit1.Value, SpinEdit2.Value);
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
First function SearchBuf (Buf: PChar; BufLen: Integer; SelStart, SelLength: Integer; SearchString: String; Options: TStringSearchOptions = [soDown]): PChar; $ [StrUtils.pas
A search function to return to the first position indicator
Illustrate this function commonly used in the text of the search string
Reference
Examples
/////// 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
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
First function Soundex (const AText: string; ALength: TSoundexLength = 4): string; $ [StrUtils.pas
Back to detect string function
On the basis of detection (Soundex) can be found in the string into; http://www.nara.gov/genealogy/coding.html
Reference
Edit2.Text example: = Soundex (Edit1.Text, SpinEdit1.Value);
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
First function SoundexInt (const AText: string; ALength: TSoundexIntLength = 4): Integer; $ [StrUtils.pas
Back to detect integer function
Note ALength the greater the value of the higher accuracy of decoding
Reference
SpinEdit2.Value example: = SoundexInt (Edit1.Text, SpinEdit1.Value);
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
First function DecodeSoundexInt (AValue: Integer): string; $ [StrUtils.pas
Back to detect functional integral decoders
Note DecodeSoundexInt (SoundexInt ( 'hello')) equivalent Soundex ( 'hello')
Reference
Edit2.Text example: = DecodeSoundexInt (SpinEdit2.Value);
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
First function SoundexWord (const AText: string): Word; $ [StrUtils.pas
[Back to detect numerical functions
That no parameters have been fixed for 4 ALength
Reference
SpinEdit2.Value example: = SoundexWord (Edit1.Text);
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
First function DecodeSoundexWord (AValue: Word): string; $ [StrUtils.pas
Function return values decoding text detection
Note DecodeSoundexWord (SoundexWord ( 'hello')) equivalent Soundex ( 'hello')
Reference
Edit2.Text example: = DecodeSoundexWord (SpinEdit2.Value);
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
First function SoundexSimilar (const AText, AOther: string; ALength: TSoundexLength = 4): Boolean; $ [StrUtils.pas
Two functions return string detection is the same string
Note Result: = Soundex (AText, ALength) = Soundex (AOther, ALength)
Reference
CheckBox1.Checked example: = SoundexSimilar (Edit1.Text, Edit2.Text, SpinEdit1.Value);
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
First function SoundexCompare (const AText, AOther: string; ALength: TSoundexLength = 4): Integer; $ [StrUtils.pas
Comparison of the two functions return string detection string of results
Note Result: = AnsiCompareStr (Soundex (AText, ALength), Soundex (AOther, ALength))
Reference function SysUtils.AnsiCompareStr
SpinEdit2.Value example: = SoundexCompare (Edit1.Text, Edit2.Text, SpinEdit1.Value);
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
First function SoundexProc (const AText, AOther: string): Boolean; $ [StrUtils.pas
SoundexSimilar two function calls to return to the detection string whether the same string
System variables that the default value of AnsiResemblesProc
Reference function StrUtils.AnsiResemblesText
Examples [var AnsiResemblesProc: TCompareTextProc = SoundexProc;]
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━

First function Languages: TLanguages; $ [SysUtils.pas
Object function to return to language system
That through this system function can be the language environment
Reference type SysUtils.TLanguages
Examples
/////// 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
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
First function AllocMem (Size: Cardinal): Pointer; $ [SysUtils.pas
Function returns a specified size of the memory block Size
Note with the release of resources by FreeMem
Reference function System.GetMem
Examples
/////// 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
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
The first procedure AddExitProc (Proc: TProcedure); $ [SysUtils.pas
Add a function of the process of dealing with withdrawal
Justification for the proposed partial replacement with finalization
Reference
Examples
//////// 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
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ KK procedures Station
First function NewStr (const S: string): PString; deprecated; $ [SysUtils.pas
Function returns a new string pointer Address
S is the space-time string return NullStr
Reference procedure System.New
Examples
//////// 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
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
The first procedure DisposeStr (P: PString); deprecated; $ [SysUtils.pas
Freeing resources string pointer P
With the use of the function NewStr
Reference procedure System.Dispose
Examples <See above, the following See>
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
The first procedure AssignStr (var P: PString; const S: string); deprecated; $ [SysUtils.pas
S update function will be to string string pointer P
The value will be updated before the release of a string of resources guide
Reference function SysUtils.NewStr; function SysUtils.DisposeStr
Examples
//////// 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
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
The first procedure AppendStr (var Dest: string; const S: string); deprecated; $ [SysUtils.pas
Dest functions in the string after string additional S
Note equivalent Dest: = Dest + S; Delphi6 has not recommended
Reference
Examples
//////// Begin AppendStr
Procedure TForm1.Button1Click (Sender: TObject);
Var
S: string;
Begin
S: = Edit2.Text;
AppendStr (S, Edit1.Text);
Edit2.Text: = S;
End;
//////// End AppendStr
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ KK procedures Station
First function UpperCase (const S: string): string; $ [SysUtils.pas
S function to return to the capital string form
That does not deal with non-lowercase characters
Reference procedure System.SetLength
Edit2.Text example: = UpperCase (Edit1.Text);
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
First function LowerCase (const S: string): string; $ [SysUtils.pas
S functions return a string of lowercase form
The characters do not deal with non-capital
Reference procedure System.SetLength
Edit2.Text example: = LowerCase (Edit1.Text);
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
First function CompareStr (const S1, S2: string): Integer; $ [SysUtils.pas
Comparison of two characters function return
When the S1> S2 return value> 0; reference when S1
SpinEdit1.Value example: = CompareStr (Edit1.Text, Edit2.Text);
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
First function CompareMem (P1, P2: Pointer; Length: Integer): Boolean; assembler; $ [SysUtils.pas
Comparison of the two memory function returned to the guidelines
Note CompareMem (PChar ('12a '), PChar ('12c'), 2) = True; CompareMem (PChar ('12a '), PChar ('12c'), 3) = False
Reference
CheckBox1.Checked example: = CompareMem (Self, Form1, 8);
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
First function CompareText (const S1, S2: string): Integer; $ [SysUtils.pas
Comparison of the two functions return string
That does not distinguish between upper and lower case
Reference
SpinEdit1.Value example: = CompareText (Edit1.Text, Edit2.Text);
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
First function SameText (const S1, S2: string): Boolean; $ [SysUtils.pas
Back to the functional equivalent of two string
That does not distinguish between upper and lower case
Reference
CheckBox1.Checked example: = SameText (Edit1.Text, Edit2.Text);
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
First function AnsiUpperCase (const S: string): string; $ [SysUtils.pas
S function to return to the capital string form
The ANSI (American National Standards Institute) American National Standards Institute; non-lowercase characters unchanged
Reference function Windows.CharUpperBuff
Edit2.Text example: = AnsiUpperCase (Edit1.Text);
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
First function AnsiLowerCase (const S: string): string; $ [SysUtils.pas
S functions return a string of lowercase form
The characters do not deal with non-capital
Reference function Windows.CharLowerBuff
Edit2.Text example: = AnsiLowerCase (Edit1.Text);
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
First function AnsiCompareStr (const S1, S2: string): Integer; $ [SysUtils.pas
Function to compare two string -
When the S1> S2 return value> 0; When S1 reference function Windows.CompareString
SpinEdit1.Value example: = AnsiCompareStr (Edit1.Text, Edit2.Text);
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
First function AnsiSameStr (const S1, S2: string): Boolean; $ [SysUtils.pas
Back to the functional equivalent of two string
That distinction case
Reference function SysUtils.AnsiCompareStr
CheckBox1.Checked example: = AnsiSameStr (Edit1.Text, Edit2.Text);
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
First function AnsiCompareText (const S1, S2: string): Integer; $ [SysUtils.pas
Function to compare two string -
When the S1> S2 return value> 0; When S1 reference function Windows.CompareString
SpinEdit1.Value example: = AnsiCompareText (Edit1.Text, Edit2.Text);
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
First function AnsiSameText (const S1, S2: string): Boolean; $ [SysUtils.pas
Back to the functional equivalent of two string
That does not distinguish between upper and lower case
Reference function SysUtils.AnsiCompareText
CheckBox1.Checked example: = AnsiSameText (Edit1.Text, Edit2.Text);
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ KK procedures Station
First function AnsiStrComp (S1, S2: PChar): Integer; $ [SysUtils.pas
Comparison of the two functions return string pointer
When the S1> S2 return value> 0; When S1 reference function System.CompareString
SpinEdit1.Value example: = AnsiStrComp (PChar (Edit1.Text), PChar (Edit2.Text))
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
First function AnsiStrIComp (S1, S2: PChar): Integer; $ [SysUtils.pas
Comparison of the two functions return string pointer
When the S1> S2 return value> 0; When S1 reference function Windows.CompareString
SpinEdit1.Value example: = AnsiStrIComp (PChar (Edit1.Text), PChar (Edit2.Text))
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
First function AnsiStrLComp (S1, S2: PChar; MaxLen: Cardinal): Integer; $ [SysUtils.pas
Comparison of the two functions to return to the designated length of the string guide
When the S1> S2 return value> 0; When S1 reference function Windows.CompareString
SpinEdit1.Value example: = AnsiStrLComp (PChar (Edit1.Text), PChar (Edit2.Text), SpinEdit2.Value)
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
First function AnsiStrLIComp (S1, S2: PChar; MaxLen: Cardinal): Integer; $ [SysUtils.pas
Comparison of the two functions to return to the designated length of the string guide
When the S1> S2 return value> 0; When S1 reference function Windows.CompareString
SpinEdit1.Value example: = AnsiStrLIComp (PChar (Edit1.Text), PChar (Edit2.Text), SpinEdit2.Value)
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
First function AnsiStrLower (Str: PChar): PChar; $ [SysUtils.pas
Lowercase string function to return to the form guide
The characters do not deal with non-capital
Reference function Windows.CharLower
Edit2.Text example: = AnsiStrLower (PChar (Edit1.Text));
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
First function AnsiStrUpper (Str: PChar): PChar; $ [SysUtils.pas
Function pointer to return to the form of a string of capital
That does not deal with non-lowercase characters
Reference function Windows.CharUpper
Edit2.Text example: = AnsiStrUpper (PChar (Edit1.Text));
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
First function AnsiLastChar (const S: string): PChar; $ [SysUtils.pas
S function to return to the last string pointer characters
S, indicating that the string is empty string will return null pointer
Reference function SysUtils.ByteType
Edit2.Text example: = AnsiLastChar (Edit1.Text);
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
First function AnsiStrLastChar (P: PChar): PChar; $ [SysUtils.pas
Function pointer to return to the last string pointer P characters
P, indicating that the string pointer for the return of empty air-to-air target
Reference function SysUtils.ByteType
Edit2.Text example: = AnsiLastChar (PChar (Edit1.Text));
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
First function WideUpperCase (const S: WideString): WideString; $ [SysUtils.pas
Function to return to double-paper Mi site   thumb笮onions ask? BR> Note WideChar double-byte characters
Reference function Windows.CharUpperBuffW
Edit2.Text example: = WideUpperCase (Edit1.Text);
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
First function WideLowerCase (const S: WideString): WideString; $ [SysUtils.pas
Function to return to the double-byte string lowercase form
That I do not how to test it out
Reference function Windows.CharLowerBuffW
Edit2.Text example: = WideLowerCase (Edit1.Text);
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
First function WideCompareStr (const S1, S2: WideString): Integer; $ [SysUtils.pas
Comparison of the two functions to return to double-byte strings
When the S1> S2 return value> 0; When S1 reference function Windows.CompareStringW
SpinEdit1.Value example: = WideCompareStr (Edit1.Text, Edit2.Text);
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
First function WideSameStr (const S1, S2: WideString): Boolean; $ [SysUtils.pas
Back to function the same as two double-byte strings
That distinction case
Reference function SysUtils.WideCompareStr
CheckBox1.Checked example: = WideSameStr (Edit1.Text, Edit2.Text);
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
First function WideCompareText (const S1, S2: WideString): Integer; $ [SysUtils.pas
Comparison of the two functions to return to double-byte strings
When the S1> S2 return value> 0; When S1 reference function Windows.CompareStringW
SpinEdit1.Value example: = WideCompareText (Edit1.Text, Edit2.Text);
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
First function WideSameText (const S1, S2: WideString): Boolean; $ [SysUtils.pas
Back to function the same as two double-byte strings
That does not distinguish between upper and lower case
Reference function SysUtils.WideCompareText
CheckBox1.Checked example: = WideSameText (Edit1.Text, Edit2.Text);
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
First function Trim (const S: string): string; overload; $ [SysUtils.pas
First function Trim (const S: WideString): WideString; overload; $ [SysUtils.pas
S function to return to remove the string that is not about characters
Note less than # 32 of the characters as not visible characters
Reference function System.Copy
Edit2.Text example: = Trim (Edit1.Text);
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
First function TrimLeft (const S: string): string; overload; $ [SysUtils.pas
First function TrimLeft (const S: WideString): WideString; overload; $ [SysUtils.pas
S function to return to the left side of the string to remove invisible characters
Note less than # 32 of the characters as not visible characters
Reference function System.Copy
Edit2.Text example: = TrimLeft (Edit1.Text);
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
First function TrimRight (const S: string): string; overload; $ [SysUtils.pas
First function TrimRight (const S: WideString): WideString; overload; $ [SysUtils.pas
S function to return to remove the right not visible string characters
Note less than # 32 of the characters as not visible characters
Reference function System.Copy
Edit2.Text example: = TrimRight (Edit1.Text);
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
First function QuotedStr (const S: string): string; $ [SysUtils.pas
S functions return a string in the form of the performance of pascal
The single quotes in a single quotation marks will be transferred into two
Reference procedure System.Insert
Edit2.Text example: = QuotedStr (Edit1.Text);
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
First function AnsiQuotedStr (const S: string; Quote: Char): string; $ [SysUtils.pas
S function to return a string of characters Quote manifestations quotes
Note AnsiQuotedStr ( 'hello "world','@')='hello" world @ '; AnsiQuotedStr (' hello "world ','"')='" hello" and "world"'
Reference function SysUtils.AnsiStrScan
Edit2.Text example: = AnsiQuotedStr (Edit1.Text,'"');
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
First function AnsiExtractQuotedStr (var Src: PChar; Quote: Char): string; $ [SysUtils.pas
Quote function for the character to return to the form prototype quotes
The manifestations of illegal unchanged when it is empty Src
Reference function SysUtils.AnsiStrScan
Examples
/////// 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
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
First function AnsiDequotedStr (const S: string; AQuote: Char): string; $ [SysUtils.pas
AQuote to return to function for the character of manifestations of the prototype quotes
When the forms are returned to the illegal S
Reference function SysUtils.AnsiExtractQuotedStr
Edit2.Text example: = AnsiDequotedStr (Edit1.Text,'"');
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
First function AdjustLineBreaks (const S: string; Style: TTextLineBreakStyle = ($ IFDEF LINUX) ($ ENDIF tlbsLF) ($ IFDEF MSWINDOWS tlbsCRLF)) ($ ENDIF): string; $ [SysUtils.pas
Function will return the string will be adjusted for the separation of CR / LF sequence
Note AdjustLineBreaks ('1 '# 13'2' # 13) ='1 '# 13 # 10'2' # 13 # 10; AdjustLineBreaks ('1 '# 10'2' # 10) ='1 '# 13 # 10'2 '# 13 # 10
Reference function SysUtils.StrNextChar
Examples
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
First function IsValidIdent (const Ident: string): Boolean; $ [SysUtils.pas
Ident whether the function is to return to the correct string identifier
Note identifier:: En | underscore [letters | underscore | Digital] ...
Reference
CheckBox1.Checked example: = IsValidIdent (Edit1.Text);
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
First function IntToStr (Value: Integer): string; overload; $ [SysUtils.pas
First function IntToStr (Value: Int64): string; overload; $ [SysUtils.pas
Integer Value function returned to convert to a string
Description Format ( '% d', [Value])
Reference function SysUtils.FmtStr
Edit2.Text example: = IntToStr (SpinEdit1.Value);
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
First function IntToHex (Value: Integer; Digits: Integer): string; overload; $ [SysUtils.pas
First function IntToHex (Value: Int64; Digits: Integer): string; overload; $ [SysUtils.pas
Integer Value function return into hexadecimal performance results; Format ('%.* x ', [Digits, Value])
Digits parameters specified that the minimum width of characters; less than the minimum width will be filled with 0
Reference function SysUtils.FmtStr
Edit2.Text example: = IntToHex (SpinEdit1.Value, SpinEdit2.Value);
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
First function StrToInt (const S: string): Integer; $ [SysUtils.pas
S functions return string to integer
Non-integer that string will cause abnormal expression
Reference procedure System.Val
SpinEdit1.Value example: = StrToInt (Edit1.Text);
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
First function StrToIntDef (const S: string; Default: Integer): Integer; $ [SysUtils.pas
S functions return string to integer
Non-integer expression that string when to return to the default value Default
Reference procedure System.Val
SpinEdit1.Value example: = StrToIntDef (Edit1.Text, 0);
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
First function TryStrToInt (const S: string; out Value: Integer): Boolean; $ [SysUtils.pas
S functions return string to integer Value success
Non-integer expression of the string returned to False and the output is 0 Value
Reference procedure System.Val
Examples
/////// Begin TryStrToInt
Procedure TForm1.Button1Click (Sender: TObject);
Var
I: Integer;
Begin
CheckBox1.Checked: = TryStrToInt (Edit1.Text, I);
SpinEdit1.Value: = I;
End;
/////// End TryStrToInt
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
First function StrToInt64 (const S: string): Int64; $ [SysUtils.pas
S functions return string into 64 Integer
The 64-string, integer will cause abnormal expression
Reference procedure System.Val
SpinEdit1.Value example: = StrToInt64 (Edit1.Text);
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
First function StrToInt64Def (const S: string; const Default: Int64): Int64; $ [SysUtils.pas
S functions return string into 64 Integer
Note 64 non-string expression when it is integral to return to the default value Default
Reference procedure System.Val
SpinEdit1.Value example: = StrToInt64Def (Edit1.Text, 0);
━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━
First function TryStrToInt64 (const S: string; out Value: Int64): Boolean; $ [SysUtils.pas
S functions return string into 64 Integer Value success
The 64-string, integer expression and Value will be returned to the False output 0
Reference procedure System.Val
Examples
/////// Begin TryStrToInt64
Procedure TForm1.Button1Click (Sender: TObject);
Var
I: Int64;
Begin
CheckBox1.Checked: = TryStrToInt64 (Edit1.Text, I);
SpinEdit1.Value: = I;
End;
/////// End TryStrToInt64
Previous:Delphi programming interesting list
Next:Delphi programming examples on the tray
User Reviews
Related Articles
Recommended article
AD