I'm trying to adapt the code below to use Print command, but I'll take two attempts without success.
Code: Select all
Parameters cArchivo
Local nArch, nNvo, cLinea, i, cCar, cSist
cSist := 'Sistema'
BEGIN SEQUENCE
nArch := FOpen( cArchivo, FO_READWRITE )
If FError() # 0
? "Error:"+LTrim(Str(FError()))+". Al tratar de abrir el archivo...<Enter>"
Break
Endif
BEGIN SEQUENCE
cLinea := ""
nPag := 1
Set Device To Printer
Set Print On
Do While .T.
cCar := FReadStr( nArch, 1 )
cLinea += cCar
If cCar == "" // Fin de archivo
Exit
Endif
If cCar == CHR(10) // Fin de la linea
If PRow() >= 60
? ''
? Repl( '-', 80 )
? PadL( 'Pag. '+Str( nPag++), 78)
Eject
? cSist + Space(50)+ 'Manual del usuario'
? Repl( '-', 80 )
? ''
Endif
? Left(cLinea, Len(cLinea)-1 )
cLinea := ""
Endif
Enddo
Set Print Off
Set Printer To
END SEQUENCE
FClose( nArch )
END SEQUENCE
ReturnBest Regards,
Javier