Go to Post In my 30 year career, one thing I have learned is that if you truly enjoy your work, you'll be good at it. - DonRotolo [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 Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Spotlight this post!  
Unread 26-01-2005, 20:23
jdong jdong is offline
Linux Nerd
AKA: John D
#0245 (Adam-Bots)
Team Role: Programmer
 
Join Date: Apr 2004
Location: Rochester, MI
Posts: 98
jdong will become famous soon enoughjdong will become famous soon enough
Re: Weird problem with if statements

Someone who's studied C++ Operator Overloading could tell you that the equals operator has similar to the following declaration:

int & operator=(int & left_hand_side, int & right_hand_side)

That is, the assignment operator returns a reference to the assigned value, allowing chaining (I think a better term) of assignments. As long as you assign a non-zero number, this statement will evaluate to TRUE. Definitely not the behavior you want....

Good for cheats, like assigning a NULL pointer within an IF statement would return FALSE, causing the block of code to be skipped. Good for experts, nightmare for beginners.
__________________
John Dong
Co-Captain, Webmaster / Programmer
Team 245 -- Rochester Adams Robotics
 


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 Problem: Extremely Frustrating chantilly_team Programming 19 12-02-2005 23:00
Physics Problem Venkatesh Math and Science 13 30-11-2004 20:30
Weird Output from Dashboard Port Ian W. Programming 9 06-03-2004 21:33
The problem with scouting... archiver 2001 10 23-06-2002 23:49
Major problem with chipphua motors aka Scott White Motors 18 19-03-2002 19:44


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

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