I have a process that after creating temp tables I use the cursor code
to run a series of PDF files.

Sometimes things happen during the WHILE loop (printer jam, out of
paper, or code interruption) where the user needs to cancel the rest of
the print job.

 

What code would I use to give this option?

 

Here is the Cursor w/ WHILE loop code I use:

 

SET ERROR MESSAGE 705 OFF

DROP CURSOR c2

SET ERROR MESSAGE 705 ON

DECLARE c2 CURSOR FOR SELECT partnum FROM tpartpdf ORDER BY partnum

OPEN c2

FETCH c2 INTO vpdfnum INDICATOR ivpdfnum

WHILE SQLCODE <> 100 THEN

  PAUSE FOR 8

  PRINT partsheetpdf WHERE partnum = .vpdfnum AND +

  procused IN (y,f) ORDER BY partnum orderdone +

  OPTION PRINTER

  CLS

  FETCH c2 INTO vpdfnum INDICATOR ivpdfnum

ENDWHILE

DROP CURSOR c2

 

We use 7.6.

 

James Belisle

 

Reply via email to