rspec/rules/S1650/vb6/rule.adoc

36 lines
711 B
Plaintext
Raw Normal View History

== Why is this an issue?
2021-04-28 16:49:39 +02:00
Appending '$' to any identifier forces it to the String data type, but this usage is obsolete and should only appear when differentiating string-specific functions from variant functions, such as ``++Left$()++`` versus ``++Left()++``.
Instead, Strings should be explicitly declared with the String datatype.
=== 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 Text$ As String
----
=== 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 Text As String
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
=== Message
Remove the '$' from "XXX" and make sure it is defined with the String datatype
endif::env-github,rspecator-view[]