选择显示字体大小

delphi6函数大全(11)

首部 procedure strdispose(str: pchar); $[sysutils.pas
功能 释放指针字符串str内存资源
说明 如果str为nil则不作任何处理;并且释放空间大小信息
参考 function system.dec;function system.sizeof;function system.freemem

例子 <参见strnew>
━━━━━━━━━━━━━━━━━━━━━
首部 function format(const format: string; const args: array of const): string; &#36;[sysutils.pas
功能 返回按指定方式格式化一个数组常量的字符形式
说明 这个函数是我在delphi中用得最多的函数,现在就列举几个例子给你个直观的理解
"&#37;" [索引 ":"] ["-"] [宽度] ["." 摘要] 类型
format('x=&#37;d', [12]); //'x=12' //最普通
format('x=&#37;3d', [12]); //'x= 12' //指定宽度
format('x=&#37;f', [12.0]); //'x=12.00' //浮点数
format('x=&#37;.3f', [12.0]); //'x=12.000' //指定小数
format('x=&#37;.*f', [5, 12.0]); //'x=12.00000' //动态配置
format('x=&#37;.5d', [12]); //'x=00012' //前面补充0
format('x=&#37;.5x', [12]); //'x=0000c' //十六进制
format('x=&#37;1:d&#37;0:d', [12, 13]); //'x=1312' //使用索引
format('x=&#37;p', [nil]); //'x=00000000' //指针
format('x=&#37;1.1e', [12.0]); //'x=1.2e+001' //科学记数法
format('x=&#37;&#37;', []); //'x=&#37;' //得到"&#37;"
s := format('&#37;s&#37;d', [s, i]); //s := s + strtoint(i); //连接字符串
参考 proceduer sysutils.fmtstr
例子 edit1.text := format(edit2.text, [strtofloatdef(edit.3.text, 0)]);
━━━━━━━━━━━━━━━━━━━━━
首部 procedure fmtstr(var result: string; const format: string; const args: array of const); &#36;[sysutils.pas
功能 按指定方式格式化一个数组常量的字符形式返回
说明 <参见format>
参考 function sysutils.formatbuf;function system.length;function system.setlength
例子 <参见format>
━━━━━━━━━━━━━━━━━━━━━
首部 function strfmt(buffer, format: pchar; const args: array of const): pchar; &#36;[sysutils.pas
功能 返回按指定方式格式化一个数组常量的字符指针形式
说明 如果buffer和format其中只要有一个为nil则返回nil
参考 function sysutils.formatbuf
例子 <参见format>
━━━━━━━━━━━━━━━━━━━━━
首部 function strlfmt(buffer: pchar; maxbuflen: cardinal; format: pchar; const args: array of const): pchar; &#36;[sysutils.pas
功能 返回按指定方式和长度格式化一个数组常量的字符指针形式
说明 strlfmt(vbuffer, 6, '&#37;d12345', [1024]) = '10241';
参考 function sysutils.formatbuf
例子 <参见format>
━━━━━━━━━━━━━━━━━━━━━
首部 function formatbuf(var buffer; buflen: cardinal; const format; fmtlen: cardinal; const args: array of const): cardinal; &#36;[sysutils.pas
功能 返回按指定方式格式化一个数组常量到缓冲区buffer中
说明 <null>
参考 <null>
例子 <参见format>
━━━━━━━━━━━━━━━━━━━━━
首部 function wideformat(const format: widestring; const args: array of const): widestring; &#36;[sysutils.pas
功能 返回按指定方式格式化一个数组常量的多字节字符形式
说明 <null>
参考 procedure sysutils.widefmtstr
例子 <参见format>
━━━━━━━━━━━━━━━━━━━━━
首部 procedure widefmtstr(var result: widestring; const format: widestring; const args: array of const); &#36;[sysutils.pas
功能 按指定方式格式化一个数组常量的多字节字符形式返回
说明 <null>
参考 function sysutils.wideformatbuf
例子 <参见format>
━━━━━━━━━━━━━━━━━━━━━
首部 function wideformatbuf(var buffer; buflen: cardinal; const format; fmtlen: cardinal; const args: array of const): cardinal; &#36;[sysutils.pas
功能 返回按指定方式格式化一个数组常量到缓冲区buffer中
说明 <null>
参考 <null>
例子 <参见format>
━━━━━━━━━━━━━━━━━━━━━
首部 function floattostr(value: extended): string; &#36;[sysutils.pas
功能 返回浮点数value转换成字符串
说明 当浮点数大等于1e15将采用科学记数法
参考 function sysutils.floattotext
例子 edit1.text := floattostr(now);
━━━━━━━━━━━━━━━━━━━━━
首部 function currtostr(value: currency): string; &#36;[sysutils.pas
功能 返回货币数value转换成字符串
说明 货币数只保留四位小数
参考 function sysutils.floattotext
例子 edit1.text := currtostr(now);
━━━━━━━━━━━━━━━━━━━━━
首部 function floattocurr(const value: extended): currency; &#36;[sysutils.pas
功能 返回浮点数value转换成货币数
说明 如果浮点数value超出范围则将触发异常
参考 const sysutiles.mincurrency;const sysutiles.maxcurrency
例子 edit1.text := currtostr(floattocurr(now));
━━━━━━━━━━━━━━━━━━━━━
首部 function floattostrf(value: extended; format: tfloatformat; precision, digits: integer): string; &#36;[sysutils.pas
功能 返回浮点数以指定格式转换成字符串
说明 precision指定精度;digits指定小数宽度
参考 function sysutils.floattotext
例子
///////begin floattostrf
procedure tform1.button1click(sender: tobject);
begin
memo1.lines.values['ffgeneral'] := floattostrf(strtofloatdef(edit1.text, 0),
ffgeneral, spinedit1.value, spinedit2.value);
memo1.lines.values['ffexponent'] := floattostrf(strtofloatdef(edit1.text, 0),
ffexponent, spinedit1.value, spinedit2.value);
memo1.lines.values['fffixed'] := floattostrf(strtofloatdef(edit1.text, 0),
fffixed, spinedit1.value, spinedit2.value);
memo1.lines.values['ffnumber'] := floattostrf(strtofloatdef(edit1.text, 0),
ffnumber, spinedit1.value, spinedit2.value);
memo1.lines.values['ffcurrency'] := floattostrf(strtofloatdef(edit1.text, 0),
ffcurrency, spinedit1.value, spinedit2.value);
end;
///////end floattostrf


 


关键字 本文所属关键字

相关 与本文相关文章

分类 所有文章关键字导航

源码编程相关

Java   Asp   PHP   .Net   XML   C/C++   CGI   VB   Jsp   J2ee   J2se   J2me   EJB   Servlet   Tomcat   Resin   Struts   Weblogic   Eclipse   ANT   GUI   JMS   Web servise   IDEA   Webphere   Hibernate   Spring   Jboss   Applet   Swing   Socket   Javamail   Perl   Ajax   P2P   安全   模式   框架   测试   开源   游戏

SQL数据库相关

My-SQL   Ms-SQL   Access   DB2   Oracle   Sybase   SQLserver   索引   存储过程   加密   数据库   分页   视图  

手机无线相关

3G   Wap   CDMA   GRPS   GSM   IVR   彩信   短信   无线   增值业务

网页设计制作相关

HTML   CSS   网页配色   网页特效   Javascript   VBscript   Dreamweaver   Frontpage   JS   Web   网站设计

网站建设推广相关

建站经验   网站优化   网站排名   推广   Alexa

操作系统/服务器相关

Windows XP   Windows 2000   Windows 2003   Windows Me   Windows 9.x   Linux   UNIX   注册表   操作系统   服务器   应用服务器

图形图像多媒体相关

Photoshop   Fireworks   Flash   Coreldraw   Illustrator   Freehand   Photoimpact   多媒体   图形图像

标准 网站致力的规范

Valid CSS!

无不良内容,无不良广告,无恶意代码

Valid XHTML 1.0 Transitional

creativecommons