We are about to switch to a new forum software. Until then we have removed the registration on this forum.
If there are two or more files in one project and the second file has setup(), an error size() cannot be used here, see https://processing.org/reference/size_.html occurs.
Is there any rules around the order of files when there are multiple files?
The details are as follows.
a.pde
class Foo {}
b.pde
void setup() {
size(100, 100);
}
void draw() {
background(0);
}
File order: a.pde, b.pde
size() cannot be used here, see https://processing.org/reference/size_.html occurs although the arguments of size() are constants.b.pde, a.pde, the error doesn't occur.settings() instead of setup(), the error doesn't occur.
Answers
This sounds like it relates to the preprocessor. Have you filed a bug report?
Also -- is your sketch folder named "a"? The name of your primary tab MyName corresponds to both the sketch folder name and the primary pde file --
So if you aren't doing that, that could be part of the problem.
Thanks for your reply!
I filed a issue just now. https://github.com/processing/processing/issues/5065
Yes.
Note: The problem is solved. According to @benfry, we must locate the
setup()function in the main tab. So this is the problem of an error message. Details are here: https://github.com/processing/processing/issues/5065 .