View unanswered posts | View active topics It is currently Sat Sep 19, 2020 5:44 pm

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

Joined: Fri Feb 11, 2011 10:33 am
Posts: 27
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
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.

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

Robots rule!

Wed Mar 16, 2011 8:09 am

Joined: Fri Feb 11, 2011 10:33 am
Posts: 27
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
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.