Consultor Eletrônico



Kbase P75925: Using OUTPUT TO adds an extra line at the beginning of the file
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   7/1/2008
Status: Unverified

SYMPTOM(s):

Using OUTPUT TO <filename> adds an extra line at the beginning of the file

Using DISPLAY statement

Specifying NO-LABEL has no effect

FACT(s) (Environment):

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

CAUSE:

The DISPLAY statement uses frames to display data. Since no options have been specified for the frame, the default frame format is used. As per the documentation:

DISPLAY statement
Moves data to a screen buffer and displays the data on the screen or other output destination. The AVM uses frames to display data. A frame describes how constant and variable data is arranged for display and data entry. You can let ABL construct default frames or you can explicitly describe frames and their characteristics.

Frame phrase
Specifies the overall layout and processing properties of a frame for frame definition (DEFINE FRAME and FORM), block header (DO, FOR EACH, and REPEAT), and data handling (DISPLAY, SET, etc.) statements

FIX:

Option #1
Add the NO-BOX option in addition to NO-LABEL to the end of the DISPLAY statement to format the frame displaying the data:

DEFINE VARIABLE cName AS CHARACTER INIT "Test" NO-UNDO.
DEFINE VARIABLE cEmail AS CHARACTER INIT "test@test.com" NO-UNDO.
OUTPUT TO c:\temp\file.txt.
DISPLAY cName cEmail WITH NO-BOX NO-LABEL.
OUTPUT CLOSE.

Option #2
Use MESSAGE instead of DISPLAY:

DEFINE VARIABLE cName AS CHARACTER INIT "Test" NO-UNDO.
DEFINE VARIABLE cEmail AS CHARACTER INIT "test@test.com" NO-UNDO.
OUTPUT TO c:\temp\file.txt.
MESSAGE cName cEmail.
OUTPUT CLOSE.