Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
GLGDW 2006 - April 21-24, Milwaukee
Message
De
19/01/2006 08:23:11
Mike Yearwood
Toronto, Ontario, Canada
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Conférences & événements
Divers
Thread ID:
01078694
Message ID:
01088339
Vues:
32
>We have several routines/quirks that are prsent in our company coding standards.
>
>
>BAsically all tables are aliased into variable so they can be changed in one place in each method/function.
>
>All of our scans are run around variables containing alias names:
>
>lcAlias = 'Table'
>...
>...
>...SELECT &lcAlias

However, if 'Table' was Customer.DBF the code that refers to lcAlias now becomes less readable. You could get the very same effect without the need for any evaluation or macrosubstitution using the USE command itself. If the table name changed, you would just change the USE line. CustomerAlias would be an unlikely change as the method should be dealing with Customers - in this example.

USE Table ALIAS CustomerAlias
select CustomerAlias
scan

If the routine was more generic, such as it was updating a table with some values you could...

USE Table alias TargetTable
SELECT TargetTable
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform