Illegal Java needed for javaScript? Can some one explain me this part of variableInput example?
If you open examples after selecting javaScript from modes menu, different examples show up. One of them is a cool example on how to use javaScript to build and use HTML form's elements as inputs for a sketch. I could not find this online so I pasted it here:
https://gist.github.com/anonymous/6042811
Anyway in that example there is this lines of code (isolated by me):
- String[] menuItems;
- void setup ()
- {
- menuItems = new String[] {
- new String[] {"Rectangle"}, new String[] {"Ellipse"},
- new String[] {"Star"}, new String[] {"Spirograph"}
- };
- }
Well I don't know this kind of initialisation for an array, and if I run this code in Java mode it gives me a
"cannot convert from String[] to String"
So appears that the compiler doesn't know it also... What is this?
When I tried to remove all the new Strings[] the menu created only shows the first letter of each string...
I'm founding very difficult to work in javaScript mode,
as there is no messages from complier and debugging is much harder, and now this...
I don't even know which secction to put this question in
thanks for any help.