rspec/rules/S1608/rule.adoc

30 lines
564 B
Plaintext
Raw Normal View History

2021-01-27 13:42:22 +01: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.
2020-06-30 12:47:33 +02:00
== Noncompliant Code Example
----
C MOVE ' ' FLD1
----
----
/free
fld1 = ' ';
/end-free
----
== Compliant Solution
----
C MOVE *BLANK FLD1
----
----
/free
fld1 = *BLANK;
/end-free
----