I did show this on the Wednesday Clarion Live Open Webinar 9/22/21 at 4:30.
Test window looks like below. You can see on my system API delete is about 90x faster at 1000 pages.
Click “1. RTL Normal” to test time to Close(Report) which shows in the Normal column.
Click “2. API Delete” and it will run code like this that deletes all preview files before Close.
ReportCloseTempDeleteAPI(PreviewQ)
CLOSE(Report)
ReportCloseTempDeleteAPI PROCEDURE(QUEUE RptPreviewQ)
QX LONG,AUTO
cName CSTRING(261),AUTO
CODE
LOOP QX=1 TO RECORDS(RptPreviewQ)
GET(RptPreviewQ,QX)
cName=CLIP(RptPreviewQ)
DeleteFile(cName)
END
RETURN
!FYI DeleteFile(*CSTRING lpFileName ),BOOL,PROC,RAW,PASCAL,DLL(1),name('DeleteFileA')
“No Preview” skips displaying the Preview Window so the testing process is faster.
“Use RTL Remove” cause test #2 to use Remove() instead of API Delete. This proves that the RTL Remove() function is dreadfully slow. IMO that occured in C8 when it was changed to use SHFileOperation(). Below I highlighted one test where you can see Remove() takes 12.7 seconds versus 13.3 for Close(Report) so same speed and no where near as fast as API Delete.