CMU-CREATE-Lab / create-lab-visual-programmer

The CREATE Lab Visual Programmer application.
http://artsandbots.com/visualprogrammer/
2 stars 1 forks source link

Another bug in export to Arduino #188

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Name a sequence so it starts with a number
2. Export it to Arduino
3. Try double clicking to open it

What is the expected output? What do you see instead?
It should open the Arduino environment and load the exported sequence. Instead 
it opens the Arduino environmnent and loads a blank program and throws a bunch 
of Java exceptions in the bottom.

What version of the product are you using? On what operating system?
1.4.383, Windows 7

Please provide any additional information below.
Probably related to the expressions can't start with numbers thing. Simple fix 
is to detect if first character of a sequence is a numeral, and if so, prepend 
a letter before exporting.

Original issue reported on code.google.com by tlauw...@finchrobot.com on 17 Jan 2015 at 1:38

GoogleCodeExporter commented 9 years ago
Related to issue 186.  I think all we need to do is ensure that saved names 
follow whatever the rules are for identifiers.  Unfortunately, finding those 
rules isn't as easy as it should be.  The best I can find is: "You can name a 
variable any word that is not already one of the keywords in Arduino. Avoid 
beginning variable names with numeral characters." 
(http://www.arduino.cc/en/Reference/VariableDeclaration)

As a start, it's probably helpful to begin with the rules for C: 
http://en.wikibooks.org/wiki/C_Programming/Variables#Naming_Variables

Original comment by garthabr...@gmail.com on 17 Jan 2015 at 3:27