rspec/rules/S1608/rpg/rule.adoc

49 lines
868 B
Plaintext
Raw Normal View History

2021-04-28 16:49:39 +02:00
Initializing an alphanumeric field with the literal character ``++' '++``, ``++'1'++``, or ``++'0'++`` has the same effect as using the equivalent figurative constant ``++*BLANK++``, ``++*ON++``, or ``++*OFF++``, but the constant version removes ambiguity and makes the code more readable.
2021-04-28 16:49:39 +02:00
== Noncompliant Code Example
2022-02-04 17:28:24 +01:00
[source,rpg]
2021-04-28 16:49:39 +02:00
----
C MOVE ' ' FLD1
----
2022-02-04 17:28:24 +01:00
[source,rpg]
2021-04-28 16:49:39 +02:00
----
/free
fld1 = ' ';
/end-free
----
2021-04-28 16:49:39 +02:00
== Compliant Solution
2022-02-04 17:28:24 +01:00
[source,rpg]
2021-04-28 16:49:39 +02:00
----
C MOVE *BLANK FLD1
----
2022-02-04 17:28:24 +01:00
[source,rpg]
2021-04-28 16:49:39 +02:00
----
/free
fld1 = *BLANK;
/end-free
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::message.adoc[]
'''
== Comments And Links
(visible only on this page)
include::comments-and-links.adoc[]
endif::env-github,rspecator-view[]