Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
BOOL Datatype
Message
From
12/04/2000 04:29:19
 
 
To
11/04/2000 23:30:20
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
Miscellaneous
Thread ID:
00357504
Message ID:
00358570
Views:
10
>Well the same argument goes for 1 as well as for -1! Regardless of the number of bytes used to store a logical
>value, NOT 0 equals 1 (even if not bitwise NOT). One important reason may be that with 1 as TRUE, eventually,
>a logical value could be stored on only one bit (which would not be possible with -1).

>Vlad

>>I'm not sure why you're surprised. C++ does use a non-zero value positive integer, 1. VB, OTOH, uses -1. The latter I can understand because regardless of the number of bytes, the bitwise compliment (NOT 0, or in VFP BITNOT(0)) of 0 (False) will be -1. Defining True recursively as NOT False makes more sense to me than defining it independently.

I still think it's a big mistake to assume that TRUE & FALSE have numeric values. The nature of computers is that they have to be stored in bits & bytes, it is how they are interpreted, a 4 byte floating point number could be looked at as represented by 4 single byte integers, but no one would really consider doing that, so why discuss the integer value of logical representations ? 0 just happens to be a convenient representation for FALSE, allowing use of processor flags, but there is no reason why this should be the case.

Regards
Mike
Mike

"I can live with doubt and uncertainty and not knowing. I think it is much more interesting to live not knowing than to have answers that might be wrong." - Richard Feynman
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform