Delphi初学者遇到的问题。 var f:boolean; i:integer;begin f:=false; i:=ord(f);//利用ord可以转换成integer edit1.text:=inttostr(i);edit1中显示为0 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 Delphi提供了这样的函数Function BoolToStr(B: Boolean; UseBoolStrs: Boolean = False): string;例如: edit1.txt:=Booltostr(3<4); //文本框中显示的是'0' edit1.txt:=Booltostr(true); //文本框中显示的是'-1' edit1.txt:=Booltostr(false,true); //文本框中显示的是'False' edit1.txt:=Booltostr(2=3-1,true); //文本框中显示的是'True' if f = false then edit1.text:= 'false'// edit1.text:= '0' else edit1.text:= 'true';// edit1.text:= '1'; var f:boolean; i:integer;begin f:=false; if f then i:=0; if not f then i:=1; edit1.text:=inttostr(i);对不对?你是不是想知道f是真还是假? 可以利用booltostr函数将Boolean值转换为string类型,可以再通过strtoint函数转换成integer类型例如var str:string; i:integer;begin str:=booltostr(true); i:=strtoint(str);end; 计算字符数-要求效率最高的 求nec versapro va60j的声卡,显卡驱动程序 在SQL SERVER2000中运行通过。。如何将@path 到DELPHI中的变量里来,用ADOQUERY? 为什么我的pws安装时提示需要winsock32?? 一个类变量执行Destroy中代码的时候,其中的数据是否已开始释放? 怎么在我的程序中打开写字板,并在写字板中写几行字? 抗议抗议抗议,代码帖上去为啥格式都没得了!!!!! 解决程序员的生活问题? 非常急的问题(一定给分) 关于动态菜单实现的问题 请问这是怎么回事 想和各位讨论一下c中指针是如何实现动态数组的。
Function BoolToStr(B: Boolean; UseBoolStrs: Boolean = False): string;
例如:
edit1.txt:=Booltostr(3<4); //文本框中显示的是'0'
edit1.txt:=Booltostr(true); //文本框中显示的是'-1'
edit1.txt:=Booltostr(false,true); //文本框中显示的是'False'
edit1.txt:=Booltostr(2=3-1,true); //文本框中显示的是'True'
edit1.text:= 'false'
// edit1.text:= '0'
else
edit1.text:= 'true';
// edit1.text:= '1';
f:boolean;
i:integer;
begin
f:=false;
if f then
i:=0;
if not f then
i:=1;
edit1.text:=inttostr(i);
对不对?你是不是想知道f是真还是假?
函数转换成integer类型
例如
var
str:string;
i:integer;
begin
str:=booltostr(true);
i:=strtoint(str);
end;