IMPRIMIR UN ARCHIVO PLANO .TXT

IMPRIMIR UN ARCHIVO PLANO .TXT

Postby A&C » Thu Jul 12, 2007 9: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
User avatar
A&C
 
Posts: 214
Joined: Sat Aug 19, 2006 1:37 pm
Location: Chile

Postby Antonio Linares » Fri Jul 13, 2007 4:28 pm

test.prg

Code: Select all  Expand view
#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

Image
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41947
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 85 guests