Hello,
Was wondering if anybody could help. Bit new at progress code.
I have written code to export data out of progress into a txt file. Which works fine.
I am now trying to find a way of exporting Field Names from a table.
The code below I have used to export the data. What I would like to do is be able to create the header line cTemp automatically as some of the tables are rather large.
Any help would be much appreciated....
DEFINE VARIABLE cTemp AS CHAR NO-UNDO.
DEFINE STREAM OutData.
OUTPUT STREAM OutData TO VALUE("IH.RM_TRADES.txt").
/* header line */
ASSIGN cTemp = "ORG-CODE|TRADE-CODE|DESCRIPTION"
cTemp = cTemp + "|~n".
/* write header line to file */
PUT STREAM OutData UNFORMATTED cTemp.
/* main loop */
FOR EACH IH.RM_TRADES:
ASSIGN cTemp = STRING(ORG-CODE) + "|" + STRING(TRADE-CODE) + "|" + STRING(DESCRIPTION)
cTemp = cTemp + "|~n".
/* write line to file */
PUT STREAM OutData UNFORMATTED cTemp.
END.
OUTPUT STREAM OutData CLOSE.
Stuart
Was wondering if anybody could help. Bit new at progress code.
I have written code to export data out of progress into a txt file. Which works fine.
I am now trying to find a way of exporting Field Names from a table.
The code below I have used to export the data. What I would like to do is be able to create the header line cTemp automatically as some of the tables are rather large.
Any help would be much appreciated....
DEFINE VARIABLE cTemp AS CHAR NO-UNDO.
DEFINE STREAM OutData.
OUTPUT STREAM OutData TO VALUE("IH.RM_TRADES.txt").
/* header line */
ASSIGN cTemp = "ORG-CODE|TRADE-CODE|DESCRIPTION"
cTemp = cTemp + "|~n".
/* write header line to file */
PUT STREAM OutData UNFORMATTED cTemp.
/* main loop */
FOR EACH IH.RM_TRADES:
ASSIGN cTemp = STRING(ORG-CODE) + "|" + STRING(TRADE-CODE) + "|" + STRING(DESCRIPTION)
cTemp = cTemp + "|~n".
/* write line to file */
PUT STREAM OutData UNFORMATTED cTemp.
END.
OUTPUT STREAM OutData CLOSE.
Stuart