Obsolete While...Wend Statement

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'.

Default severity

Warning

Inspection type

CodeQualityIssues

Examples

This example should trigger a result

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

This example should NOT trigger a result

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

Rubberduck.CodeAnalysis.Inspections.Concrete.ObsoleteWhileWendStatementInspection.cs (Prerelease-v2.5.9.6289)