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
Memoline long lines
- Enrico Maria Giordano
- Posts: 8766
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Has thanked: 1 time
- Been thanked: 5 times
- Contact:
- Antonio Linares
- Site Admin
- Posts: 42595
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 38 times
- Been thanked: 86 times
- Contact:
Re: Memoline long lines
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
MemoLine() is extremelly slow.
Better use this technique:
local aLines := hb_ATokens( MemoRead( "test.txt" ), CRLF )
lines length will not be an issue then
- Enrico Maria Giordano
- Posts: 8766
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Has thanked: 1 time
- Been thanked: 5 times
- Contact:
Re: Memoline long lines
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
EMG
- Enrico Maria Giordano
- Posts: 8766
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Has thanked: 1 time
- Been thanked: 5 times
- Contact:
Re: Memoline long lines
I changed one of my project so that it is using hb_atokens now and it works very well, thank you!
EMG
EMG
- Enrico Maria Giordano
- Posts: 8766
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Has thanked: 1 time
- Been thanked: 5 times
- Contact:
Re: Memoline long lines
I'm still searching for a solution. Any ideas? I need to read long lines (more than 254 characters) using MemoLine() with Harbour.
- Enrico Maria Giordano
- Posts: 8766
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Has thanked: 1 time
- Been thanked: 5 times
- Contact:
Re: Memoline long lines
Never mind! I just discovered that Harbour memo functions implicitly support long lines! Great! 

- karinha
- Posts: 7948
- Joined: Tue Dec 20, 2005 7:36 pm
- Location: São Paulo - Brasil
- Been thanked: 3 times
- Contact:
Re: Memoline long lines
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.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341