While you can use the -while-, -if, -else- commands to perform looping until a condition is met, it's usually a better idea in Stata to use the -foreach- or -forvalues- loops in their place.
So, instead of saying:
while "`1'" != "" {
<do something>
}
or
if "`a'" == "" {
<do something>
}
else {
<do something else>
}
it's usually better (and more intuitive) to instead to do:
forvalues x = 1/100 {
<do something>
}
-- No -if-, -else-, or -break- conditions needed. See -help forvalues- or -help foreach- in Stata for details.
^NOTE: the while-else loop in my original post was removed--thanks for the heads-up, Keith. The -else- part was intended for the if{] else{} loop example only. Regardless, the point of my post wasn't to suggest the use of a while/else or if/else loop, it was that -foreach-/-forvalues- are usually a preferred approach.