Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
I hate it, when it happens!
Message
De
02/11/2001 19:33:30
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00576933
Message ID:
00577065
Vues:
22
>>>Here is a tip I learned at WhilFest this week to close a table without getting error. Instead of this code:
>>>if used('mytable')
>>>   use in mytable
>>>endif
>>>Someone showed this:
Use in select('mytable')
>This relies on the undocumented behaviour of SELECT() - that it returns 0 if the alias is not found, rather than throwing an error. IMO it's an example of "cute" code vs. code that is self-documenting and that doesn't rely on undocumented features.
>
>In this case we souldn't use select('mytable') at all because it's return value isn't documented. :)

The value *is* documented if "mytable" is USED().
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform