View unanswered posts | View active topics It is currently Sun Dec 21, 2014 1:54 am






Reply to topic  [ 6 posts ] 
[Problem]Cannot compile Sample Programs w/ClearMessage() 
Author Message
Rookie

Joined: Mon Jun 23, 2014 5:12 am
Posts: 4
Post [Problem]Cannot compile Sample Programs w/ClearMessage()
I am trying to interface a bluetooth barcode scanner with the Mindstorm NXT, but when I tried the sample programs to wrap my head around working with BT, I hit a problem. None of the codes with the line "ClearMessage();" work. I get the following error:

Code:
**Error**:Invalid assignment to a non-variable
**Error**:Unexpected scanner token-> '0'


I've seen someone else struggle with this, but without success. I am using RobotC Version 3.05. Please help, I'm on a bit of a deadline and need to get this running asap.
Thanks in advance!


Mon Jun 23, 2014 5:22 am
Profile
Professor
User avatar

Joined: Sat Aug 31, 2013 9:15 am
Posts: 214
Post Re: [Problem]Cannot compile Sample Programs w/ClearMessage()
Can you post your code so we can see what's going on? Guessing from the error messages, you don't happen to have something like
Code:
ClearMessage() = 0

do you?

_________________
FTC Team 6100 Chariots of Fire - Programmer (2012-2013)
FTC Team 7468 Blue Chariots of Fire - Programmer (2013-2014)
FTC Team 7468 Blue Chariots of Fire - Mentor (2014-2015)
Check out our team website at http://bluechariotsoffire.com/.


Mon Jun 23, 2014 9:13 am
Profile
Rookie

Joined: Mon Jun 23, 2014 5:12 am
Posts: 4
Post Re: [Problem]Cannot compile Sample Programs w/ClearMessage()
Here's the function with the most errors, but it's literally just from the BtBasicMsg.c sample file
Code:
void readMessages()
{
   static int nLastMessage = 0;

   while (true)
   {
     nMessage = message;
     if (nMessage != 0)
     {
        ++nNearEndRead;// Keep a running count of the number of messages successfully read
        if (nMessage != (nLastMessage + 1))
          ++nReadOutOfSequence;
        nLastMessage = nMessage;
        nFarEndSent  = messageParm[1];
        nFarEndRead  = messageParm[2];
        ClearMessage();
         nElapsedTime  = nPgmTime;
      }
      else
        ++nRcxNoMsg;
      wait1Msec(1);
   }
}


robotcintrinsics.c has it defined as such:
Code:
  #define ClearMessage()                             message = "0"

Any ideas?


Mon Jun 23, 2014 2:34 pm
Profile
Professor
User avatar

Joined: Sat Aug 31, 2013 9:15 am
Posts: 214
Post Re: [Problem]Cannot compile Sample Programs w/ClearMessage()
Does yours have quotes around it? That would seem to be odd, since robotcintrinsics.c in 3.62 has the following:
Code:
 #define ClearMessage()                             message = 0

_________________
FTC Team 6100 Chariots of Fire - Programmer (2012-2013)
FTC Team 7468 Blue Chariots of Fire - Programmer (2013-2014)
FTC Team 7468 Blue Chariots of Fire - Mentor (2014-2015)
Check out our team website at http://bluechariotsoffire.com/.


Wed Jun 25, 2014 10:18 am
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3297
Location: Rotterdam, The Netherlands
Post Re: [Problem]Cannot compile Sample Programs w/ClearMessage()
Hey there,

This sounds a bit like a bug. Did you try contacting support@robotc.net? Please post their response here, so that it may help others :)

= 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]


Thu Jun 26, 2014 12:05 am
Profile WWW
Rookie

Joined: Mon Jun 23, 2014 5:12 am
Posts: 4
Post Re: [Problem]Cannot compile Sample Programs w/ClearMessage()
Sorry for the prolonged silence.

I have updated to version 3.62 and the program compiles as expected.

BurningLights wrote:
Does yours have quotes around it? That would seem to be odd, since robotcintrinsics.c in 3.62 has the following:
Code:
 #define ClearMessage()                             message = 0


I tried with and without, but the line was the same on my side. It was just a bug it seemed.


Mon Jun 30, 2014 8:30 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 6 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.