Consultor Eletrônico



Kbase P127997: 4GL/ABL:  How to programmatically remove AREA and TRIGGER references from a .df file?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   04/01/2008
Status: Unverified

GOAL:

4GL/ABL: How to programmatically remove AREA and TRIGGER references from a .df file?

FACT(s) (Environment):

All Supported Operating Systems
Progress 9.x
OpenEdge 10.x

FIX:

The following 4GL procedure takes removes the file "Source.df" as input and generates the file "Destination.df" where the "Destination.df" an exact copy of the original "Source.df" MINUS all AREA and TRIGGER references:
DEFINE VARIABLE cSourceFileName AS CHARACTER NO-UNDO.
DEFINE VARIABLE cTargetFileName AS CHARACTER NO-UNDO.
ASSIGN
cSourceFileName = "Source.df"
cTargetFileName = "Destination.df".
INPUT FROM VALUE ( cSourceFileName ).
OUTPUT TO VALUE ( cTargetFileName ).
DEFINE VARIABLE cLine AS CHARACTER NO-UNDO.
REPEAT:
IMPORT UNFORMATTED cLine.
IF TRIM(cLine) BEGINS 'AREA "' OR
TRIM(cLine) BEGINS 'TABLE-TRIGGER "' THEN NEXT.
PUT UNFORMATTED cLine SKIP.
END.
INPUT CLOSE.
OUTPUT CLOSE.