rspec/rules/S1608/rule.adoc
2021-02-02 16:54:43 +01:00

30 lines
564 B
Plaintext

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.
== Noncompliant Code Example
----
C MOVE ' ' FLD1
----
----
/free
fld1 = ' ';
/end-free
----
== Compliant Solution
----
C MOVE *BLANK FLD1
----
----
/free
fld1 = *BLANK;
/end-free
----