Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SEEK and LOCATE and UPPER and ALLTRIM
Message
De
14/01/2009 03:00:23
 
 
À
13/01/2009 20:38:37
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01373413
Message ID:
01373445
Vues:
32
>There is an index on TableFormProperties.TableName, but the date is in mixed case, so I can't do a SEEK (or can I?). I'm doing this in a LOCATE, but that seems a bit wrong somehow. Is this the right way to do it, or is there a better way.
>
>lcTableName = "MyTableName"
>SELECT TableFormProperties
>LOCATE FOR ALLTRIM(UPPER(TableName) = ALLTRIM(UPPER(lcTableName))
>
It's my opinion that Alltrim() should be avoided as much as possible, unless you really need it. This code will give the same result, and will be much faster if you have an index tag on upper(Tablename). It will also be independent of the Set Exact setting:
lcTableName = "MyTableName"
SELECT TableFormProperties
lcTableName = padr(lcTableName,len(TableName))
LOCATE FOR UPPER(TableName) == upper(lcTableName)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform