Delphi函数大全.doc

Delphi函数大全.doc

ID:31830636

大小:332.00 KB

页数:53页

时间:2019-01-20

Delphi函数大全.doc_第1页
Delphi函数大全.doc_第2页
Delphi函数大全.doc_第3页
Delphi函数大全.doc_第4页
Delphi函数大全.doc_第5页
资源描述:

《Delphi函数大全.doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、Delphi函数大全首部functionLanguages:TLanguages;$[SysUtils.pas功能返回系统语言对象说明通过此函数可以得到系统的语言环境参考typeSysUtils.TLanguages例子///////BeginLanguagesprocedureTForm1.Button1Click(Sender:TObject);varI:Integer;beginMemo1.Clear;forI:=0toLanguages.Count-1doMemo1.Lines.Add(Languages.Name[I]);end;/////

2、//EndLanguages━━━━━━━━━━━━━━━━━━━━━首部functionAllocMem(Size:Cardinal):Pointer;$[SysUtils.pas功能返回一个指定大小Size的内存块说明配合用FreeMem释放资源参考functionSystem.GetMem例子///////BeginAllocMemprocedureTForm1.Button1Click(Sender:TObject);varI:PInteger;beginI:=AllocMem(SizeOf(Integer));I^:=100;Edit1.T

3、ext:=IntToStr(I^);FreeMem(I,SizeOf(Integer));end;///////EndAllocMem━━━━━━━━━━━━━━━━━━━━━首部procedureAddExitProc(Proc:TProcedure);$[SysUtils.pas功能添加一个退出处理的过程说明建议用finalization部分取代参考例子////////BeginAddExitProcusesShellApi;53procedureExitProc;beginShellExecute(0,'Open','Calc.ex

4、e',nil,nil,SW_SHOW);end;procedureTForm1.Button1Click(Sender:TObject);beginAddExitProc(ExitProc);end;////////EndAddExitProc━━━━━━━━━━━━━━━━━━━━━首部functionNewStr(constS:string):PString;deprecated;$[SysUtils.pas功能返回一个新的字符串指针地址说明字符串S为空时返回NullStr参考procedureSystem.New例子////////BeginN

5、ewStr,DisposeStrprocedureTForm1.Button1Click(Sender:TObject);varP:PString;beginP:=NewStr(Edit1.Text);Edit2.Text:=P^;DisposeStr(P);end;////////EndNewStr,DisposeStr━━━━━━━━━━━━━━━━━━━━━首部procedureDisposeStr(P:PString);deprecated;$[SysUtils.pas功能释放字符串指针P资源说明配合函数NewStr使用参考procedure

6、System.Dispose例子<如上参见,如下参见>━━━━━━━━━━━━━━━━━━━━━首部procedureAssignStr(varP:PString;constS:string);deprecated;$[SysUtils.pas功能将字符串S更新给字符串指针P说明更新值时会释放以前字符串指针的资源参考functionSysUtils.NewStr;functionSysUtils.DisposeStr例子////////BeginAssignStrprocedureTForm1.Button1Click(Sender:TObject)

7、;varP:PString;beginP:=nil;53AssignStr(P,Edit1.Text);Edit2.Text:=P^;DisposeStr(P);end;////////EndAssignStr━━━━━━━━━━━━━━━━━━━━━首部procedureAppendStr(varDest:string;constS:string);deprecated;$[SysUtils.pas功能在字符串Dest后追加字符串S说明相当于Dest:=Dest+S;Delphi6已经不建议使用参考例子////////BeginAppe

8、ndStrprocedureTForm1.Button1Click(Sender:TObject);varS

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。