Help with Loops and IFs??

See this example:
http://arduino.cc/en/Reference/Continue