View unanswered posts | View active topics It is currently Thu Jul 24, 2014 2:26 am






Reply to topic  [ 3 posts ] 
A design feature? 
Author Message
Rookie

Joined: Fri Feb 11, 2011 10:33 am
Posts: 26
Post A design feature?
I inadvertently used “time1” as an integer parameter to a procedure. RobotC accepted this, the only “warning” being that time1 was coloured blue, instead of black. I experimented, and noted that several other time-related variables could also be used in a similar, possibly undesirable, manner. Is this a design feature of RobotC? If not, would it be worth the compiler giving a warning?
Incidentally, the program ran OK using time1 as a parameter...


Wed Mar 16, 2011 12:16 am
Profile
Rookie
User avatar

Joined: Sat Jul 17, 2010 3:41 pm
Posts: 19
Post Re: A design feature?
"time1" is used as an array (though not a standard one), so it makes sense that if used as a normal variable or parameter it would work fine. I've experienced before that if you have a variable with the same name as an array (such as dist and dist[]) they don't conflict.

_________________
NOTE:
This Star Wars fan thinks the droids should have won the Clone Wars.

Robots rule!


Wed Mar 16, 2011 8:09 am
Profile
Rookie

Joined: Fri Feb 11, 2011 10:33 am
Posts: 26
Post Re: A design feature?
Thanks for this information - I'm surprised they don't conflict. I'll keep this information in mind, but will try not to use it, as I think the dual use would be confusing...


Sat Mar 19, 2011 2:21 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.