bsp; else MessageDlg(''''Directory removed'''', mtInformation, [mbOk], 0); end; ----------------------------------------------------------------------------- ChDir 改变目前目录. ----------------------------------------------------------------------------- Unit System 函数原型 procedure ChDir(S: string); 范例 begin {$I-} { Change to directory specified in Edit1 } ChDir(Edit1.Text); if IOResult <> 0 then MessageDlg(''''Cannot find directory'''', mtWarning,[mbOk], 0); end;
============================================== Memory-management routines 记忆体管理常式 ============================================== AllocMem 配置记忆体. ----------------------------------------------------------------------------- Unit SysUtils 函数原型 function AllocMem(Size: Cardinal): Pointer; 说明 FreeMem释放记忆体. ----------------------------------------------------------------------------- GetHeapStatus 传回目前Heap区的记忆体配置状态. ----------------------------------------------------------------------------- Unit System 函数原型 function GetHeapStatus: THeapStatus; ----------------------------------------------------------------------------- GetMemoryManager 传回目前Heap区的记忆体配置 的进入点. ----------------------------------------------------------------------------- Unit System 函数原型 procedure GetMemoryManager(var MemMgr: TMemoryManager); EXample var
procedure SetNewMemMgr; begin GetMemoryManager(OldMemMgr); SetMemoryManager(NewMemMgr); end; ##GetMemoryManager, SetMemoryManager Example
====================================== Miscellaneous routines 其他常式 ====================================== Exclude 删除一组元素中的一个元素. ----------------------------------------------------------------------------- Unit System 函数原型 procedure Exclude(var S: set of T;I:T); 说明 删除S中的I元素. ----------------------------------------------------------------------------- FillChar 填入元素. ----------------------------------------------------------------------------- Unit System 函数原型 procedure FillChar(var X; Count: Integer; value); 说明 以value填入X中Count个.
范例 Example var S: array[0..79] of char; begin { Set to all spaces } FillChar(S, SizeOf(S), Ord('''' '''')); MessageDlg(S, mtInformation, [mbOk], 0); end; ----------------------------------------------------------------------------- Hi 传回高位元数字. ----------------------------------------------------------------------------- Unit System 函数原型 function Hi(X): Byte; 范例 var B: Byte; begin B := Hi($1234); { $12 } end; ----------------------------------------------------------------------------- Include 加入一个元素到一组元素. ----------------------------------------------------------------------------- Unit System 函数原型 procedure Include(var S: set of T; I:T); 说明 加入I元素到S中. ----------------------------------------------------------------------------- Lo 传回高位元数字. ----------------------------------------------------------------------------- Unit System 函数原型 function Lo(X): Byte; 范例 var B: Byte; begin B := Lo($1234); { $34 } end; ----------------------------------------------------------------------------- Move 从来源变数拷贝n个Bytes到目的变数. ----------------------------------------------------------------------------- Unit System 函数原型 procedure Move(var Source, Dest; Count: Integer); 范例 var A: array[1..4] of Char; B: Integer; begin Move(A, B, SizeOf(B)); { SizeOf = safety! } end; ----------------------------------------------------------------------------- ParamCount 直接由执行档後加上传入变数的个数.(arj.exe a dr.arj d:*.*) ----------------------------------------------------------------------------- Unit System 函数原型 function ParamCount: Integer; 说明 如上例则传回3 Example var
I: Integer; ListItem: string; begin for I := 0 to IBQuery1.ParamCount - 1 do begin ListItem := ListBox1.Items[I]; case IBQuery1.Params[I].DataType of ftString: IBQuery1.Params[I].AsString := ListItem; &n