当前位置:首页>开发>正文

delphi中的format函数如何换行,下面语句如何换行。 求助:关于Format函数的用法

2023-05-04 10:12:28 互联网 未知 开发

 delphi中的format函数如何换行,下面语句如何换行。 求助:关于Format函数的用法

delphi中的format函数如何换行,下面语句如何换行。

你是要这个效果吗?
ADOQuerysave.sql.add(Format(SELECT Animal.BarnName as a,Animal.Birthday as b,                                 Breed.BreedName as c   
                            FROM Animal INNER JOIN Breed ON     
                            Animal.BreedID = Breed.BreedID  
                            Where Animal.Purposecode=%d   
                            ORDER BY Animal.Birthday, [Purposecode]))

求助:关于Format函数的用法

//fromhttp://kingron.myetang.com首部 function Format(const Format array of const): string $[SysUtils.pas功能 返回按指定方式格式化一个数组常量的字符形式说明 这个函数是我在Delphi中用得最多的函数,现在就列举几个例子给你个直观的理解"%" [索引 "] [宽度] ["." 摘要] 类型Format(x=%d, ) //x=12 //最普通Format(x==, ) //x= 12 //指定宽度Format(x=%f, ) //x=12.00 //浮点数Format(x=%.3f, ) //x=12.000 //指定小数Format(x=%.*f, [5, 12.0]) //x=12.00000 //动态配置Format(x=%.5d, ) //x=00012 //前面补充0Format(x=%.5x, ) //x=0000C //十六进制Format(x=%1%0, [12, 13]) //x=1312 //使用索引Format(x=%p, ) //x=00000000 //指针Format(x=%1.1e, ) //x=1.2E 001 //科学记数法Format(x=%%, ) //x=% //得到"%"S Format(%s%d, [S, I]) //S S StrToInt(I) //连接字符串参考 proceduer SysUtils.FmtStr例子 Edit1.Text Format(Edit2.Text, [StrToFloatDef(Edit.3.Text, 0)])

delphi perform函数的参数详解

perform是给自己发消息,所以同SendMessage或PostMessage的区别只在于少了第一个HWND参数,
perform(WM_MESG,WPARAM,LPARAM)
可以打开Messages.pas,参考DELPHI所用(不仅仅Windows标准消息,还有很多VCL所用自定义消息也在里面)的消息结构及定义。

最新文章

随便看看