Error in Processing 4 (freezing with show usage, jump to declaration etc.)

processing v4 crashes when using

  • show usage
  • jump to declaration
  • etc.
1 Like

example code, that freezes

try show usage on variable “words”



// Weltfrauentag 2023 !

//combinations of two
String[] words = {
  "mother", "daughter", "sister", "wife", "grandma", "girlfriend"
};
String[] words2 = {
  "singer", "doctor", "housewife", "teacher", "programmer", "designer", "architect", "feminist"
};

// their indexes
int currentWordIndex  = 0;
int currentWordIndex2 = 0;

// for mouse detection
boolean showMother   = false;
boolean showDaughter = false;
boolean showSister   = false;

PFont font;

float wordChangeDelay = 0.5;
float wordChangeTimer = 0;

// --------------------------------------------------------------------------------------

void setup() {
  size(600, 600);
  font = createFont("data/RobotoMono-Regular.ttf.ttf", 32); // create the font
}//setup

void draw() {
  //background(150);
  background(255, 10, 150);

  // textFont(font);
  textSize(32);
  fill(#FFFFFF);

  // show 4 lines of text ----

  String motherString = "I am a w(?)man";
  if (showMother) {
    motherString = "I am a w(" + words[currentWordIndex2] + ")man";
    if (wordChangeTimer >= wordChangeDelay) {
      currentWordIndex2++;
      if (currentWordIndex2>= words.length) {
        currentWordIndex2 = 0;
      }
      wordChangeTimer = 0;
    } else {
      wordChangeTimer += 50 / 1000.0;
    }
  }
  text(motherString, 100, 150);

  String daughterString = "I could be a w(?)man";
  if (showDaughter) {
    daughterString = "I could be a w(" + words2[currentWordIndex] + ")man";
    if (wordChangeTimer >= wordChangeDelay) {
      currentWordIndex++;
      if (currentWordIndex >= words2.length) {
        currentWordIndex = 0;
      }
      wordChangeTimer = 0;
    } else {
      wordChangeTimer += 50 / 1000.0;
    }
  }
  text(daughterString, 100, 200);

  text("but most of all", 100, 250);

  String sisterString = "I need to be (wǒ)";
  if (showSister) {
    sisterString = "I need to be w()men  ";
  }
  text(sisterString, 100, 300);
  //
}//draw

// --------------------------------------------------------------------------------------

void mouseMoved() {
  // for mouse detection

  // Check if mouse is over the word "mother"
  if (mouseX > 155 && mouseX < 225 &&
    mouseY > 135 && mouseY < 170) {
    showMother = true;
  } else {
    showMother = false;
  }

  // Check if mouse is over the word "daughter"
  if (mouseX > 125 && mouseX < 290 &&
    mouseY > 185 && mouseY < 220) {
    showDaughter = true;
  } else {
    showDaughter = false;
  }

  // Check if mouse is over the word "sister"
  if (mouseX > 155 && mouseX < 275 &&
    mouseY > 285 && mouseY < 320) {
    showSister = false;
  } else {
    showSister = true;
  }
}
//

1 Like

Hello,

With Processing 4.2 on a W10 PC it works if I remove the “odd” character:

Change this:
image

To this:
image

And it works.

This is what I see in Notepad:
image

:)

1 Like

There are related Github issues reported here:

:)