Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
GLGDW 2006 - April 21-24, Milwaukee
Message
From
19/01/2006 08:23:11
Mike Yearwood
Toronto, Ontario, Canada
 
General information
Forum:
Visual FoxPro
Category:
Conferences & events
Miscellaneous
Thread ID:
01078694
Message ID:
01088339
Views:
33
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform