Looping with the WHILE Keyword
The while loop is used to repeat a block of instructions until a certain condition is true.
Before the block to be repeated, place a while statement containing the boolean expression that determines if the loop will be performed.
// do something
The whole point of the while loop is to re-evaluate a condition prior to every loop (which means that if the condition is false from the beginning, the loop will never be entered). Recall that the elements of a for loop could not be modified in the loop, nor could they vary, but in the case of a while loop the following is allowed and often used.
while WeekDayOf(nDate) <> 6