Print routine delay using Pagescript 
Author Message
 Print routine delay using Pagescript

When I invoke a print routine using PageScript, there is approximately a 50
second delay before it starts to print a simple 11 line printout. By

platform.  A simplified but representative sample of the print routine,
called from a desktop shortcut or the Dos prompt, is outlined below. If I
remove the Inkey(0) command, which simulates a return to the calling menu in
my app, the delay before the start of printing is a satisfactory 5 seconds.
Can anyone suggest what the cause of the problem is and the solution?

#include "Pscript.ch"

Select  Slsman  // dbf destination file
goto top


If Psinit() == 0
   PSBeginDoc(nPRINTER)
   PSSetUnit(APS_TEXT)
   Do while .not. Eof()

      Skip
   Enddo
   PSEndDoc()
Endif

Inkey(0)  // Simulates return to calling menu after printing is complete
***********************
Static Function PrntSelect()
   nPRINTER := SelectPrinter()
**************************
Static Function SelectPrinter()
Cscreen  := Savescreen(12,25,16,63)
Aprinters := PSGetPrinters()

Nprinter := Achoice(13,26,15.62,Aprinters)
RestScreen(12,25,16,63,Cscreen)
Set color to (White on Blue)
Return nPRINTER



Sat, 17 Sep 2005 06:47:14 GMT  
 Print routine delay using Pagescript


Quote:
> Can anyone suggest what the cause of the problem is and the solution?

The Inkey(0) is hogging the CPU. You need to add a CPU idle function to
your program. A free library that includes flexible CPU idle functions is
available from The Oasis at http://www.the-oasis.net/ (unfortunately, I
don't recall the name of the library, so you'll have to do some searching).


Mon, 19 Sep 2005 17:20:43 GMT  
 Print routine delay using Pagescript

Quote:


> > Can anyone suggest what the cause of the problem is and the solution?

> The Inkey(0) is hogging the CPU. You need to add a CPU idle function to
> your program. A free library that includes flexible CPU idle functions is
> available from The Oasis at http://www.the-oasis.net/ (unfortunately, I
> don't recall the name of the library, so you'll have to do some
> searching).

The VFAQ <URL:http://www.davep.org/clipper/VFAQ/>, which is posted here
weekly, points to a number of solutions. Perhaps the one you're thinking of
is Phil's "Multi"?

--
Dave Pearson                        |  OSLib - Timeslice release functions.
http://www.davep.org/               |     eg - Norton Guide reader for Linux.
http://www.davep.org/clipper/       |    weg - Norton Guide reader for Windows.
http://www.davep.org/norton-guides/ | dgscan - DGROUP scanner for Clipper.



Mon, 19 Sep 2005 18:34:26 GMT  
 Print routine delay using Pagescript
Eugene

The PSInit should only be run once, but at the start of the program, not
before the print.
There is quite a significant delay on the Init, but it isn't an issue.

--
Jon Justin
Harmony Software


Quote:
> When I invoke a print routine using PageScript, there is approximately a
50
> second delay before it starts to print a simple 11 line printout. By

> platform.  A simplified but representative sample of the print routine,
> called from a desktop shortcut or the Dos prompt, is outlined below. If I
> remove the Inkey(0) command, which simulates a return to the calling menu
in
> my app, the delay before the start of printing is a satisfactory 5
seconds.
> Can anyone suggest what the cause of the problem is and the solution?

> #include "Pscript.ch"

> Select  Slsman  // dbf destination file
> goto top


> If Psinit() == 0
>    PSBeginDoc(nPRINTER)
>    PSSetUnit(APS_TEXT)
>    Do while .not. Eof()

>       Skip
>    Enddo
>    PSEndDoc()
> Endif

> Inkey(0)  // Simulates return to calling menu after printing is complete
> ***********************
> Static Function PrntSelect()
>    nPRINTER := SelectPrinter()
> **************************
> Static Function SelectPrinter()
> Cscreen  := Savescreen(12,25,16,63)
> Aprinters := PSGetPrinters()
> Set color to (White on Red)


> Nprinter := Achoice(13,26,15.62,Aprinters)
> RestScreen(12,25,16,63,Cscreen)
> Set color to (White on Blue)
> Return nPRINTER



Tue, 20 Sep 2005 08:48:45 GMT  
 Print routine delay using Pagescript
Jon,
    I disagree with you about it "not being an issue".  I have several
customers who are
running either Windows 2000 or Windows XP who have to wait so long for the
PSINIT
to initialize that they come to think their programs are all locked up.
Finally after several
minutes, the program usually proceeds, but it has become an embarrassment to
me that
my program seems to be running so much worse than before.  It seems like it
is only
since upgrading to the PScript Version 4.  We never seemed to experience the
problem
to this degree when running version 3.08.
- Randy Howe


Quote:
> Eugene

> The PSInit should only be run once, but at the start of the program, not
> before the print.
> There is quite a significant delay on the Init, but it isn't an issue.

> --
> Jon Justin
> Harmony Software



Wed, 21 Sep 2005 07:20:51 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. slow printing using abee pagescript

2. Delayed printing in WfW when using net printer

3. PageScript and print errors

4. Printing with Pagescript from aBeelabs

5. delay routines

6. App prints with 30 secs delay

7. Print Delay Help!!

8. Off Topic - Dos Network Printing Delay

9. Printing delay in XP

10. slow/delayed printing under Windows XP

11. Win2000 and printing delay

12. Printing Delays under NT WS 4.0

 

 
Powered by phpBB® Forum Software