rspec/rules/S1645/vb6/rule.adoc
Fred Tingaud 16f6c0aecf
Inline adoc when include has no additional value (#1940)
Inline adoc files when they are included exactly once.

Also fix language tags because this inlining gives us better information
on what language the code is written in.
2023-05-25 14:18:12 +02:00

30 lines
774 B
Plaintext

== Why is this an issue?
Both the "{plus}" operator and the "&" operator can be used to concatenate strings. However, there is a complicated set of rules around the actual behavior of the "+" operator, and whether you will get a concatenation operation, addition, a compiler error, or a ``++Type mismatch++`` error. On the other hand, the "&" operator can only perform concatenation, and is therefore preferred.
=== Noncompliant code example
[source,vb6]
----
Dim y As String = "Con" + "caten" + "ation"
----
=== Compliant solution
[source,vb6]
----
Dim y As String = "Con" & "caten" & "ation"
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
endif::env-github,rspecator-view[]