We are about to switch to a new forum software. Until then we have removed the registration on this forum.
can someone please help me get these too work. When I check if col is equal to "neutral" it runs the code but doesn't run anything in the if statement. Why is that and how do I fit it?
for (TableRow row : Emotions.rows ()) {
for (int i = 0; i < count; i++) {
String Emotion = Emotions.getString(i, 2);
}
}
col = Emotion;
void palette() {
if (col == "neutral") {
println(1);
col1 = #ABB8AE;
col2 = #8BAA81;
col3 = #838472;
col4 = #B7CD8F;
col5 = #D4D997;
stroke(col1);
}
}
Answers
sorry it came out wrong. the format on the forums is bad.
https://Processing.org/reference/String_equals_.html
Thank you :)
When comparing strings, use .equals()
You should also check your use of for loops. You are looping over each row, but the code inside that loop does not use the row variable.
also, line 3 assigns a variable that immediately goes out of scope, meaning it's pointless. the value on line 7 won't be what you expect.