While like loop possible

Its possible to have a loop that stops when a condition is meet?