Mike Yearwood
Toronto, Ontario, Canada
Information générale
Catégorie:
Codage, syntaxe et commandes
Titre:
Always better to ...?
Hi All!
I often wonder what is the most efficient way to code things. For instance, it seems that to alltrim(upper(fieldname)) must always be slower than upper(alltrim(fieldname)). I'm assuming in the first example, that the upper will operate on all characters in the field. In the second, upper will only act on the remaining characters. So, I always use the second method.
How about this code...
IF ! USED("sometable")
SELECT 0
USE sometable
ELSE
SELECT sometable
ENDIF
Wouldn't it ALWAYS be better to ...?
IF ! USED("sometable")
USE sometable in 0
ENDIF
SELECT sometable
Now oddly enough, from speed trials I did, I'm not seeing much if any difference, and either piece of code may win the race, however, less typing means less mistakes.
Anyone care to add other little bits of code? I mean, nothing more than 10 lines.
Seems more appropriate than some other threads up here <s>...
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement