Manu,
Google traduce fácil y aceptablemente: al menos eso creo. :)
http://translate.google.com/?hl=es#es|en
"
Hello Pritpal, I see that you use a lot len(a) inside the loops and is
evaluation at each iteration.
For example MemoToArray would be more optimized as follows:
"
Un saludo
Xavi
Manu escribió:
Hola Pritpal veo que usas mucho len( a ) dentro de los bucles y eso se
evalua en cada iteración.
Por ejemplo MemoToArray quedaría más optimizada así:
FUNCTION MemoToArray( s )
LOCAL a_, b_, i, j, n
s := trim( s )
s := strtran( s, CRLF, _EOL )
a_:= hb_atokens( s, _EOL )
n := len( a_ ) // <----------------------
FOR i := n TO 1 step -1
IF !empty( a_[ i ] )
EXIT
ENDIF
NEXT
IF i < n
b_ := Array( i ) // <----------------------
FOR j := 1 TO i
b_ := a_[ j ]
NEXT
ENDIF
RETURN b_
_______________________________________________
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour