Inspection Details

StepOneIsRedundant


Summary
Locates 'For' loops where the 'Step' token is specified with the default increment value (1).
Reasoning
Out of convention or preference, explicit 'Step 1' specifiers could be considered redundant; 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 1 ' 1 being the implicit default, 'Step 1' could be considered redundant.
        ' ...
    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 ' implicit: 'Step 1'
        ' ...
    Next
End Sub


Back to List