rspec/rules/S1702/vb6/rule.adoc

36 lines
721 B
Plaintext
Raw Permalink Normal View History

== Why is this an issue?
2021-04-28 16:49:39 +02:00
Variables declared without the explicit specification of a data type are ``++Variants++``. Variants can be inefficient to use because at each interaction they are converted to the appropriate type for that interaction. Variants may be required for COM interactions, but even then their type should be specified explicitly.
=== Noncompliant code example
2021-04-28 16:49:39 +02:00
2022-02-04 17:28:24 +01:00
[source,vb6]
2021-04-28 16:49:39 +02:00
----
Dim Count
Dim Bool
----
=== Compliant solution
2021-04-28 16:49:39 +02:00
2022-02-04 17:28:24 +01:00
[source,vb6]
2021-04-28 16:49:39 +02:00
----
Dim Count As Integer
Dim Bool As Boolean
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
=== Message
Declare the data type of "XXX" using the "AS" keyword
endif::env-github,rspecator-view[]