Hi All,
I'm writing a script to do X but before I get to that stage, I've imported the ItemCode into a temp-table so that I can then use it further down the line. However I'm running into an issue with the data stored in the temp table.
I think it's do with my understanding on the REPEAT function (Progress Documentation) but I'm not sure.
When DISPLAY ONE appears I have all 174 records that I need, when DISPLAY TWO appears then only the last item appears.
After ending the creation of the Temp-Table, I thought all 174 records would appear\be available. I can then close my stream and continue on with my code to do X using the item from the temp-table.
However that's not happening .... So my question is do I need to place my code to do x between DISPLAY ONE and the end statement?
Why does the second display only show my last item?
FYI the my code section isn't what I'm doing it's just me playing and as you can see I've commented it out for the time being.
Thanks,
Hassam
I'm writing a script to do X but before I get to that stage, I've imported the ItemCode into a temp-table so that I can then use it further down the line. However I'm running into an issue with the data stored in the temp table.
I think it's do with my understanding on the REPEAT function (Progress Documentation) but I'm not sure.
Code:
DEFINE VARIABLE cItem AS CHARACTER.
DEFINE VARIABLE cInputFile AS CHARACTER.
ASSIGN cInputFile = "C:\Users\HT\Desktop\ItemUpdate.csv".
DEFINE STREAM sInput.
DEFINE TEMP-TABLE tt-Item
FIELD ITEM AS CHARACTER.
INPUT STREAM sInput FROM VALUE (cInputFile).
REPEAT:
IMPORT STREAM sInput DELIMITER "," cItem.
cItem =TRIM(cItem).
IF cItem <> "" THEN.
CREATE tt-item.
ASSIGN
tt-item.ITEM = cItem.
DISPLAY tt-item WITH 1 COLUMN SCROLLABLE. /*************(DISPLAY ONE)**********/
END.
DISPLAY tt-item WITH 1 COLUMN SCROLLABLE. /*******(DISPLAY TWO) ***********/
INPUT STREAM sInput CLOSE.
/*****(MY CODE ) *****/
/* FOR EACH darwin.ITEM WHERE */
/* darwin.ITEM.ItemCode = cItem. */
/* */
/* IF AVAILABLE darwin.ITEM THEN */
/* */
/* FOR EACH tt-item WHERE */
/* tt-item.ITEM = "". */
/* */
/* ASSIGN darwin.ITEM.ItemCode = tt-item.ITEM. */
/* */
/* DISPLAY tt-item WITH 1 COLUMN SCROLLABLE. */
/* END. */
When DISPLAY ONE appears I have all 174 records that I need, when DISPLAY TWO appears then only the last item appears.
After ending the creation of the Temp-Table, I thought all 174 records would appear\be available. I can then close my stream and continue on with my code to do X using the item from the temp-table.
However that's not happening .... So my question is do I need to place my code to do x between DISPLAY ONE and the end statement?
Why does the second display only show my last item?
FYI the my code section isn't what I'm doing it's just me playing and as you can see I've commented it out for the time being.
Thanks,
Hassam