Code Comments
Programming Forum and web based access to our favorite programming groups.I have an application which I just switched to a DOS window on XP for a clie
nt.
I have tried adding IAMIDLE but am still having the same problem with the
printer pausing during printing.
The IAMIDLE.OBJ file that I'm using(supposedly the latest with all the "bugs
"
fixed
is dated 05/01/1997 3:05AM 297 Bytes
Below is the call to in the main program, PBMAIN and the linker script
This is where I've entered the call to FT_ONIDLE in the main program, PBMAIN
** << PBMAIN - MAIN MENU >> **
FT_ONIDLE({FT_IAmIdle(99,.T.)})
oldcolor := setcolor()
ForSale := { ||ChkType() }
mFAILEDM := SETUP(mmHELP)
DO WHILE .NOT. mFAILEDM
program loop
.............
I use RTLINK as my linker
FI PBMAIN
FI IAMIDLE
FI PBPRO, PBPRO1, PBPRO2, PBPRO3, PRO_FUNC, PB501
FI PBA, PBA1, PBB, PBC, PBD, PBE, PBF, PBH, PBI, PBJ, PBK, PBK1, PBL, PBM
FI PBY, PBZ, P_ERR
LIB C:\CLIP52\lib\clipper
LIB C:\CLIP52\lib\extend
LIB C:\CLIP52\lib\nanfor
LIB C:\CLIP52\lib\nt250
LIB C:\CLIP52\lib\cpmi
OUTPUT PAWN501K
Any help or suggestions would be greatly appreciated by me and especially by
my
client.
Al Nystrom in Sacramento, CA
Post Follow-up to this messageOn 10 Nov 2004 20:12:40 GMT, alnofca@aol.com (AlNofCa) wrote:
>I have an application which I just switched to a DOS window on XP for a cli
ent.
> I have tried adding IAMIDLE but am still having the same problem with the
>printer pausing during printing.
>The IAMIDLE.OBJ file that I'm using(supposedly the latest with all the "bug
s"
>fixed
>is dated 05/01/1997 3:05AM 297 Bytes
>Below is the call to in the main program, PBMAIN and the linker script
>
>This is where I've entered the call to FT_ONIDLE in the main program, PBMAI
N
>
>** << PBMAIN - MAIN MENU >> **
>
>FT_ONIDLE({FT_IAmIdle(99,.T.)})
>
>
>Any help or suggestions would be greatly appreciated by me and especially b
y my
>client.
>Al Nystrom in Sacramento, CA
Hi Al,
I think your line is incorrect. This needs to be a codeblock, so...
FT_ONIDLE( { || FT_IAmIdle(99,.T.) } )
Hope that helps.
Regards,
Ross McKenzie
ValuSoft
Melbourne Australia
valusoft AT optushome DOT com DOT au
Post Follow-up to this messageRoss, I was really hopeful that that would help, but same results.
Post Follow-up to this messageOn 10 Nov 2004 23:26:52 GMT, alnofca@aol.com (AlNofCa) wrote:
>Ross, I was really hopeful that that would help, but same results.
OK Al, lets start from first principles...
If you are running on a Windows box, you should be able to monitor the
cpu usage meter to confirm that the iamidle code is working correctly.
Expect a 1-2% figure with higher peaks matching disk activity. What do
you get?
Are all applications on this XP printer subject to the same
start/pause/finish print cycle? Other DOS apps? If yes, changes in
your Clipper code are unlikely to solve it.
Some time ago, there was a solution suggested associated with a
timeout setting in registry. Detecting the need for changing this
timeout setting involved using this code...
cFile := "TEST.PRN"
set printer to (cFile)
..
set printer to
run ("COPY " + cFile + " PRN")
"If this is faster, your problem is the timeout." Frank circa 2001
Are you flushing your print job correctly? As in, calling this
function at the end of your printing code (after the eject if you have
one).
FUNCTION PRCOMMIT()
#include "set.ch"
local cPrinter := set( _SET_PRINTFILE, "LPT3" )
set( _SET_PRINTFILE, "LPT2" )
set( _SET_PRINTFILE, "LPT1" )
set( _SET_PRINTFILE, "" )
// restores the original printer-port!
set(_SET_PRINTFILE, cPrinter, .t.)
return nil
That is all that I can think of for the moment...
Regards,
Ross McKenzie
ValuSoft
Melbourne Australia
valusoft AT optushome DOT com DOT au
Post Follow-up to this messageI did note that cpu usage is 100% so I assume something is not correct in my implementation.????
Post Follow-up to this messageAl, >Ross, I was really hopeful that that would help, but same results. Your link script looks fine, and with the syntax Ross gave you FT_IAmIdle() should work as advertised. What does Performance Monitor say about processor usage when the application is idle at a wait state? If it says something like 1-2% then FT_IAmIdle() is doing what it is supposed to do, and we need to look elsewhere for the cause of your slow printing. Could you describe the slowness in a little more detail? How long is the pause? Is the print speed normal before and after the pause? Is there more than one pause in each job? How do you set up the print job and how do you finish it? Are you sure that the spooler is properly flushed? Do you start with SET PRINTER TO LPT1 (or LPT2 or LPT3) and finish with SET PRINTER TO (without a port name)? Do you eject before the final SET PRINTER TO? Klas ------- klas dot engwall at engwall dot com Spammers, please use this address :-) mailto:postmaster@[127.0.0.1]
Post Follow-up to this messageAl, >I did note that cpu usage is 100% so I assume something is not correct in m y >implementation.???? Hmm, have you checked that the linker can actually find iamidle.obj? Klas ------- klas dot engwall at engwall dot com Spammers, please use this address :-) mailto:postmaster@[127.0.0.1]
Post Follow-up to this messageThe performance monitor shows 100% and typically about 3/4 of a page prints. It's the same on another clipper program that I wrote when I test it on XP. It doesn't appear that that that the IAMIDLE is being linked.??? I eject at th e end of the print. I start a print job with Set console off set device to print set print on end the print with an eject set console on set device to screen set console on
Post Follow-up to this messagehow do I check to see if the linker found iamidle.obj???
Post Follow-up to this messageAl, >The performance monitor shows 100% and typically about 3/4 of a page prints . >It's the same on another clipper program that I wrote when I test it on XP. It >doesn't appear that that that the IAMIDLE is being linked.??? I eject at t he >end of the print. As I mentioned in a later post, you need to verify that the linker can find iamidle.obj. If it can't, it will link the old version from nanfor.lib instead. An easy test is to comment out nanfor.lib from the link script. If the linker complains about FT_OnIdle() but not FT_IAmIdle(), then iamidle.obj is linked in. That's the CPU hogging part of the problem. The printing part is actually a different problem. The spooler is never flushed, so it is waiting for the system-defined timeout before it releases the print job. Add the two lines below to take care of that. >I start a print job with set printer to lpt1 (or lpt2 or lpt3) >Set console off >set device to print >set print on >end the print with >an eject >set console on >set device to screen >set console on set printer to Klas ------- klas dot engwall at engwall dot com Spammers, please use this address :-) mailto:postmaster@[127.0.0.1]
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.