I updated my RDi to 9.6.0.6 and tried the new "Extract constant" feature.
"Extract constant" produces invalid source code, when the name of the
constant matches an existing field name.
For example:
Before:
//----------------------------------------------------------------------
// GLOBAL VARIABLES
//----------------------------------------------------------------------
// Number of assertions called.
D assertCalled s 10i 0
// Latest assertion failure event information. Can be blank if no
// assertion failure event since last assertion.
D assertFailEvt ds likeds(AssertFailEvtLong_t)
//----------------------------------------------------------------------
// Assert equality between two alphanumeric variables.
//----------------------------------------------------------------------
P aEqual...
P b export
D pi
D expected 32565a const
D actual 32565a const
D fieldName 64a const varying options(*nopass: *omit)
D msg s like(msgText_t) inz
/free
if (%parms() >= 3 and %addr(fieldName) <> *NULL);
msg = %trim(fieldName) + ': ';
endif;
//----------------------------------------------------------------------
// GLOBAL VARIABLES
//----------------------------------------------------------------------
// Number of assertions called.
D EXPECTED C 'Expected ' // <=== Inserted line
D assertCalled s 10i 0
// Latest assertion failure event information. Can be blank if no
// assertion failure event since last assertion.
D assertFailEvt ds likeds(AssertFailEvtLong_t)
//----------------------------------------------------------------------
// Assert equality between two alphanumeric variables.
//----------------------------------------------------------------------
P aEqual...
P b export
D pi
D expected 32565a const
D actual 32565a const
D fieldName 64a const varying options(*nopass: *omit)
D msg s like(msgText_t) inz
/free
if (%parms() >= 3 and %addr(fieldName) <> *NULL);
msg = %trim(fieldName) + ': ';
endif;
The compiler error message is "RNF7421 Operands are not compatible with
the type of operator." in procedure, which is stored in the same module:
//----------------------------------------------------------------------
// Assert equality between two integers.
//----------------------------------------------------------------------
P iEqual...
P b export
D pi
D expected 31s 0 const
D actual 31s 0 const
D fieldName 64a const varying options(*nopass: *omit)
D msg s like(msgText_t) inz
/free
if (%parms() >= 3 and %addr(fieldName) <> *NULL);
msg = %trim(fieldName) + ': ';
endif;
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact
[javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.