rspec/rules/S1120/vb6/rule.adoc

36 lines
671 B
Plaintext
Raw Normal View History

2020-06-30 12:47:33 +02:00
include::../description.adoc[]
== Noncompliant Code Example
With an indent size of 2:
2020-06-30 12:47:33 +02:00
----
Public Sub OutputObject(oOutput As Object)
Set oObject = oOutput
If TypeOf oObject Is Form Then
oObject.Cls
ElseIf TypeOf oObject Is PictureBox Then
oObject.Cls
ElseIf TypeOf oObject Is ListBox Then
oObject.Clear
End If
End Sub
----
== Compliant Solution
----
Public Sub OutputObject(oOutput As Object)
Set oObject = oOutput
If TypeOf oObject Is Form Then
oObject.Cls
ElseIf TypeOf oObject Is PictureBox Then
oObject.Cls
ElseIf TypeOf oObject Is ListBox Then
oObject.Clear
End If
End Sub
----