Thank Martinmartingz wrote:Esgici try chage this
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\WOW\LPT_timeout
default 15 change to 1
works fine in XP
Viva HMG
Moderator: Rathinagiri
Thank Martinmartingz wrote:Esgici try chage this
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\WOW\LPT_timeout
default 15 change to 1
works fine in XP
I'm still waiting that text converterJayadev wrote:I can help you with a generic text converter.
Code: Select all
SET DEVICE TO PRINTER
SET PRINTER TO listado.txt
*-*-*-*-*-*-*-*-*-*-*
SET PRINTER TO LPT1.
*-*-*-*-*-*-*-*-*-*-*
a job to finish spoolingjayadevu wrote: The generic converter is of use only if you want to print your existing .txt or .prn file to any printer like usb based etc. It does not wait for you to quit the program to print. Actually what is happening is your print spooler is waiting for a job to finish spooling. When you quit the program, the job finishes spooling and it fires the job. I had similar problems which were overcome by the use of winprintraw commands.
Well,Please show me a small code snippet of your printing routine. a KISS example
Code: Select all
STORE 0 TO pagenum, counter
TLINE = 61
title( "Selling Price List", 4 )
GO TOP
SET DEVICE TO PRINT
DO WHILE .NOT. EOF()
DO REPHEAD // Print head lines, increment and print page no etc
@ TLINE + 6, 1 SAY "CODE DESCRIPTION PRICE UNIT"
@ TLINE + 7, 1 SAY ULINE
STORE TLINE + 8 TO TLINE
@ TLINE, 1 SAY STKCODE + " " + DESCR + " " + Str( SELL&T, 7, 2 ) + " " + unit
TLINE = TLINE + 1
SKIP
ENDDO
SET DEVICE TO SCREEN
Code: Select all
the_prn = "LPT" + alltrim(str(mprinter2)) // mprinter2 is printer port no ( 1/2 ) of user
set printer to &the_prn
store 0 to tline
set device to print
heading = "ACCOUNT PAYMENT"
@ tline,1 say MCODE
@ TLINE + 1,1 SAY MREF
@ tline + 2,33 SAY "---------"
@ tline + 3,23 SAY "T O T A L"
@ tline + 3,33 say STR(msub,9,2)
@ tline + 4,33 SAY "========="
@ TLINE + 6,1 SAY MUSERNAME
eject_paper()
@ tline,1 say MCODE
@ TLINE + 1,1 SAY MREF
@ tline + 2,33 SAY "---------"
@ tline + 3,23 SAY "T O T A L"
@ tline + 3,33 say STR(msub,9,2)
@ tline + 4,33 SAY "========="
@ TLINE + 6,1 SAY MUSERNAME
eject_paper()
set_condoff()
SEtpgln(66)
the_prn = "LPT" + alltrim(str(mprinter1))
set printer to &the_prn
set device to screen
Done; your utility truncates linesPlease download the following utility ... and use it to print any .txt or .prn file to any of the printers available in your computer or network.
My curiosity about your converter is risingMy converter allows you to convert your general .txt file into one that the usb printers understand.
Code: Select all
//1. Create the following functions in your main prg file
function loadfile(cFname)
set printer to (cFname)
set device to printer
set printer on
setprc(0,0)
//page_no() - optional function to print page no
return NIL
Function UnloadFile
setprc(0,0)
set device to screen
set printer off
set printer to
pg_no := 0
return NIL
function reportfile(cFile)
LOCAL t := 3,l := 0, b := MaxRow()-2, r := MaxCol()
LOCAL save_win := win_save()
local ADISPCOLORS := {;
{ '~~R', 'W+/R' } ,;
{ '~~7', 'W/N' } , ;
{ '~~N', 'N/R' } , ;
{ '~~D', NIL };
}
// filebrowse is a function dowloaded from OASIS, very good function, does not display control characters and
// file can be of any size)
filebrowse(cFile,t,l,b,r,;
"bg+/b","bg/b","bg+/b","gr+/bg",,aDispColors)
win_rest(save_win)
return NIL
Function PrintFile(cFile)
#ifdef __XHARBOUR__
WinPrintRaw( cPrinter,cFile,cFile )
#else
WIN_PRINTFILERAW( cPrinter, cFile, cFile )
#endif
return NIL