Copy of initial variable

 home quick fix  example  edit

copy_of_initial_variable

Description

Finds assignments from a local variable that is always initial

Extended Information

Reports DATA v TYPE ... [CLEAR v.] x = v. when all of the following hold:

* v is a local variable of a METHOD, FORM or FUNCTION, declared with DATA without VALUE
* v is never changed, except by CLEAR v., and its address is never taken
* v has exactly one read, the complete source of x = v., where x is not an inline declaration
* x and v are both reference types, or have identical types. Initial values convert differently between
types, e.g. an initial d becomes '00000000' in a string
* the declaration and the CLEARs are not chained

Objects with syntax errors, macros or unknown statements are skipped, as are procedures with dynamic code,
INCLUDE, test seams, enhancements or native SQL.

The quick fix deletes the declaration and the CLEARs, and replaces x = v. with CLEAR x.
No release requirement.

Default Configuration

Hover to see descriptions, Ctrl+Space for suggestions

Examples