Inspection Details

StepIsNotSpecified


Summary
Locates 'For' loops where the 'Step' token is omitted.
Reasoning
Out of convention or preference, explicit 'Step' specifiers could be considered mandatory; this inspection can ensure the consistency of the convention.
The following code example(s) would trigger this inspection:

Public Sub DoSomething()
    Dim i As Long
    For i = 1 To 100 ' Step is implicitly 1
        ' ...
    Next
End Sub

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

Public Sub DoSomething()
    Dim i As Long
    For i = 1 To 100 Step 1 ' explicit 'Step 1' could also be considered redundant.
        ' ...
    Next
End Sub


Back to List