2020-06-30 12:47:33 +02:00
|
|
|
include::../description.adoc[]
|
|
|
|
|
|
|
|
== Noncompliant Code Example
|
|
|
|
|
|
|
|
With an indent size of 2:
|
2020-06-30 14:49:38 +02:00
|
|
|
|
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
|
|
|
|
----
|