TIP: Click on subject to list as thread! ANSI
echo: quik_bas
to: CHRIS GUNN
from: DAVID WILLIAMS
date: 1998-05-25 18:05:00
subject: Re: Question

-> DR>         IF SizeX! AND SizeY! > 1 then
->                ^^^^^^^^^^^^^^^^^
->
-> QuickBasic will process the underlined portion as binary first, then
-> see if it's bigger than one.
Actually, no! Boolean operators are always processed *after* equalities
or inequalities, unless brackets are used to force another order. So the
above expression is equivalent to:
IF SizeX! AND (SizeY! > 1) THEN
So the consequence of the IF will be executed if SizeY! is greater than
one, and SizeX! has any non-zero value.
Try it with, say, SizeX! equal to 2 and SizeY! equal to -1. Your
interpretation, ANDing the two Sizes first, would lead to the IF
consequence being executed. (2 AND -1) would come to 2, which is greater
than 1. But in fact the IF consequence will not be executed, since
SizeY! is not greater than 1.
                             dow
--- PCBoard (R) v15.3 (OS/2) 5
---------------
* Origin: FidoNet: CAP/CANADA Support BBS : 416 287-0234 (1:250/710)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.