View unanswered posts | View active topics It is currently Tue Mar 31, 2020 10:08 pm

Reply to topic  [ 2 posts ] 
setFriendlyName("Name"); not working in RobotC 3.60 
Author Message

Joined: Wed Jun 30, 2010 7:15 am
Posts: 181
Post setFriendlyName("Name"); not working in RobotC 3.60
So yeah, post title says it all. This code doesn't compile:
void btLSetUp(bool masterOrSlave){ //true = master; false = slave
   if(masterOrSlave == true)
I get this error for both times setFriendlyName is called:
**Error**:'const' expressions does not fit. Call to 'setFriendlyName'. Parameter: 'unsigned string & sFriendlyName' is '"Jeeves"' of type 'string'.
From the documentation, I don't see how I'm calling it wrong. Bug?

- Leon


Thu May 02, 2013 5:45 pm
Profile WWW
Site Admin
Site Admin
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3654
Location: Rotterdam, The Netherlands
Post Re: setFriendlyName("Name"); not working in RobotC 3.60
It has to do with pointers, I suspect. In any case, this bit of code works quite nicely:
void btLSetUp(bool isMaster){ //true = master; false = slave
  string name;
  name = (isMaster) ? "Albert" : "Jeeves";

task main()

I've tested this with ROBOTC 3.60.

= Xander

| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]

Fri May 03, 2013 1:33 am
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 2 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.