RDC00116: Implicit For step
Severity: Information · Family: RDC (Rubberduck Core analyzers) ·
Raised by: ForStepAnalyzer
A For loop states no Step.
A For loop with no Step adds 1 to its counter after each iteration
(MS-VBAL §5.4.2.3 For Statement). Writing Step 1 states it in the header, next to the bounds.
The diagnostic is reported only when the Diagnostics.ForStep setting is Explicit. With the default, Implicit, a loop is written with no Step, and
Step 1 is RDC00313 instead. Both are legal VBA.
The finding is the header of the loop, up to its end value.
How it is raised
| Situation | Example | Resolution |
|---|---|---|
A For loop with no Step, under the Explicit convention. |
For i = 1 To 10Next |
Write Step 1. |
Quick fix
The diagnostic comes with a quick fix, Write Step 1. It writes Step 1 after the end value; the loop counts the same.
See also
ACCUEIL • HOME | ℹ️ BIENVENUE • WELCOME | 🧩 BÂTISSONS • BUILD | RD-VBAL | SDK | 🌐 rubberduckvba.ca