Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Always better to ...?
Message
De
26/02/2000 13:44:54
Mike Yearwood
Toronto, Ontario, Canada
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Always better to ...?
Divers
Thread ID:
00338054
Message ID:
00338054
Vues:
63
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
Fil
Voir

Click here to load this message in the networking platform