Hi,
You can write text to stdout with the DISPLAY statement. During execution the stdout of the program can be redirected into a file on the command line.
Another way to write to file with a 4GL program is to define a REPORT function and make calls in the program to it with every line of output. E.g.
Code:
REPORT tab_fld (result)
DEFINE result CHAR(603)
OUTPUT
LEFT MARGIN 0
RIGHT MARGIN 0
TOP MARGIN 0
BOTTOM MARGIN 0
PAGE LENGTH 1
FORMAT
ON EVERY ROW
PRINT result CLIPPED
END REPORT
This report has to be invoked in the program with something like:
Code:
OUTPUT TO REPORT tab_fld (textstring)
And around the program part that contains the OUTPUT TO statements you have to call:
Code:
START REPORT tab_fld TO "fullpathname/filename"
and:
Code:
FINISH REPORT tab_fld
Regards