Page 1 of 1
Memoline long lines
Posted: Mon Feb 14, 2022 11:32 am
by Enrico Maria Giordano
Dear friends, how can I read long lines (ie. more than 254 characters long) using Memoline() with Harbour? xHarbour's Memoline() already supports long lines but the Harbour's one not.
EMG
Re: Memoline long lines
Posted: Mon Feb 14, 2022 4:32 pm
by Antonio Linares
Dear Enrico,
MemoLine() is extremelly slow.
Better use this technique:
local aLines := hb_ATokens( MemoRead( "test.txt" ), CRLF )
lines length will not be an issue then
Re: Memoline long lines
Posted: Mon Feb 14, 2022 7:44 pm
by Enrico Maria Giordano
Thank you, I'll think about it for future projects. For existing ones I need Memoline(). It is very fast if used in the proper way.
EMG
Re: Memoline long lines
Posted: Tue Feb 15, 2022 8:48 am
by Enrico Maria Giordano
I changed one of my project so that it is using hb_atokens now and it works very well, thank you!
EMG
Re: Memoline long lines
Posted: Thu Sep 22, 2022 9:46 am
by Enrico Maria Giordano
I'm still searching for a solution. Any ideas? I need to read long lines (more than 254 characters) using MemoLine() with Harbour.
Re: Memoline long lines
Posted: Thu Sep 22, 2022 9:53 am
by Enrico Maria Giordano
Never mind! I just discovered that Harbour memo functions implicitly support long lines! Great!

Re: Memoline long lines
Posted: Thu Sep 22, 2022 4:52 pm
by karinha
Code: Select all | Expand
// IMPRIMINDO UM TEXTO COM A PRINTER.PRG// Em: 22/09/2022 - Covid-19 - Joao Santos - kapiabafhw@gmail.com#include "FiveWin.ch"FUNCTION Main
() LOCAL cImptxt, cTexto, oPrn, oFont, nLin, nLinha
cImpTxt := MemoRead
( "ARQ.txt" ) // Pega o texto cTexto := ALLTRIM
( cImpTxt
) PRINTER oPrn
NAME "Imprimindo um TXT" PREVIEW
MODAL DEFINE FONT oFont
NAME "COURIER NEW" SIZE 0, -
8 OF oPrn
oPrn:
SetPage( 9 ) // A4 oPrn:
SetPortrait() // Vertical PAGE nLin :=
1 FOR nLinha =
1 TO MLCOUNT
( cTexto,
100 ) SYSREFRESH
() oPrn:
CmSay( nLin := nLin + .
4,
1.5, MEMOLINE
( cTexto,
100, nLinha
), oFont
) IF nLin >
25 nLin :=
1 ENDPAGE PAGE ENDIF NEXT ENDPAGE ENDPRINT oFont:
End()RETURN NIL// FIM
Rwegards, saludos.