New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

String concatenation mistakes produce odd error messages #3253

Closed
shiffman opened this Issue May 8, 2015 · 3 comments

Comments

Projects
None yet
3 participants
@shiffman
Member

shiffman commented May 8, 2015

This correct code:

void setup() {
  float w = random(20, 300);
  float x = random(w, width-w);
  float y = random(w/2, height-w/2);
  text(int(x) + "," + int(y),50,50);
}

produces strange error messages when I make a mistake in the text() line.

  text(int(x) + "," int(y),50,50); // Forgetting the second '+'

screenshot 2015-05-08 10 59 52

  text(int(x) + "," + int(y),50,50;  // Forgetting the last ')'

screenshot 2015-05-08 11 01 44

@benfry

This comment has been minimized.

Show comment
Hide comment
@benfry

benfry May 12, 2015

Member

Fixed for 3.0a8.

Member

benfry commented May 12, 2015

Fixed for 3.0a8.

@shiffman

This comment has been minimized.

Show comment
Hide comment
@shiffman

shiffman May 12, 2015

Member

I can confirm this is mostly fixed. I tried several combinations of errors and all worked except for one. This line:

  text(int(x) + ","  int(y), 50, 50);  // missing + between "," and int(y)

produces:

Error on "PApplet"`

I believe it should say:

Error on "int(y)"

Also, during testing while adding and removing errors I received this stack trace a few times:

java.lang.Exception: setting notice to                                                                                                                                                                                                                
    at processing.app.Editor.statusNotice(Editor.java:2886)
    at processing.app.Editor.statusEmpty(Editor.java:2918)
    at processing.mode.java.JavaEditor.statusEmpty(JavaEditor.java:2444)
    at processing.app.Editor.prepareRun(Editor.java:2769)
    at processing.mode.java.JavaEditor.prepareRun(JavaEditor.java:1859)
    at processing.mode.java.JavaEditor$30.run(JavaEditor.java:1026)
    at java.lang.Thread.run(Thread.java:745)
Member

shiffman commented May 12, 2015

I can confirm this is mostly fixed. I tried several combinations of errors and all worked except for one. This line:

  text(int(x) + ","  int(y), 50, 50);  // missing + between "," and int(y)

produces:

Error on "PApplet"`

I believe it should say:

Error on "int(y)"

Also, during testing while adding and removing errors I received this stack trace a few times:

java.lang.Exception: setting notice to                                                                                                                                                                                                                
    at processing.app.Editor.statusNotice(Editor.java:2886)
    at processing.app.Editor.statusEmpty(Editor.java:2918)
    at processing.mode.java.JavaEditor.statusEmpty(JavaEditor.java:2444)
    at processing.app.Editor.prepareRun(Editor.java:2769)
    at processing.mode.java.JavaEditor.prepareRun(JavaEditor.java:1859)
    at processing.mode.java.JavaEditor$30.run(JavaEditor.java:1026)
    at java.lang.Thread.run(Thread.java:745)

@shiffman shiffman reopened this May 12, 2015

@benfry

This comment has been minimized.

Show comment
Hide comment
@benfry

benfry May 12, 2015

Member

The "Error on PApplet" is a much nastier problem—it's probably fooling the preprocessor and it's somewhere in @Manindra29's code. Go ahead and file a new one for that issue.

The "setting notice to" was a debug booger that I left in; now removed.

Member

benfry commented May 12, 2015

The "Error on PApplet" is a much nastier problem—it's probably fooling the preprocessor and it's somewhere in @Manindra29's code. Go ahead and file a new one for that issue.

The "setting notice to" was a debug booger that I left in; now removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment