Processing 'It looks like you're mixing “active” and “static” modes.'

前端 未结 2 598
灰色年华
灰色年华 2021-01-04 04:55

Processing keeps giving me this error when I run it even though it is just a print command. When I delete the comment block it works fine. Here\'s the code:



        
2条回答
  •  南笙
    南笙 (楼主)
    2021-01-04 05:33

    The message could be shown when the actual problem is a syntax error. I encountered this error with the following (silly) code:

    boolean state = false;
    
    setup() {
      size(200, 800);
    }
    
    void draw() {
    }
    

    It is missing the 'void' modifier for the setup function. This is a syntax error (at least, it should be). But the Processing IDE gives you this "active vs. static" message instead.

    So in this case, it should be void setup() { } rather than just setup() { }.

提交回复
热议问题