Delay causes breakdown

From a salesordre I need to print two different reports at the same time. Because of the printing setup, the reports are printed to a file on the server, where some aditional process is done to the file before it is being printed. Due to the processing the second report need to be delayed. The code looks something likes this: REPORT.RUNMODAL(REPORT1,FALSE,FALSE,Rec); t1 := TIME; REPEAT t2 := TIME; UNTIL t2 > t1 + 5000; REPORT.RUNMODAL(REPORT2,FALSE,FALSE,Rec); Ocationaly this seems to make Financials break down due to an internal program error. Any ideas to what might be wrong?

Try this: REPORT.RUNMODAL(REPORT1,FALSE,FALSE,Rec); SLEEP(5000); REPORT.RUNMODAL(REPORT2,FALSE,FALSE,Rec);

You should always use SLEEP and not a delay loop as navision will eat ALL of your processor cycles when processing the loop. If you have to use loops you should put a YIELD in them, to allow the operating system some processor cycles. If fact Navision only seems to allow windows processing time when it is writing to the screen (and probably calling other windows services such as reading/ writing disks etc). The effect of this is that the computer that the client is running on can come to a near halt when navision is in a loop. So your system is not processing the spool file at the same time as processing Navisions delay loop. Paul Baxter Edited by - triff on 2001 Jun 26 18:45:57