0

Here is my sketch:

enum Foo { bar, baz }

void setup() { }
void draw() { }

This fails to compile:

Unrecognized type:46 (ENUM_DEF)

Am I doing something wrong, or are enums not supported?

1 Answer 1

1

Looks like they aren't supported unfortunately, but there are some workarounds. From the FAQ:

We currently only support Java 1.4 (and earlier) syntax. You cannot currently use 1.5 syntax in the Processing Development Environment. This means no generics, templates, enum, varargs, foreach, and the rest. If you want to use Java 1.5 (or later), take core.jar and develop your project with another Java IDE

If you're comfortable with Java, you can always base your project in Java and access the Processing code via traditional Java classes. The FAQ has some pointers on that too.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.