最近碰到一些问题,查了帮助才知道
A Boolean variable occupies one byte of memory, a ByteBool variable also occupies one byte, a WordBool variable occupies two bytes (one word), and a LongBool variable occupies four bytes (two words).所以 Boolean(256)、Boolean(1024)等等都是False真是杯具,写了好多代码都用if Boolean(I) then来判断大于0为True的估计很多错误都不知道怎么办咯,。。
A Boolean variable occupies one byte of memory, a ByteBool variable also occupies one byte, a WordBool variable occupies two bytes (one word), and a LongBool variable occupies four bytes (two words).所以 Boolean(256)、Boolean(1024)等等都是False真是杯具,写了好多代码都用if Boolean(I) then来判断大于0为True的估计很多错误都不知道怎么办咯,。。
解决方案 »
- midas三层架构,其他客户端都可以连接服务器,只有98操作系统的客户端连不到服务器
- DTS包在Delphi中可以被指定的为定义吗?
- IntraWeb中如何使用OCX或者TSocketClient?
- delphi中有没有把文本数据导入数据库的函数或控件!
- 关于Activex的注册(高难度,加分)
- 500~高分求够~企业开发报表应用~推崇一个控件
- 兼职
- 哪里有压缩与解压文件程序的原码呢?100分
- 请问TDataTime在哪里定义的?
- 转换字符为asc码的函数,另请问有无delphi常用函数的资料下载
- delphi 怎样将一个PByte类型 拷贝到内存,再将它们分配给bitmap 然后保存成bmp图像?
- 企业应用开发的点滴体会
case Byte of
0:(Int : Integer);
1:(bs:array [1..4]of Byte);
2:(bbb:Boolean);
end;
var
Form1: TForm1;
Data : TData;
implementation{$R *.dfm}procedure TForm1.FormCreate(Sender: TObject);
begin
Data.int := 255;//bbb=true//bs[1]=255
Data.int := 256;//bbb=False//bs[1]=0
Tag := Data.Int;
end;
其实是判断不等于0, if BOOL(I) then不能判断是否不等于0,也不能判断是否等于0,你可以试试,
Boolean(256)=Boolean(0)