INDICATORS TO AVOID


The modern RPG programmer avoids using level-break indicators L1 to L9, the matching record indicator MR, conditioning indicators (of any kind), and the default function key indicators KA to KY.

Level-Break Indicators. Level-break indicators (L1 to L9) are of no use when the RPG cycle is avoided and, therefore, aren't used in most RPG applications being written.

Matching Record Indicator. The matching record (MR) indicator and match field identifiers (M1 to M9; remember, M1 to M9 are not indicators) also are of no use in cycleless programming. System functions outside of high-level languages, as well as more sophisticated functions, perform the equivalent of matching record indicators. The data manipulation language (DML) structured query language (SQL) provides support for organizing data such that matching-record processing is no longer necessary.

On certain computer systems, a DML other than SQL might be available. For example, on the IBM AS/400, a programmer has four options: SQL, a system command called Open Query File (OPNQRYF), an interactive query utility, and the database SORT utility.

Conditioning Indicators. Conditioning indicators have been replaced with structured operations. Conditioning indicators tend to make programs more difficult to read and more difficult to maintain. Avoid using conditioning indicators. In their place, use the IFxx, SELECT/WHEN, CASxx, DO, DOWxx, and DOUxx op codes. Doing so results in programs that are easier to read and easier to maintain.

Default Function Key Indicators. Default function key indicators (KA to KY) are a carryover from the System/32/34/36 RPG II compiler. It is not reasonable to use these indicators in new applications because Kn indicators bind the requested function to the function key. For example, for years F7 evoked the EXIT function. Today, however, F3 evokes the EXIT function.

Another reason to avoid using Kn indicators is that not all function keys support them. The ROLLUP, ROLLDOWN, HELP, HOME, and PRINT keys are a few examples. Using function key indicators to control the process of an application is not recommended in this text. Instead, programming by function is encouraged.




The Modern RPG IV Language
The Modern RPG IV Language
ISBN: 1583470646
EAN: 2147483647
Year: 2003
Pages: 156
Authors: Robert Cozzi

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net