Frank:
Frank Demont wrote:Antonio
I suppose that when it is called , the EMF-file from this page is deleted , so if it not exist , ENDPAGE should not be called.
No way !!!!!, You have to understand a little how the FW printing system works:
When you do a PRINTER oPrn...... what are you doing is to retrieve all the printing data from the default printer driver or from another printer if you choosed FROM USER or directly used the TO "printer name" statements.
All these data (resolution, paper size, number of bins, etc) is now stored in the printer object.
When you performe a "PAGE" command, you are allocating a space IN MEMORY where you will be able of "drawing", these draws will be the oPrn:Say() or the oPrn:InchSay() or whatever. Once you have finished drawing in memory, the ENDPAGE command will write that memory space in EMF or WMF file, now you can do another new PAGE command of simply finish the printing session with and ENDPRINT command. You have to perform a PAGE...ENDPAGE operation for every single page in your report.
When you reach the ENDPRINT command, and if you specified the PREVIEW clause in the printer command, the preview window will be launched and you will be able to see all the files written by the print command, when the PREVIEW window is running, you can also send these files to the printer and once the preview window is closed all the report files are automatically erased.
If you didn't specified the PREVIEW clause, the EMFs or WMFs will be send to the printer and after that they will be erased.
So, you never have control over the EMF/WMF file erasing process.