Consultor Eletrônico



Kbase P180866: 4GL/ABL: How to display zero INTEGER values as blank space when using 4GL/ABL?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   1/19/2011
Status: Unverified

GOAL:

4GL/ABL: How to display zero INTEGER values as blank space when using 4GL/ABL?

GOAL:

What FORMAT displays zero INTEGER fields or variables as blank spaces when used with the DISPLAY and PUT statements?

GOAL:

How to display zero INTEGER values as blank spaces when using the 4GL/ABL DISPLAY statement?

GOAL:

How to display zero INTEGER values as blank spaces when using the 4GL/ABL PUT statement?

FACT(s) (Environment):

All Supported Operating Systems
Progress 9.x
OpenEdge 10.x
OpenEdge Category: Language (4GL/ABL)

FIX:

The "ZZZZZ" format, when used with either the 4GL/ABL PUT or DISPLAY statements, displays zero INTEGER fields or variables as blank spaces. The following 4GL/ABL procedure demonstrates how this format is used to display the zero INTEGER values as blank spaces when using the DISPLAY statement:

/* set e=the Minqty of every fifth Item to zero */
FOR EACH ITEM WHERE Itemnum < 20:
IF Itemnum MODULO 5 = 0 THEN Minqty = 0.
END.
/* output three integer fields in three different formats */
/* Notice the format of the Minqty filed which displays */
/* the desired blank space when the value is zero. */
FOR EACH ITEM NO-LOCK WHERE Itemnum < 20:
DISPLAY
Item.Itemnum FORMAT "999999999"
Item.Minqty FORMAT "ZZZZZZZZZ"
Item.Onhand "999,999,999" WITH STREAM-IO.
END.

The following 4GL/ABL procedure demonstrates how to display zero INTEGER values as blank spaces when using the 4GL/ABL PUT statement:

/* set e=the Minqty of every fifth Item to zero */
FOR EACH ITEM WHERE Itemnum < 20:
IF Itemnum MODULO 5 = 0 THEN Minqty = 0.
END.
/* output three integer fields in three different formats */
/* Notice the format of the Minqty filed which displays */
/* the desired blank space when the value is zero. */
OUTPUT TO BlnakZeroIntegers.txt.
FOR EACH ITEM NO-LOCK WHERE Itemnum < 20:
PUT
Item.Itemnum FORMAT "zzzz9"
Item.Minqty FORMAT "ZZZZZ"
Item.Onhand "9999999999" SKIP.
END.
OUTPUT CLOSE.