rspec/rules/S1657/vb6/rule.adoc

38 lines
565 B
Plaintext
Raw Normal View History

2021-04-28 16:49:39 +02:00
The use of ``++Option Base++`` to change the lower bound of an array's index values results in confusing code.
2021-04-28 16:49:39 +02:00
== Noncompliant Code Example
----
Option Explicit
Option Base 1
'...
Dim MyArray(1 To 3) As Integer
For I = 1 To 3
MsgBox MyArray(I)
Next I
----
2021-04-28 16:49:39 +02:00
== Compliant Solution
----
Option Explicit
'...
Dim MyArray(0 To 2) As Integer
For I = 0 To 2
MsgBox MyArray(I)
Next I
----
ifdef::rspecator-view[]
== Comments And Links
(visible only on this page)
include::comments-and-links.adoc[]
endif::rspecator-view[]