Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

making screen wait until report is completed

Status
Not open for further replies.

manpaul

Technical User
Jan 10, 2005
118
CA
I have a report form .... to printer prompt, I am selecting cutepdf writer and I want the program to wait until the save of the pdf file has been done. How can I do that

Paul
 
Use a loop like:
Code:
llDone = .f.
lnStart = seconds()
DO WHILE Not llDone
  DOEVENTS
  IF 0<adir(laDir,'OutputFile.pdf')
    lnHnd = FOPEN( 'OutputFile.pdf' )
    if lnHnd>0 && file was no longer locked, it could be opened
      FCLOSE(lnHnd)
      llDone = .T.
    ENDIF
  ENDIF
  if lnStart+60 > seconds()
    * Only wait a minute for process to complete
    llDone = .t.
  ENDIF
ENDDO

You may need to check for other conditions to detect a failure quicker than 1 minute, and to know whether your loop terminated due to success or failure.

- Bill

Get the best answers to your questions -- See FAQ481-4875.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top