DW> I suspect there are a lot of people in this conference, many of them
DW> quite competent programmers, who neither know nor care about the
DW> Boolean AND function! It exists, but it isn't usually *thought of*
DW> as a very important aspect of BASIC. (True, on a lower level, the
DW> "logical" AND, as in IF X=1 AND Y=2 THEN..., is really Boolean, but
DW> most people don't think on that level, nor do they need to.)
And yet, sometimes it would help them. The
statement:
IF x THEN
really means
IF x0 THEN
I have gotten into trouble by writing:
IF x AND y THEN
Using the values you gave, x=1, y=2, this does not work
as I had expected. It does NOT say:
IF x0 AND y0 THEN
as one might think from the first example. The first
time I had it happen, it took me quite a while to
realize that Boolean Algebra was being used:
00000001
AND 00000010
is 00000000
The statement was indeed false when I was expecting
otherwise. There's another way of writing that, of
course:
IF x * y THEN
will be true if both are not equal to 0. The Boolean
expression will compile smaller, I believe.
FIDO: Bill White @ 1:135/110 (Miami)
InterNet: bill.white@110.sunshine.com
* SLMR 2.1a * When friends offer help, let them!
--- Maximus 2.01wb
---------------
* Origin: Miami Amateur Computer Club BBS/USR Courier V.E (1:135/110)
|