字符串處理函數(shù)
Unit System
函數(shù)原型 function Concat(s1 [, s2,..., sn]: string): string; 說明 與 S := S1 + S2 + S3 ...; 相同. 將字符串相加.
函數(shù)原型 function Copy(S: string; Index, Count: Integer): string;說明 S : 字符串. Indexd : 從第幾位開始拷貝. Count : 總共要拷貝幾位. 從母字符串拷貝至另一個(gè)字符串.
函數(shù)原型 PRocedure Delete(var S: string; Index, Count:Integer);說明 S : 字符串. Indexd : 從第幾位開始刪. Count : 總共要?jiǎng)h幾位. 刪除字符串中的數(shù)個(gè)字元.
函數(shù)原型 procedure Insert(Source: string; var S: string; Index: Integer);說明 Source : 子字符串. S : 被插入字符串. Indexd : 從第幾位開始插入. 將一個(gè)子字符串插入另一個(gè)字符串中.
函數(shù)原型 function Length(S: string): Integer; 求字符數(shù)
函數(shù)原型 function Pos(Substr: string; S: string): Integer;說明 Substr : 子字符串.S : 母字符串. 尋找子字符串在母字符串中的位置.
函數(shù)原型 function LowerCase(const S: string): string; 將字符串全部轉(zhuǎn)為小寫字母.
函數(shù)原型 function UpperCase(const S: string): string; 將字符串全部轉(zhuǎn)為大寫字母.
pos(obj,target) 在target字符串中找出第一個(gè)出現(xiàn)obj的第一個(gè)字符位置,如果找不到,返回0.
function StringReplace(const S, OldPattern, NewPattern: string; Flags: TReplaceFlags): string;功能 返回替換后的字符串說明 rfReplaceAll為替換全部?jī)?nèi)容;rfIgnoreCase為忽略大小寫
function StringToGUID(const S: string): TGUID;功能 返回字符串S轉(zhuǎn)換成全局標(biāo)識(shí)說明 如果字符串非法將觸發(fā)異常
function GUIDToString(const GUID: TGUID): string;功能 返回全局標(biāo)識(shí)GUID轉(zhuǎn)換成字符串
函數(shù)原型 procedure Str(X [: Width [: Decimals ]]; var S); 將數(shù)值轉(zhuǎn)換為格式化的字符串.說明 X : 欲轉(zhuǎn)換的整數(shù) or 實(shí)數(shù). Width : 格式化長(zhǎng)度.(Integer) Decimals : 小數(shù)點(diǎn)位數(shù).(Integer)
函數(shù)原型 procedure Val(S; var V; var Code: Integer); 將字符串轉(zhuǎn)為數(shù)字.說明 S : 欲轉(zhuǎn)換的字符串. V : 轉(zhuǎn)換后的整數(shù) or 實(shí)數(shù).Code : Code = 0 表示轉(zhuǎn)換成功.
Unit SysUtils
函數(shù)原型 function NewStr(const S: string): PString; 在 heap 中配置一個(gè)新的字符串空間給PString 指針.
函數(shù)原型 procedure DisposeStr(P: PString); 在 heap 中釋放一個(gè)字符串空間 PString指針.
函數(shù)原型 function IntToHex(Value: Integer; Digits: Integer): string;
函數(shù)原型 function IntToStr(Value: Integer): string;
函數(shù)原型 function StrToInt(const S: string): Integer;
函數(shù)原型 function StrToIntDef(const S: string; Default: Integer): Integer; 說明 Value : 欲轉(zhuǎn)換的整數(shù). Digits : 欲轉(zhuǎn)換為幾位數(shù)的 Hex.
函數(shù)原型 function Trim(const S: string): string; 將字符串前后的空白及控制字元清掉.
函數(shù)原型 function TrimLeft(const S: string): string; 將字符串左邊的空白及控制字元清掉.
函數(shù)原型 function TrimRight(const S: string): string; 將字符串右邊的空白及控制字元清掉.
函數(shù)原型 function AdjustLineBreaks(const S: string): string; 將字符串的換行符號(hào)全部改為#13#10
函數(shù)原型 function StrAlloc(Size: Cardinal): PChar; 配置字符串空間. 說明 Size=字符串最大空間+1
函數(shù)原型 function StrBufSize(Str: PChar): Cardinal; 傳回由 StrAlloc 配置空間的大小
函數(shù)原型 function StrCat(Dest, Source: PChar): PChar; 字符串相加.
函數(shù)原型 function StrComp(Str1, Str2 : PChar): Integer; 比較兩字符串大小.
函數(shù)原型 function StrCopy(Dest, Source: PChar): PChar; 拷貝字符串.
函數(shù)原型 procedure StrDispose(Str: PChar); 釋放StrAlloc or StrNew所配置的空間.
函數(shù)原型 function StrECopy(Dest, Source: PChar): PChar; 拷貝字符串并傳回字符串結(jié)束位址.
函數(shù)原型 function StrEnd(Str: PChar): PChar; 傳回字符串結(jié)束位址.
函數(shù)原型 function StrIComp(Str1, Str2:PChar): Integer; 比較兩字符串大小.(不分大小寫)
函數(shù)原型 function StrLCat(Dest, Source: PChar; MaxLen: Cardinal): PChar;字符串相加.(指定長(zhǎng))
函數(shù)原型 function StrLComp(Str1, Str2: PChar; MaxLen: Cardinal):Integer; 比較兩字符串大小.(指定長(zhǎng))
函數(shù)原型 function StrLCopy(Dest, Source: PChar; MaxLen: Cardinal): PChar; 拷貝字符串.(指定長(zhǎng))
函數(shù)原型 function StrLen(Str: PChar): Cardinal; 傳回字符串長(zhǎng)度.(不含終止位元)
函數(shù)原型 function StrLIComp(Str1, Str2: PChar; MaxLen: Cardinals): Integer; 比較兩字符串大小.(指定長(zhǎng),不分大小寫)
函數(shù)原型 function StrLower(Str: PChar): PChar; 將字符串全部轉(zhuǎn)為小寫字母.
函數(shù)原型 function StrMove(Dest, Source: PChar; Count:Cardinal): PChar; 從來源字符串拷貝n個(gè)Bytes到目標(biāo)r串.(不含終止位元)
函數(shù)原型 function StrNew(Str: PChar): PChar; 配置字符串空間.
函數(shù)原型 function StrPas(Str: PChar): string; 將 null-terminated 字符串轉(zhuǎn)為Pascal-style 字符串.
函數(shù)原型 function StrPCopy(Dest: PChar; Source: string): PChar; 拷貝 Pascal-style 字符串到null-terminated 字符串.
函數(shù)原型 function StrPLCopy(Dest: PChar; const Source: string; MaxLen: Cardinal): PChar; 拷貝 Pascal-style 字符串到null-terminated 字符串.(指定長(zhǎng))
函數(shù)原型 function StrPos(Str1, Str2: PChar): PChar; 子字符串在母字符串中的位置.(第一個(gè)位置) 說明 Str1 母字符串;Str2 子字符串
函數(shù)原型 function StrUpper(Str: PChar): PChar; 將字符串全部轉(zhuǎn)為大寫字母.
StrAlloc 配置一個(gè)最大長(zhǎng)度為Size-1 的緩沖區(qū)給null 結(jié)尾字符串function StrAlloc(Size: Word): PChar;
StrBufSize 傳回由StrAlloc 配置的字符串緩沖區(qū)內(nèi)可以儲(chǔ)存的最大字元數(shù)。StrBufSize( S: PChar ): Cardinal;
StrCat連結(jié)兩個(gè)字符串并傳回該字符串。function StrCat(Dest, Source: PCar): PChar;
StrComp 比照兩個(gè)字符串。function StrComp(Str1, Str2 : Pchar): Integer;
StrCopy 拷貝Source 字符串到Dest 上。function StrCopy(Dest, Source: PChar): PChar
StrDispose 釋回一個(gè)字符串空間。function StrDispose(Str:PChar);
StrECopy 拷貝Source 字符串到Dest 上并傳回指向該字符串結(jié)尾的指針。function StrECopy(Dest, Surce: Pchar): Pchar;
StrEnd 傳回一指針指向字符串的結(jié)尾function StrEnd(Str: Pchar): Pchar;
StrLCat 將Source 字符串連結(jié)到Dest 字符串后,并傳回連結(jié)的字符串。function StrLCat(Dest, Source:PCar; MaxLen: Word): PChar;
StrIComp 比較兩個(gè)字符串具無大小寫區(qū)別function StrIComp(Str1, Str2:Pchar): Integer;
StrLComp 比較兩個(gè)字符串到所指定的最大長(zhǎng)度function StrLComp(Str1, Str2:Pchar; MaxLen: Word): Integer;
StrLCopy 從一字符串拷貝指定字元數(shù)到另一字符串Function StrLCopy(Dest,Source:PChar;MaxLen: Cardinal): PChar;
StrLen 傳回字符串的長(zhǎng)度。function StrLen(Str: PChar):Cardinal;
StrLIComp 比較兩個(gè)字符串到所指定的最大長(zhǎng)度具無大小寫區(qū)別。function StrLIComp(Str1, Str2:PChar; MaxLen: Word):Integer;
StrLower 將字符串轉(zhuǎn)成小寫。function StrLower(Str: PChar):PChar;
StrMove 拷貝Count 字元數(shù),從Source 到Dest字符串。function StrMove(Dest, Source:PChar; Count: Cardinal): PChar
StrNew 從堆積配置一個(gè)字符串。function StrNew(Str: PChar):PChar;
StrPas 將null 結(jié)尾字中轉(zhuǎn)成一個(gè)Pascal 格式字符串。function StrPas(Str: Pchar):String;
StrPCopy 拷貝一個(gè)Pascal 格式字符串到一個(gè)null結(jié)尾字符串。Function StrPCopy(Dest:PChar;Source: String): PChar;
StrPLCopy 拷貝MaxLen 所指字元數(shù),從Pascal格式字符串到null 結(jié)尾字符串。Function StrPLCopy(Dest:Pchar;cost Source: string;MaxLen: Word): PChar;
StrPos 傳回一指針指向在Str1 內(nèi)最先出現(xiàn) Str2 字符串的位置。function StrPos(Str1, Str2: Pchar): Pchar;
StrScan 傳回一指針指向在Str 字符串中第一個(gè)出現(xiàn)chr 字元的位置。function StrScan(Str: PChar; Chr: Char): PChar;
StrRScan 傳回一指針指向在Str 子串中最后出現(xiàn)chr 字元的位置。function StrRScan(Str: Pchar; Chr: Char): PChar;
StrUpper 將字符串轉(zhuǎn)成大寫。function StrUpper(Str: PChar):PChar;
日期與時(shí)間函數(shù) (Date and Time Routines)
Unit: SysUtils
Date 傳回今天日期。function Date: TDateTime;
DateTimeToStr 將時(shí)間格式轉(zhuǎn)為字符串。function DateTimeToStr(DateTime: TDateTime):String;
DateTimeToString 將時(shí)間格式轉(zhuǎn)為字符串。procedure DateTimeToString(var Result: string;const Format: string;DateTime: TDateTime);
DateToStr 將日期格式轉(zhuǎn)為字符串。function DateToStr(Date: TDateTime): String;
DayOfWeek 傳回今天星期幾。function DayOfWeek(Date: TDateTime): Integer; 傳回值是一整數(shù),1~7. 星期日為1.
DecodeDate 分解所指定的日期為年、月、日。procedure DecodeDate(Date: TDateTime;var Year, Month, Day:Word);
DecodeTime 分解所指定的日期為時(shí)、分、秒。procedure DecodeTime(Time: TDateTime;var Hour, Min, Sec,MSec: Word);
EncodeDate 傳回將年、月、日所組合的日期格式。function EncodeDate(Year, Month, Day: Word):TDateTime;
EncodeTime 傳回將時(shí)、分、秒所組合的時(shí)間格式。function EncodeTime(Hour, Min, Sec, MSec:Word): TDateTime;
FormatDateTime 以指定的格式傳回日期時(shí)間。function FormatDateTime(const Format: string;DateTime: TDateTime):String;
Now 傳回現(xiàn)在的日期時(shí)間。function Now: TDateTime;
StrToDate 將字符串轉(zhuǎn)為日期格式。function StrToDate(const S:string): TDateTime;
StrToDateTime 將字符串轉(zhuǎn)為日期時(shí)間格式function StrToDateTime(const S: string): TDateTime;
StrToTime 將字符串轉(zhuǎn)為時(shí)間格式。function StrToTime(const S:string): TDateTime;
Time 傳回現(xiàn)在時(shí)間。function Time: TDateTime;
TimeToStr 將時(shí)格式轉(zhuǎn)為字符串。function TimeToStr(Time:TDateTime): String;
文件管理函數(shù)
Unit: SysUtils
函數(shù)原型 function ExtractFileDir(const FileName: string): string;
函數(shù)原型 function ExtractFileDrive(const FileName: string): string;
函數(shù)原型 function ExtractFileExt(const FileName: string): string;
函數(shù)原型 function ExtractFileName(const FileName: string): string;
函數(shù)原型 function ExtractFilePath(const FileName: string): string;
函數(shù)原型 function DeleteFile(const FileName: string): Boolean;
函數(shù)原型 function RenameFile(const OldName, NewName: string):Boolean;
函數(shù)原型 function FileExists(const FileName: string): Boolean;
函數(shù)原型 procedure FindClose(var F: TSearchRec);
函數(shù)原型 function FindFirst(const Path: string; Attr: Integer; var F: TSearchRec): Integer;
函數(shù)原型 function FindNext(var F: TSearchRec): Integer;說明 成功傳回0
ChangeFileExt 變更文件的擴(kuò)展名。
function ChangeFileExt(const FileName,Extension: string):string; DateTimeToFileDate 將Delphi 的日期格式轉(zhuǎn)換為DOS的日期格式。
functionDateTimeToFileDate(DateTime:TDateTime): Longint;
DeleteFile 刪除一個(gè)文件。function DeleteFile(const FileName: string):Boolean;
DiskFree 傳回磁碟的可用空間。function DiskFree(Drive: Byte): Longint;
DiskSize 傳回指定磁碟的容量大小。function DiskSize(Drive: Byte): Longint;
ExpandFileName 傳回一個(gè)完整的路徑及檔名字符串。function expandFileName(const FileName: string):string;
ExtractFileExt 傳回文件的擴(kuò)展名。function ExtractFileExt(const FileName string):string;
ExtractFileName 傳回文件的檔名。function ExtractFileName(const FileName: string):string;
ExtractFilePath 傳回文件的路徑。function ExtractFilePath(const FileName: string):string;
FileAge 傳回文件的年紀(jì)function FileAge(const FileName: string):Longint;
FileCreate 以指定檔名建立一個(gè)文件。function FileCreate(const FileName: string):Integer;
FileClose 關(guān)閉指定的文件。procedureFileClose(Handle: Integer);
FileDateToDateTime 將DOS 的日期格式轉(zhuǎn)為Delphi 的日期格式。function FileDateToDateTime(FileDate: Longint):TDateTime;
FileExists 判別文件是否存在。function FileExists(const FileName: string):Boolean;
FileGetAttr 傳回文件屬性。function FileGetAttr(const FileName: string):Integer;
FileGetDate 傳回文件的日期及時(shí)間。function FileGetDate(Handle: Integer): Longint;
FileRead 從指定的文件讀入資料。function FileRead(Handle:Integer; var Buffer;Count:Longint):Longint;
FileSearch 在目錄列中搜尋指定的文件。function FileSearch(constName, DirList: string):string;
FileSeek 改變文件游標(biāo)的位置。function FileSeek(Handle: Integer;Offset: Longint;Origin: Integer):Longint;
FileSetAttr 設(shè)定文件屬性。function FileSetAttr(const FileName: string;Attr:Integer): Integer;
FileSetDate 設(shè)定文件的日期及時(shí)間。procedure FileSetDate(Handle: Integer; Age:Longint);
FileOpen 開啟文件。function FileOpen(const FileName: string; Mode:Word): Integer;
FileWrite 寫資料到文件。function FileWrite(Handle:Integer;const Buffer; Count:Longint): Longint;
FindClose 終止找尋第一個(gè)/下一個(gè)的動(dòng)作。procedure FindClose(var SearchRec: TSearchRec);
FindFirst 尋找第一個(gè)符合的文件并設(shè)定其屬性。
function FindFirst(const Path: string;Attr: Word; var F:TSearchRec): Integer;
FindNext 傳回下一個(gè)符合的文件。function FindNext(var F:TSearchRec): Integer;
RenameFile 變更文件名。function RenameFile(const OldName,NewName: string):Boolean;
轉(zhuǎn)換函數(shù)(Transfer Routines)
Unit: System
Chr 傳回ASCII 碼所對(duì)應(yīng)的字元。function Chr(X: Byte): Char;
Delphi 源碼任務(wù) ( http://home.kimo.com.tw/bruce0211/ ) 打字整理15
High 傳回叁數(shù)在范圍內(nèi)的最高值。function High(X);
Low 傳回叁數(shù)在范圍內(nèi)的最低值。function Low(X);
Ord 傳回一個(gè)有序型態(tài)所對(duì)應(yīng)的順序值。function Ord(X): Longint;
Round 將一個(gè)實(shí)數(shù)值四舍五入而傳回整數(shù)值。function Round(X: Real):Longint;
Trunc 將一個(gè)實(shí)數(shù)值去尾而傳回整數(shù)值。function Trunc(X: Real):Longint;
pred(x) pred('D')='C', pred(true)=1;
succ(x) succ('Y')='Z', succ(pred(x))=x
ord(x) 求x在字符集中的序號(hào),如ord('A')=65
chr(x) chr(65)='A'
round(x) 四舍五入
trunc(x) trunc(4.8)=4,trunc('-3.6')=-3
upcase(x) upcase('a')='A'
hi(I) hi($2A30)=$2A
lo(I) lo($2A30)=$30
random(n) 產(chǎn)生[0,n)間的隨機(jī)整數(shù)
sizeof(name) 求出某類型或變量在內(nèi)存中占用的字節(jié)數(shù)
swap(num) 交換int的高低位 swap($3621)=$2136
Frac 求一個(gè)實(shí)數(shù)的小數(shù)部份
R := Frac(123.456); { 0.456 }
R := Frac(-123.456); { -0.456 }
Int 求一個(gè)實(shí)數(shù)的整數(shù)部份
R := Int(123.456); { 123.0 }
R := Int(-123.456); { -123.0 }
函數(shù)原型 function High(X); 傳回注腳的最大值
函數(shù)原型 function Low(X); Low 傳回注腳的最小值.
函數(shù)原型 function Ord(X): Longint; 傳回列舉型態(tài)的數(shù)值.
函數(shù)原型 function Round(X: Extended): Longint; 將實(shí)數(shù)轉(zhuǎn)為整數(shù).(有四舍五入)
函數(shù)原型 function Trunc(X: Extended): Longint; 將實(shí)數(shù)轉(zhuǎn)為整數(shù).(小數(shù)直接舍棄)
函數(shù)原型 function VarArrayCreate(const Bounds: array of Integer; VarType: Integer): Variant; 建立一個(gè)variant array.
函數(shù)原型 function VarArrayOf(const Values: array of Variant): Variant; 建立一個(gè)簡(jiǎn)單的一維variant array
函數(shù)原型 function VarArrayLock(var A: Variant): Pointer; 將variant陣列==>指定給一陣列變數(shù).
函數(shù)原型 procedure VarArrayUnlock(var A: Variant); 解除上述的指定.
函數(shù)原型 function VarIsArray(const V: Variant): Boolean; 傳回Variant是否為一個(gè)陣列.
函數(shù)原型 function VarIsNull(const V: Variant): Boolean; 傳回Variant是否為NULL.
函數(shù)原型 function VarAsType(const V: Variant; VarType: Integer): Variant; 將Variant轉(zhuǎn)為另外一個(gè)型態(tài)的Variant.
函數(shù)原型 procedure VarCast(var Dest: Variant; const Source: Variant; VarType: Integer);說明 VarType不可為varArray or varByRef.
函數(shù)原型 function VarType(const V: Variant): Integer; 傳回Variant的型態(tài).
函數(shù)原型 procedure VarClear(var V: Variant); 將variant清除,成為Unassigned狀態(tài).
函數(shù)原型 procedure VarCopy(var Dest: Variant; const Source: Variant); 拷貝一個(gè)variant.說明 與Dest:=Source;效果一樣.
函數(shù)原型 function VarFromDateTime(DateTime: TDateTime): Vari ant; 將DateTime轉(zhuǎn)為Variant.
函數(shù)原型 function VarToDateTime(const V: Variant): TDateTime; 將Variant轉(zhuǎn)為DateTime.
函數(shù)原型 function Hi(X): Byte; 傳回高位元數(shù)字.Hi($1234); { $12 }
函數(shù)原型 procedure Include(var S: set of T; I:T); 說明 加入I元素到S中. 加入一個(gè)元素到一組元素.
函數(shù)原型 function Lo(X): Byte; Lo($1234); { $34 }
函數(shù)原型 procedure Move(var Source, Dest; Count: Integer); 從來源變數(shù)拷貝n個(gè)Bytes到目的變數(shù).
函數(shù)原型 function ParamCount: Integer; 直接由執(zhí)行檔后加上傳入變數(shù)的個(gè)數(shù).
函數(shù)原型 function ParamStr(Index: Integer): string;說明 ParamStr(0);傳回執(zhí)行檔的名稱及完整目錄.
函數(shù)原型 function Random [ ( Range: Integer) ]; 說明 0<=X<Range
函數(shù)原型 function Swap(X); Swap 將一組變數(shù)的高低位元交換.
函數(shù)原型 function UpCase(Ch: Char): Char; 將一字元轉(zhuǎn)為大寫字母.
函數(shù)原型 procedure Dec(var X[ ; N: Longint]);說明 Dec(X) ==> X:=X-1; Dec(X,N) ==> X:=X-N; 使變數(shù)遞減.
函數(shù)原型 procedure Inc(var X [ ; N: Longint ] );說明 Inc(X) ==> X:=X-1;Inc(X,N) ==> X:=X-N; 使變數(shù)遞增.
函數(shù)原型 function Odd(X: Longint): Boolean; 檢查是否為奇數(shù).
函數(shù)原型 function Assigned(var P): Boolean; Assigned 測(cè)試指針變數(shù)是否為nil. 說明 當(dāng)@P=nil ==> 傳回FALSE
數(shù)學(xué)函數(shù)
Abs 傳回叁數(shù)的絕對(duì)值。 function Abs(X);
ArcTan 傳回正切函數(shù)的反函數(shù)值。 function ArcTan(X: Real): Real;
Cos 傳回馀弦函數(shù)值 function Cos(X: Real): Real; (X 以弧度為單位)。
Exp 傳回自然指數(shù)值。 function Cos(X: Real): Real;
Frac 傳回叁數(shù)的小數(shù)部份。 function Frac(X: Real): Real;
Int 傳回叁數(shù)的整數(shù)部份。 function Int(X: Real): Real;
Ln 傳回自然對(duì)數(shù)值。 function Ln(X: Real): Real;
Pi 傳回圓周率π的值。 function Pi: Real;
Sin 傳回正弦函數(shù)值。 function Sin(X: Real): Real;
Sqr 傳回叁數(shù)的平方。 function Sqr(X: Real): (Real);
Sqrt 傳回叁數(shù)的平方根。 function Sqrt(X: Real): Real;
輸出入函數(shù)Unit: System
AssignFile 指定一個(gè)文件到文件變數(shù)。procedure AssignFile(var f, String);
CloseFile 關(guān)閉文件。procedure CloseFile(var F);
Eof 判斷是否已到文件結(jié)尾。
Typed or untyped files: functionEof(var F): BooleanText files:function Eof [ (var F: Text) ]:Boolean;
Erase 清除文件內(nèi)容。procedure Erase(var F);
FilePos 傳回目前文件游標(biāo)位置。function FilePos(var F): Longint;
FileSize 傳回文件的大小function FileSize(var F):Longint;
GetDir 傳回指定磁碟的工作目錄。procedure GetDir(D: Byte; var S: String);
IOResult 傳回最后I/O 執(zhí)行的狀態(tài)。function IOResult: Integer;
MkDir 建立一子目錄。procedure MkDir(S: String);
Rename 變更外部文件的檔名。procedure Rename(var F; Newname);
Reset 開啟一個(gè)已存在的文件。procedure Reset(var F [: File; Recsize: Word ] );
Rewrite 建立并開啟一個(gè)新檔。procedure Rewrite(var F: File [; Recsize: Word ] );
RmDir 刪除一個(gè)空目錄。procedure RmDir(S: String);
Seek 移動(dòng)文件游標(biāo)。procedure Seek(var F; N: Longint);
Truncate 刪截目前位置以后的文件內(nèi)容。procedure Truncate(var F);
浮點(diǎn)數(shù)轉(zhuǎn)換函數(shù) Unit: SysUtils
FloatToDecimal 將浮點(diǎn)數(shù)值分成小數(shù)及整數(shù)部份的數(shù)字傳回。
procedure FloatToDecimal(var Result: TFloatRec;Value:Extended;Precision, Decimals:Integer);
FloatToStrF 依照指定格式將浮點(diǎn)數(shù)轉(zhuǎn)成字符串描述。
function FloatToStrF(Value: Extended; Format:TFloatFormat;Precision,Digits: Integer): string;
FloatToStr 將浮點(diǎn)數(shù)轉(zhuǎn)成字符串描述。function FloatToStr(Value: Extended): string;
FloatToText 將所給的浮點(diǎn)數(shù)值,分成小數(shù)及整數(shù)部份的數(shù)字依照格式傳回。
function FloatToText(Buffer: Pchar; Value:Extended;Format:TFloatFormat;Precision,Digits: Integer): Integer;
FloatToTextFmt 將浮點(diǎn)數(shù)依照格式轉(zhuǎn)成字符串傳回。
function FloatToTextFmt(Buffer: PChar; Value:Extended;Format: PChar) :Integer;
FormatFloat 將浮點(diǎn)數(shù)值依照Format 格式傳回。
function FormatFloat(constFormat: string;Value:Extended):string;
StrToFloat 將所給字符串轉(zhuǎn)成一個(gè)浮點(diǎn)數(shù)值。
function StrToFloat(const S: string): Extended;
TextToFloat 將一個(gè)null 結(jié)尾字符串轉(zhuǎn)成浮點(diǎn)數(shù)值
function TextToFloat(Buffer: PChar;var Value:Extended): Boolean;
流程控制函數(shù) Unit: System
Break 終止循環(huán)。如for, while 及repeat 循環(huán)。
Continue 繼續(xù)循環(huán)。如for, while 及repeat 循環(huán)。
Exit 離開目前的區(qū)塊。procedure Exit;
Halt 停止程式的執(zhí)行并回到作業(yè)系統(tǒng)。
動(dòng)態(tài)配置函數(shù)Unit: System
Dispose 釋回一個(gè)動(dòng)態(tài)變數(shù)。procedure Dispose(var P: Pointer);
Free 釋放一個(gè)物件復(fù)本。procedure Free;
FreeMem 釋回一給定大小的動(dòng)態(tài)變數(shù)。procedure FreeMem(var P:Pointer; Size: Word);
GetMem 建立一個(gè)指定大小的動(dòng)態(tài)變數(shù),并由Pointer 叁數(shù)傳回位址。procedure GetMem(var P:Pointer; Size: Word);
New 建立一個(gè)新的動(dòng)態(tài)變數(shù),并將Pointer 叁數(shù)指向它。procedure New(var P: Pointer);function New(<pointer type>):Pointer;
MaxAvail 傳回連續(xù)最大的可配置空間。function MaxAvail: Longint;
MemAvail 傳回所有的可配置空間。function MemAvail: Longint;
指針和位址函數(shù) Unit: System
addr 傳回指定物件的位址。function Addr(X): pointer;
Assigned 判斷是否一個(gè)函數(shù)或程序是nil function Assigned(var P):Boolean;
CSeg 傳回CS 程式段暫存器的內(nèi)容。function CSeg: Word;
DSeg 傳回DS 資料段暫存器的內(nèi)容。function DSegt: Word;
Ofs 傳回叁數(shù)的偏移位址。function Ofs(X): Word;
Ptr 將所指定的節(jié)段及偏移位址組合到一個(gè)指針。function Ptr(Seg, Ofs: Word):Pointer;
Seg 傳回叁數(shù)的節(jié)段位址。function Seg(X): Word;
SPtr 傳回SP 堆疊存器的內(nèi)容。function SPtr: Word;
SSeg 傳回SS 堆疊段暫存器的內(nèi)容。function SSeg: Word;
控制臺(tái)函數(shù) Unit: WinCrt
AssignCrt 將文字檔連結(jié)到一個(gè)控制臺(tái)視窗。 procedure AssignCrt(var f: Text);
ClrEol 清附游標(biāo)位置到該行最后的所有字元。procedure ClrEol;
ClrScr 清附螢?zāi)徊⒅刂糜螛?biāo)至左上角。 procedure ClrScr;
CursorTo 移動(dòng)游標(biāo)至給定座標(biāo)。 procedure CursorTo(X, Y:Integer);
DoneWinCrt 結(jié)束控制臺(tái)視窗。 procedure DoneWinCrt;
GotoXY 移動(dòng)游標(biāo)至給定座標(biāo)。 procedure GotoXY(X, Y: Byte);
InitWinCrt 建立控制臺(tái)視窗。 procedure InitWinCrt;
KeyPressed 判斷是否有一按鍵。 function KeyPressed:Boolean;
ReadBuf 從控制臺(tái)視窗讀入一行。 function ReadBuf(Buffer: Pchar;Count: Word):
ReadKey 讀取按鍵字元。function ReadKey: Char;
ScrollTo 卷動(dòng)控制臺(tái)視窗至顯示位置。procedure ScrollTo(X, Y: Integer);
TrackCursor 卷動(dòng)控制臺(tái)視窗宜到游標(biāo)可見。procedure TrackCursor;
WhereX 傳回游標(biāo)的X 座標(biāo)。function WhereX: Byte;
WhereY 傳回游標(biāo)的Y 標(biāo)標(biāo)。function WhereY: Byte;
WriteBuf 寫入一區(qū)塊字元到控制臺(tái)視窗。procedure WriteBuf
WriteChar 寫一個(gè)字元到控制臺(tái)視窗。procedure WriteChar(CH: Char);
新聞熱點(diǎn)
疑難解答
圖片精選
網(wǎng)友關(guān)注