www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/05/18/15:17:38

From: "Peter Lewerin" <peter DOT lewerin AT krax DOT pp DOT se>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Thanks, HELP! mouse problems
Date: 18 May 1997 13:21:56 GMT
Organization: -
Message-ID: <01bc638e$95de2200$LocalHost@peterlew>
References: <01bc6257$9ed88cc0$LocalHost AT stachowiak> <337E0EE4 DOT 1DB7F3F2 AT cornell DOT edu>
NNTP-Posting-Host: dialup156-2-10.swipnet.se
NNTP-Posting-User: s-36170
Lines: 15
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

A. Sinan Unur <asu1 AT cornell DOT edu> skrev i inlägg
<337E0EE4 DOT 1DB7F3F2 AT cornell DOT edu>...
> >   if ((mouse_b & 1) & (mouse_x > fx) & (mouse_x < lx) & (mouse_y > fy)
& (mouse_y < ly))
> 
> no. the problem is that you are using bitwise and rather than logical
> and. replace the &'s with &&'s.

In this particular case it doesn't make any difference, as all the operands
will have values of either 1 or 0, and the precedence difference is taken
care of by the parentheses.

It would be better to use logical ands, but it's not the problem.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019