Why is this code not working properly? [String matching issue]

edited June 2015 in Questions about Code

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

Sign In or Register to comment.