xBrowse - extractline - speed

xBrowse - extractline - speed

Postby Otto » Wed Sep 15, 2010 3:04 pm

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
Otto
 
Posts: 6364
Joined: Fri Oct 07, 2005 7:07 pm

Re: xBrowse - extractline - speed

Postby nageswaragunupudi » Wed Sep 15, 2010 3:30 pm

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
User avatar
nageswaragunupudi
 
Posts: 10690
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 86 guests