Go to Post you know you are addicted to first when u crave sprockets for breakfast! - Jones571 [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

 
 
 
Thread Tools Rating: Thread Rating: 4 votes, 5.00 average. Display Modes
Prev Previous Post   Next Post Next
  #21   Spotlight this post!  
Unread 06-02-2006, 08:27
tpc's Avatar
tpc tpc is offline
Registered User
AKA: Tom Convery
FRC #0623 (Cougar Robotics)
Team Role: Mentor
 
Join Date: Feb 2006
Rookie Year: 2006
Location: Falls Church, VA
Posts: 7
tpc is on a distinguished road
Re: Stupidest Programming Mistakes

Quote:
Originally Posted by chakorules
Burns me ALL this time....don't forget to use DOUBLE equal signs....
This is why I always write the constant first, when comparing equality between a constant and a variable:

Code:
if (1 == variable)
{
  /* do something */
}
Then if I inadvertently use an assignment rather than a comparison, it's a compile-time error (can't assign a value to a constant).
 


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
Programming Vex w/ MPLab dababyjebus FIRST Tech Challenge 27 25-04-2008 09:11
Programming - Getting Started Mark McLeod Programming 80 16-04-2008 23:37
VEX programming Gene F Programming 14 08-08-2006 22:21
Suggestion for Delphi Programming Posts Chris Hibner CD Forum Support 1 27-07-2005 10:02
Robot Programming Education phrontist Programming 11 03-05-2004 07:32


All times are GMT -5. The time now is 14:46.

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