搜索
编程论坛
→
开发语言
→
『 Delphi论坛 』
→ [求助]请教Format函数的一用法
标题:
[求助]请教Format函数的一用法
只看楼主
luperfect
等 级:
新手上路
帖 子:65
专家分:0
注 册:2005-4-23
楼主
问题点数:0 回复次数:1
[求助]请教Format函数的一用法
在执行SQL语句时,经常用到format函数,如:mysql:=format('select * from abc where name=''%s'', count=%d',[...]);
其中,%s代表字符型,%d代表数值型,但如果要代表一个逻辑型变量(true/false),如何表示呢?
搜索更多相关主题的帖子:
Format
函数
SQL
用法
format
2005-10-07 15:36
makebest
等 级:
蝙蝠侠
威 望:
3
帖 子:658
专家分:962
注 册:2005-3-17
第
2
楼
得分:0
这个问题根本就是 DELPHI 的问题,顺便答一下吧,的确没有找到逻辑类型的格式化描述,但是总有办法解决:
var
s:string;
function tf(t:boolean):string;
begin
if t then result:='true' else result:='false';
end;
begin
s:=format('It''s %s',[tf(true)]);
showmessage(s);
end;
2005-10-21 20:19
2
1/1页
1
参与讨论请移步原网站贴子:
https://bbs.bccn.net/thread-29499-1-1.html
关于我们
|
广告合作
|
编程中国
|
清除Cookies
|
TOP
|
手机版
编程中国
版权所有,并保留所有权利。
Powered by
Discuz
, Processed in 0.427028 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved