ename(var F; Newname); Reset 开启一个已存在的档案。procedure Reset(var F [: File; Recsize: Word ] ); Rewrite 建立并开启一个新档。procedure Rewrite(var F: File [; Recsize: Word ] ); RmDir 删除一个空目录。procedure RmDir(S: String); Seek 移动档案游标。procedure Seek(var F; N: Longint); Truncate 删截目前位置以後的档案内容。procedure Truncate(var F); ======================================== 记忆体管理函数 Memory-management Routines) Unit: SysUtils ======================================== AllocMem 配置一个记忆体区块给堆积heap 。 function AllocMem(Size: Cardinal): Pointer; ReAllocMem 从堆积释回一区块。function ReAllocMem(P: Pointer;CurSize, NewSize:Cardinal): Pointer; ======================================== 杂项函数 (Miscellaneous Routines) Unit: System, SysUtils ======================================== AddExitProc 加入一个程序到执行时期程式库的出囗程序列中。 procedure AddExitProc(Proc: TProcedure); Exclude 从一个集合除去一个元素。procedure Exclude(var S: set of T;I:T); FillChar 以一个字元填入指定个数到一个变数上。 procedure FillChar(var X; Count: Word; value); Hi 传回叁数的高位元组。function Hi(X): Byte; Include 将元素包含到集合内。procedure Include(var S: set of T; I:T); Lo 传回叁数的低位元组。function Lo(X): Byte; Move 从Source 复制Count 个数的位元组到Dest 。 procedure Move(varSource,Dest; Count: Word); ParamCount 传回命令列叁数的个数。function ParamCount: Word; ParamStr 传回一个指定的命令列叁数。function ParamStr(Index): String; Random 传回一个随机乱数。function Random[ ( Range: Word) ]; Randomize 初值化乱数产生器。procedure Randomize; SizeOf 传回叁数所占位元组数。function SizeOf(X): Word; Swap 将叁数的高位元组和低位元组交换。function Swap(X); TypeOf 传回指向物件型态的虚拟方法表的指标。function TypeOf(X) : Pointer UpCase 将字元转为大写。function UpCase(Ch: Char):Char; ======================================== 次序函数 (Ordinal Routines) Unit: System ======================================== Dec 递减一个变数。procedure Dec(var X[ ; N:Longint]); Inc 递增一个变数procedure Inc(var X[ ; N:Longint ] ); Odd 判别式否为奇数。function Odd(X: Longint):Boolean; Pred 传回叁数的前任者。function Pred(X); Succ 传回叁数的後继者。function Succ(X); ======================================== 指标和位址函数 (Pointer and Address Routines) Unit: System ======================================== addr 传回指定物件的位址。function Addr(X): pointer; Assigned 判断是否一个函数或程序是nil function Assigned(var P):Boolean; CSeg 传回CS 程式段暂存器的内容。function CSeg: Word; DSeg 传回DS 资料段暂存器的内容。function DSegt: Word; Ofs 传回叁数的偏移位址。function Ofs(X): Word; Ptr 将所指定的节段及偏移位址组合到一个指标。function Ptr(Seg, Ofs: Word):Pointer; Seg 传回叁数的节段位址。function Seg(X): Word; SPtr 传回SP 堆叠存器的内容。function SPtr: Word; SSeg 传回SS 堆叠段暂存器的内容。function SSeg: Word; ======================================== 字串格式函数 (String-formatting Routines) Unit: SysUtils ======================================== FmtStr 将所列叁数依照Format 的格式组合到Result 字串传回。 procedure FmtStr(var Resut: string; const Format:string;const Args: array of const); Format 将所列叁数依照Format 的格式组合到Pascal 格式字串传回。 fonction Format(const Format: string;const Args:array of const): string; FormatBuf 格式化所列的叁数。 FormatBuf(var Buffer;BufLen: Cardinal;const Format;FmtLen: Cardinal;const Args: array of string ): Cardinal; function FormatBuf(var Buffer; BufLen: Word;const Format; FmtLen:Word;Const Args: array of const):Word; StrFmt 格式化所列的叁数。 function StrFmt(Buffer, Format: PChar;const Args: array of const):PChar; SysUtils StrLFmt 格式化所列叁数,并将结果指向Buffer 指标。 function StrLFmt(Buffer: PChar; MxLen: Word;Format: PChar;const Args: array of const):PChar; SysUtils ======================================== 字串处理函数(String-handling Routines :Pascal-style) Unit: SystUtils ======================================== AnsiCompareStr 比较两个字串。function AnsiCompareStr(const S1, S2: string):Integer; SysUtils var S: string; mas: array[0..99] of string; i, j: integer; begin ... for i:=1 to 98 do for j:=i+1 to 99 do if AnsiCompareStr( mas[i], mas[j] ) >0 then begin S:= mas[i]; mas[i]:= mas[j]; mas[j]:= S; end; end; var
S1,S2: string; I: Integer;
begin
S1:= ''''? ???? ???????? ??????''''; S2:= ''''? ???? ???????? ??????''''; I:= CompareStr(S1, S2); { I > 0, ?.?. S1 > S2 } if I<>0 then MessageDlg( ''''?????? ????????!'''', mtWarning, [mbOK],0); end;
AnsiCompareText 比较两个字串且无大小写区别。 AnsiCompareText ( const S1, S2: string ): Integer; SysUtils AnsiCompareStr(''''a'''', ''''A'''') <0 CompareStr(''''a'''', ''''A'''') >0
function AnsiCompareText(const S1, S2: string):Integer; AnsiLowerCase 将字串内容转为小写。function AnsiLowerCase(const S: string): string; SysUtils var S: string; begin S:= ''''MyFile.TXT''''; S:= AnsiLowerCase(S); // S := ''''myfile.txt'''' MessageDlg(S, mtInformation, [mbOk], 0); end;
AnsiUpperCase 将字串内容转为大写。function AnsiUpperCase(const S: string): string; SysUtils var S: string; begin S:= ''''c:\windows''''; S:= AnsiUpperCase (S); { S := ''''C:\WINDOWS'''' } MessageDlg(S, mtInformation, [mbOk], 0); end;
AppendStr 将所给字串连接到Dest 字串後面。procedure AppendStr(var Dest: string; const S:string); AssignStr 配置记忆体空间给字串。procedure AppendStr(var P: PString; const S:String); CompareStr 比较两个字串。function CompareStr(const S1,S2: string):Integer; CompareText 比较两个字串且无大小写区别。function CompareText(const S1, S2: String):Integer; Concat 连结所列字串。function Concat(s1 [, s2,… , sn]: String):String; Copy 传回字串的部份字串内容。function Copy(S: String; Index, Count:Integer): String; Delete 删除所给字串内的子字串。procedure Delete(var S: String; Index,Count:Integer); DisposeStr 释回字串占用的空间。procedure DisposeStr(P: PString); FmtLoadStr 从程式的资源字串表中载入一个字串。 FmtLoadStr(Ident: Integer;const Args: array of string ): string; SysUtils
function FmtLoadStr(Ident: Word;const Args: array of const): string; Insert 在一个字串内插入一个子字串 procedure Insert(Source: String; var S: String;Index: Integer); Insert (Source: string;var S: string;Index: Integer ); System var S: string; begin S:= ''''??????? ?????? ??????????.''''; Insert( ''''!'''', S, 8); { S := ''''???????! ?????? ??????????.''''} MessageDlg( S, mtWarning, [mbOK],0); end;
IntToHex 将一个整数转为十六进位。 function IntToHex(Value: Longint; Digits:Integer): string; IntToStr 将数字转成字中格式。function IntToStr(Value: Longint): string; IsValidIdent 判别字串内容是否为正确的识别字。function IsValidIdent(const Ident: string):Boolean; Length 传回字串的长度。function Length(S: String): Integer; LoadStr 从应用程式的可执行档中载入一个字串资源。 function LoadStr(Ident: Word): string; SysUtils LowerCase 将字串转成小写。function LowerCase(const S: string): string; NewStr 从堆积配置一个字串空间。function NewStr(const S: string): PString; Pos 传回子字串在字串中的位置。function Pos(Substr: String; S: String): Str 将数值转为字串。procedure Str(X [: Width [: Decimals ]];var S); StrToInt 将字串转为整数值。function StrToInt(const S: string): Longint; StrToIntDef 将字串转整数值或预设值。function StrToIntDef(const S:  << 上一页 [31] [32] [33] [34] [35] 下一页 |