主题:加分!谁知道longbool??
贺天行宝
[专家分:2300] 发布于 2007-01-28 21:40:00
这是个类型,有谁知道怎么用的?英语好的可看help,我是看不懂,谁帮我一下,谢谢!
回复列表 (共7个回复)
沙发
zhangyuan [专家分:630] 发布于 2007-01-29 19:09:00
从资源占用的角度进行比较
一项boolean 类型的数据占用 1字节的内存;
一项bytebool类型的数据占用 1字节的内存;
一项wordbool类型的数据占用 2字节的内存;
一项longbool类型的数据占用 4字节的内存。
板凳
贺天行宝 [专家分:2300] 发布于 2007-01-29 21:13:00
我要的他们的使用方法,有什么作用,谢谢。
3 楼
angwuy [专家分:2280] 发布于 2007-01-30 12:38:00
Boolean types
There are four predefined boolean types:
Boolean, WordBool, LongBool, and ByteBool.
Syntax:
type
Boolean = (False, True);
WordBool = (False, True);
LongBool = (False, True);
ByteBool = (False, True);
Remarks:
These types are the following sizes:
- Boolean is Byte-sized (8 bits)
- WordBool is Word-sized (16 bits)
- LongBool is Longint-sized (32 bits)
- ByteBool is Byte-sized (8 bits)
Because booleans are enumerated ordinal types,
these relationships apply:
False < True
Ord(False) = 0
Ord(True) = 1
Succ(False) = True
Pred(True) = False
Boolean is the preferred type and uses the
least memory. ByteBool, WordBool, and LongBool
exist primarily to provide compatibility with
Windows .
In an expression, these
relational operators produce results of type
Boolean.
= <> > < >= <= IN
For Windows compatibility, booleans can assume
ordinal values other than 0 and 1.
A boolean expression is considered False when
its ordinal value is 0, and True when its
ordinal value is non-zero.
The not, and, or, and xor boolean operators
work by testing for 0 (False) or non-zero
(True), but always return a result with an
ordinal value of 0 or 1.
4 楼
贺天行宝 [专家分:2300] 发布于 2007-01-30 18:01:00
我看得懂这个还用问你。。。。。。
5 楼
angwuy [专家分:2280] 发布于 2007-01-31 08:02:00
布尔类型:
有四种预定的布尔类型:
Boolean,wordBool,LongBool,ByteBool.
语法:
type
Boolean = (False, True);
WordBool = (False, True);
LongBool = (False, True);
ByteBool = (False, True);
注释:
这些类型是有续类型:
- Boolean 是 Byte-sized (8 字节)
- WordBool 是 Word-sized (16字节)
- LongBool 是 Longint-sized (32 字节)
- ByteBool 是 Byte-sized (8 字节)
因为布尔是枚举类型,
下面是应用:
False < True
Ord(False) = 0
Ord(True) = 1
Succ(False) = True
Pred(True) = False
步尔是首选的类型和用的最少空间.ByteBool, WordBool, 和 LongBool
是提供给Windows的.
在windows下,步尔类型可以用0和1表示
只翻译了一半,由于本人英语水平有限,可能会有些不太准的
6 楼
贺天行宝 [专家分:2300] 发布于 2007-01-31 21:20:00
谢谢你,这么说longbool是没实际作用的咯?
7 楼
angwuy [专家分:2280] 发布于 2007-02-01 08:40:00
好象longbool和boolean在用法上没有区别
我来回复