I'm creating a file similar to my Stock file as below. The stock file has lots more fields. Is there an easier way I can create "STOCKCHK.DBF" with the fields from Stock and extra fields as below. Also I would like any data in the appropriate fields in Stock to be in STOCKCHK when this file is created.
At the moment I create the file as below then check contents in the Stock File and put it into STOCKCHK. This does become a nusiance sometimes and I was wondwerinf if there was an easier way to do it. Similar to making an array from a table with only cetain fields. Thanks.
IF !FILE(LOCALDIR + "\STOCKCHK\STOCKCHK.DBF"
SELECT STOCK
COPY STRUCTURE TO (LOCALDIR + "\STOCKCHK\STOCKCHK.DBF"
FIELDS PLU, DESCR, DEPT, QUANTITY
SELECT 0
USE (LOCALDIR + "\STOCKCHK\STOCKCHK" EXCLUSIVE
ALTER TABLE STOCKCHK ADD CHKDATE D(8)
ALTER TABLE STOCKCHK ADD CHKTIME N(4)
ALTER TABLE STOCKCHK ADD NEWQUANT N(10,1)
INDEX ON PLU TAG PLU
INDEX ON DESCR TAG DESCR
ENDIF
At the moment I create the file as below then check contents in the Stock File and put it into STOCKCHK. This does become a nusiance sometimes and I was wondwerinf if there was an easier way to do it. Similar to making an array from a table with only cetain fields. Thanks.
IF !FILE(LOCALDIR + "\STOCKCHK\STOCKCHK.DBF"
SELECT STOCK
COPY STRUCTURE TO (LOCALDIR + "\STOCKCHK\STOCKCHK.DBF"
FIELDS PLU, DESCR, DEPT, QUANTITY
SELECT 0
USE (LOCALDIR + "\STOCKCHK\STOCKCHK" EXCLUSIVE
ALTER TABLE STOCKCHK ADD CHKDATE D(8)
ALTER TABLE STOCKCHK ADD CHKTIME N(4)
ALTER TABLE STOCKCHK ADD NEWQUANT N(10,1)
INDEX ON PLU TAG PLU
INDEX ON DESCR TAG DESCR
ENDIF