Using While... Wend
The While...Wend statement is provided in BSL for those who are familiar with its usage. However, because of the lack of flexibility in While...Wend, it is recommended that you use Do...Loop instead.
The following example illustrates the use of the while wend loop:
Example 1:
Sub BasicWhileWend()
Dim counter, myNum
counter = 0
myNum = 5
While myNum > 0
myNum = myNum - 1
counter = counter + 1
Wend
'This loop made 5 repetitions
End Sub