Go to Post Deodorant cannot be stressed enough. To quote a teammate "body odor is a body don't-or." - C. De Vries [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 30-11-2002, 16:19
Steve Shade Steve Shade is offline
Registered User
no team
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1999
Location: Pasadena, MD
Posts: 78
Steve Shade has much to be proud ofSteve Shade has much to be proud ofSteve Shade has much to be proud ofSteve Shade has much to be proud ofSteve Shade has much to be proud ofSteve Shade has much to be proud ofSteve Shade has much to be proud ofSteve Shade has much to be proud ofSteve Shade has much to be proud of
Re: Thanks everyone!

Quote:
Originally posted by Cheese Head
if ~(p1_y > 127 & p2_y > 127) then next2
Is there anything wrong with that?
Yes, there are a few mistakes in this expression form what i assume you are trying to accomplish. You are forgetting the order of opperations in P-BASIC. That is expressions are evaluated Left to right inside of each level of parentheses. So in your expression, this is what is really evaluated: ~(((p1_y>127) & p2_y) > 127) which is not what you are looking for. Also, you will never get a 0 value, you will always have a value > 0 because of the leading 1's (see my post above for the explanation). So the if statement will always evaluate true.
The easiest way to fix that is to sue NOT instead of ~ in the middle of the if statement. This will not work for stand alone calculations. Another option is to subtract out the 65534 after the ~ operation.

Steve
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
I'll delete this in a couple of hours. hixofthehood Chit-Chat 9 04-02-2003 23:26
couple of questions... archiver 2001 5 23-06-2002 22:48
A couple of problems I observed at the MAR archiver 2000 3 23-06-2002 22:27
Couple other thank yous Jason Haaga Thanks and/or Congrats 0 29-04-2002 03:29
A Couple Questions about Chairman's Award ben_whly Chairman's Award 4 26-01-2002 18:24


All times are GMT -5. The time now is 04:25.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi