Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Key Word (Read 5461 times)
James Brown
Junior Member
**
Offline


Posts: 46
Location: Near San Diego
Joined: Jul 31st, 2012
Key Word
Dec 2nd, 2012 at 5:44pm
Print Post  
I ran into problems when I attempted to use 'analog' as a constant defination in a sketch.
Code
Select All
#define analog 1
 


This compiled fine under VS but failed with:
Code
Select All
ERGO2:12: error: expected ',' or '...' before numeric constant
 


when compiled under Arduino 1.0.2.
Changing the name of the constant to anything else:
Code
Select All
#define analogg 1
 


and it works fine under both systems.

Are there other keywords that need to be avoided?
  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Key Word
Reply #1 - Dec 2nd, 2012 at 5:59pm
Print Post  
I don't have time to test this so maybe you could repeat the test just to be sure.

The error in the arduino ide might have been some other confusion in your code although what you describe seems very clear  Undecided 

Both vs and arduino use the same compiler so it's difficult for me to see how they could produce different results.

+ The question is what keywords does Arduino reserve? If they do there will be a list somewhere and I have never seen this in their code.
  
Back to top
IP Logged
 
James Brown
Junior Member
**
Offline


Posts: 46
Location: Near San Diego
Joined: Jul 31st, 2012
Re: Key Word
Reply #2 - Dec 2nd, 2012 at 6:28pm
Print Post  
I did retry it several times and attempted to simplify my code to the point that it could be zipped and sent to you.  That turned out to be more work than I wanted to do.
I am *very* sure that the only way it fails is when the #define is 'analog'.  All other spellings work fine on both systems.   
I'll attempt to simplify it once more...
  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Key Word
Reply #3 - Dec 2nd, 2012 at 6:45pm
Print Post  
Thanks for that. I'll give it a go and see why that is.
  
Back to top
IP Logged
 
Evan
Junior Member
**
Offline


Posts: 27
Location: Northeast U.S.A.
Joined: Oct 25th, 2012
Re: Key Word
Reply #4 - Dec 5th, 2012 at 1:42am
Print Post  
Works fine for me with both VS2010+VM and Arduino 1.0.2.  Code follows:

#define analog 42

void setup() {      
    int myVar = analog ;
}

void loop() { }


The diagnostic ERGO2:12 is similar to some I've seen and usually reflects a problem elsewhere in the module.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Key Word
Reply #5 - Dec 5th, 2012 at 1:45pm
Print Post  
Thanks for testing. I thought that would be the case.
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint