Simple Example
Take this psuedo-C as an example: event = NONE; do { if ( there_is_an_event_in_the_queue() ) event = get_next_event(); } while (event != QUIT); The do-while loops until a "QUIT" event is received by the event-handling code.
event = NONE; do { if ( there_is_an_event_in_the_queue() ) event = get_next_event(); } while (event != QUIT);