FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour IMPRIMIR UN ARCHIVO PLANO .TXT
Posts: 214
Joined: Sat Aug 19, 2006 01:37 PM
IMPRIMIR UN ARCHIVO PLANO .TXT
Posted: Thu Jul 12, 2007 09:11 PM

Amigos cual es la forma mas rapida y facil de imprimir un archivo plano un .txt,, desde codigo,, y que dicha impresion se haga en la impresora por defecto del pc de dnd se imprima

recuerdo que en DOS era PRINT LTP1 archivo.txt,,, pero la limitante era que solo se podia en la LPT1,, creo

alguien sabe

GRACIAS

Mi segundo amor es Programar
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
IMPRIMIR UN ARCHIVO PLANO .TXT
Posted: Fri Jul 13, 2007 04:28 PM
test.prg

#include "FiveWin.ch"

function Main()

   local oPrn, cText := MemoRead( "test.prg" ), n := 0
   local nRowStep, oFont
   
   PRINTER oPrn PREVIEW
   
      DEFINE FONT oFont NAME "Courier New" SIZE 0, -10 OF oPrn
      nRowStep = oPrn:nVertRes() / 40
      
      PAGE
         while n < 40
            oPrn:Say( n * nRowStep, 1, MemoLine( cText,, n + 1 ), oFont )
            n++ 
         end   
      ENDPAGE
      
   ENDPRINTER
   
   oFont:End()

return nil

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion