Replace While...Wend With Do...While Loop Quick Fix

Replaces 'While...Wend' loop statement with equivalent 'Do While...Loop'.

This quick-fix is available for the ObsoleteWhileWendStatement inspection

Applicability

This quick-fix can be applied as a single operation at the following scopes:
  • Procedure
  • Module
  • Project

Examples

 This example depicts the state of module(s) before and after applying the quick-fix.

Before
Module1 (Any)
Option Explicit Public Sub DoSomething() Dim value As Long While value < 99 value = value + 1 Wend End Sub
After
Module1 (Any)
Option Explicit Public Sub DoSomething() Dim value As Long Do While value < 99 value = value + 1 Loop End Sub

Rubberduck.CodeAnalysis.QuickFixes.Concrete.ReplaceWhileWendWithDoWhileLoopQuickFix.cs (Prerelease-v2.5.2.6174)