rspec/rules/S1608/rpg/rule.adoc

38 lines
725 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
----
C MOVE ' ' FLD1
----
----
/free
fld1 = ' ';
/end-free
----
2021-04-28 16:49:39 +02:00
== Compliant Solution
----
C MOVE *BLANK FLD1
----
----
/free
fld1 = *BLANK;
/end-free
----
ifdef::env-github,rspecator-view[]
'''
== Comments And Links
(visible only on this page)
include::comments-and-links.adoc[]
endif::env-github,rspecator-view[]