Change Enhancement:
It would be useful & intuitive for the COMPRESS statement to support Edit Masks.
.
Business Case:
We waste a lot of statements & require temporary variables just to incorporate formatted fields into a message text. This enhancement would be particularly useful when composing message texts for use with the REINPUT statement or with WRITE / WRITE TITLE.
.
Reasons:
1. Potentially reduce the size of the symbol table (by reducing the need for temporary variables).
2. Reduce the program complexity by reducing the number of statements.
3. Potentially improve performance.
4. Remove some programming limitations to make Natural programming more performant & more intuitive.
.
Example:
> > + Program ER12345 Lib APPHOP All ....+....1....+....2....+....3....+....4....+....5....+.Mode Structured.
0010 DEFINE DATA
0020 LOCAL
0030 1 #DATX-1 (D)
0040 1 #DATX-2 (D)
0050 1 #LONG-DATE-1 (A20)
0060 1 #LONG-DATE-2 (A20)
0070 1 #MESSAGE (A79)
0080 END-DEFINE
0090 *
0100 MOVE EDITED '01/01/2009' TO #DATX-1 (EM=DD/MM/YYYY)
0110 MOVE EDITED '31/12/2009' TO #DATX-2 (EM=DD/MM/YYYY)
0120 *
0130 WRITE / '1. The Problem...'(I)
0140 COMPRESS 'The Date Range is'
0150 #DATX-1
0160 'to'
0170 #DATX-2
0180 INTO #MESSAGE
0190 DISPLAY #MESSAGE
0200 *
0210 WRITE / '2. The Change/Enhancement...'(I)
0220 /* COMPRESS 'The Date Range is'
0230 /* #DATX-1 (EM=DD-L(9)-YYYY)
0240 /* 'to'
0250 /* #DATX-2 (EM=DD-L(9)-YYYY)
0260 /* INTO #MESSAGE
0270 /* DISPLAY #MESSAGE
0280 *
0290 WRITE / '3. The Workaround...'(I)
0300 MOVE EDITED #DATX-1 (EM=DD-L(9)-YYYY) TO #LONG-DATE-1
0310 MOVE EDITED #DATX-2 (EM=DD-L(9)-YYYY) TO #LONG-DATE-2
0320 COMPRESS 'The Date Range is'
0330 #LONG-DATE-1
0340 'to'
0350 #LONG-DATE-2
0360 INTO #MESSAGE
0370 DISPLAY #MESSAGE
0380 *
0390 END
Created on Brainstorm | 01/19/2010 05:00 AM |
Brainstorm ID | 284 |