We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Basically I want the program to do is monitor a text file in a web server and do things based on it's content.
For example, in the localhost there is a text file. It will only contain "On" or "Off".
String[] status;
void setup() {
size(600,300);
}
void draw() {
status = loadStrings("http://127.0.0.1/cookie/status.txt");
println((status[0]));
if(status[0] == "On") {
println("The value is On");
}
}
but however, even though the value of the text file is "On", it never prints "The value is On" on the console. Can any body please tell me why this is happening and how can I solve this problem?
Answers
https://processing.org/reference/String_equals_.html
You might also try equalsIgnoreCase method since the equals method would not treat "On" and "on" as being the same.