View Single Post
  #4   Spotlight this post!  
Unread 05-01-2007, 10:29
Donut Donut is online now
The Arizona Mentor
AKA: Andrew
FRC #2662 (RoboKrew)
Team Role: Engineer
 
Join Date: Mar 2005
Rookie Year: 2004
Location: Goodyear, AZ
Posts: 1,292
Donut has a reputation beyond reputeDonut has a reputation beyond reputeDonut has a reputation beyond reputeDonut has a reputation beyond reputeDonut has a reputation beyond reputeDonut has a reputation beyond reputeDonut has a reputation beyond reputeDonut has a reputation beyond reputeDonut has a reputation beyond reputeDonut has a reputation beyond reputeDonut has a reputation beyond repute
Re: Why it works with an underscore?

Quote:
Originally Posted by Stuart View Post
ohh also remember that = is assignment and == is compare
Remember this or you will have an infinite number of problems everytime you load code to your robot.

Nothing hurts more than to discover that a single = in an if statement actual assigns that value to that variable, rather than comparing it.

I don't know why the underscore thing would be an issue; I know MPLAB tends to blow up on variables with spaces, but single words have always worked fine for me.

It might have something to do with the fact you're using numbers in the name; you might need so many letters in your variable before you can use a number.
__________________
FRC Team 498 (Peoria, AZ), Student: 2004 - 2007
FRC Team 498 (Peoria, AZ), Mentor: 2008 - 2011
FRC Team 167 (Iowa City, IA), Mentor: 2012 - 2014
FRC Team 2662 (Tolleson, AZ), Mentor: 2014 - Present