Inspection Details

ObsoleteWhileWendStatement


Summary
Flags 'While...Wend' loops as obsolete.
Reasoning
'While...Wend' loops were made obsolete when 'Do While...Loop' statements were introduced. 'While...Wend' loops cannot be exited early without a GoTo jump; 'Do...Loop' statements can be conditionally exited with 'Exit Do'.
The following code example(s) would trigger this inspection:

Public Sub DoSomething()
    While True
        ' ...
    Wend
End Sub

The following code example(s) would not trigger this inspection:

Public Sub DoSomething()
    Do While True
        ' ...
    Loop
End Sub


Back to List