Wait for activity to finish before next FOR loop

Paul Mulroney pmulroney at logicaldevelopments.com.au
Wed Jul 27 01:03:20 UTC 2022


Hi Das,

This is one way that you can handle asynchronous printing, by putting Omnis in a tight loop waiting for it to finish executing.  With this approach, you'll see the CPU usage go up, as Omnis sits there in the tight loop banging away until it's done.

The other way is to use the callback scheme - in $pdfcomplete() just tell it to start printing the next one.  You would then change your printing "loop" to just print one report, and let the $pdfcomplete() method trigger the printing of the next one.

Regards,
Paul.


> On 27 Jul 2022, at 12:06 am, Das Goravani <goravanis at gmail.com> wrote:
> 
> 
> Have a task variable called PDFComplete, a boolean.
> Set it to zero when you start printing one invoice.
> In $pdfcomplete() method, set it to KTrue
> Back in printing method, do this after you print one:
> 
> While not(PDFComplete)
> End While
> 
> So that just spins until $pdfcomplete sets that to kTrue
> 
> This is a simple delay technique that won’t go forward until the last one is printed.
> _____________________________________________________________
> Manage your list subscriptions at https://lists.omnis-dev.com
> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com 


A bicycle can't stand alone; it's just two tired.
-- 
Paul W. Mulroney                                            We Don't Do Simple Pty Ltd 
pmulroney at logicaldevelopments.com.au       Trading as Logical Developments
www.logicaldevelopments.com.au                   ACN 161 009 374 
Ph: +61 8 9458 3889                                       86 Coolgardie Street
                                                                         BENTLEY  WA  6102





More information about the omnisdev-en mailing list