Your problem lies in the fact that your test will only exit if you hit 7 or higher. This is due to the fact that <= says 'while it is less than or equal to 6, it is true." However, as your 'exit' happens ON six, you have to have 6 be an exit condition, so your loop should be something like:
Code:
do {
// Some code
} while (someVar < 6);
Sorry if this sounds belittling, I didn't mean it to. Hope this helps.
Ted