xBrowse - extractline - speed

Post Reply
User avatar
Otto
Posts: 6403
Joined: Fri Oct 07, 2005 7:07 pm
Has thanked: 22 times
Been thanked: 2 times
Contact:

xBrowse - extractline - speed

Post by Otto »

function ExtractLine( cText, nFrom )

I found out that if I use instead of
nAt := At( CRLF, SubStr( cText, nFrom ) )

nAt := At( CRLF, cText, nFrom )

the speed of the function is much better. Is it save to remove SubStr here?

Thanks in advance
Otto

function ExtractLine( cText, nFrom )
local cLine, nAt

nAt := At( CRLF, SubStr( cText, nFrom ) )

if nAt > 0
cLine := Substr( cText, nFrom, nAt - 1 )
nFrom += nAt + 1
else
cLine := Substr( cText, nFrom )
nFrom := Len( cText ) + 1
endif

return cLine

//----------------------------------------------------------------------------//
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
nageswaragunupudi
Posts: 10721
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 8 times
Contact:

Re: xBrowse - extractline - speed

Post by nageswaragunupudi »

Is it save to remove SubStr here?

Yes in xHarbour.
This extended syntax is not supported by Harbour ( to my knowledge )
Regards

G. N. Rao.
Hyderabad, India
Post Reply