From: "Peter Lewerin" 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 Precedence: bulk A. Sinan Unur 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.