In its Do While...Loop configuration the loop executes as long as a condition test at the beginning of the loop remains True and the condition may be False at the start of the loop, in which case the loop is exited before it begins. Somewhere inside the loop the condition becomes True for exiting the loop as in the case with the While...End While loop, the condition test is for continuing the loop.
In its Do Until...Loop configuration the condition test is for ending of the loop and in otherwords the logic is the same as for the Do While...Loop.
If there is a situation in which the statements in the loop will be executed at least one time, then the Do...While Loop or Do...Until Loop configuration can be used and the condition test is not made until the end of the loop, after that the statements have been executed the first time.
The Do...Loop presents special condition-test options that don't normally appear in routine data processing and for the most part, For...Next and While...End While statements can handle the bulk of processing. As an illustration, though, of the Do...Until Loop option and the following script loads the CodesArray and StatesArray arrays that are used in a previous example of the While...End While loop. To populate the arrays,it reads records from an external text file , then writes the information to this page.
|