Another question that arises in this situation is regarding the items
that have been printed verses the ones that did not print.
What would be the best way to capture all the part numbers once they
printed so when some problem arises, my user can start at the last part
rather than reprinting the ones that already printed?
As I mentioned before, I use temp tables that have all the parts we want
to print travelers for. Then I use a curser to print the travelers.
Do you think this would work?
1) Have a simple insert code within the while loop that inserts the part
number into a permanent table.
FETCH c2 INTO vpdfnum INDICATOR ivpdfnum
WHILE SQLCODE <> 100 THEN
PAUSE FOR 8 USING '[Esc] to Cancel Printing'
SET VAR vLastKey = (LASTKEY(0))
IF vLastKey = '[Esc]' THEN
BREAK
ENDIF
PRINT partsheetpdf WHERE partnum = .vpdfnum AND +
procused IN (y,f) ORDER BY partnum orderdone +
OPTION PRINTER
CLS
INSERT INTO partprint values .vpdfnum
FETCH c2 INTO vpdfnum INDICATOR ivpdfnum
ENDWHILE
DROP CURSOR c2
2) Then at the start of the code, I would ask if this was a restart on
the date in question.
3) If it is, the code would use the information in the permanent table
and compare to the temp table (this would be recreated) and only print
what is not in the table.
4) If there was not a restart, the permanent table info would be
deleted.
James Belisle