not much to go on there,
While( your condition == true ) // loop until you conditions become true
{
Act on it
}
please post your code or at least what you have so far,
might want to have a look here http://arduino.cc/forum/index.php/topic,97455.0.html