Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
File is in use
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Versions des environnements
Visual FoxPro:
VFP 8
Database:
Visual FoxPro
Divers
Thread ID:
00970099
Message ID:
00970259
Vues:
19
I don't know how it is possible to construct resuseable/loosely coupled classes and use static alias names.

In the example below, if the alias "per" is expected to be used by an object, - what if another object is instantiated in the same datasession that wants to use the same table ? It means that objects have to be aware of other objects that want the same alias - not very reuseable !!

I always use temporary alias names -
eg.

SELECT 0
USE mytable AGAIN
lcMyAlias = ALIAS()

SELECT * ;
FROM (lcMyAlias) ......

Is this common pratice or are people sharing a cursor between objects and carefully taking note to restore the record pointer/order etc. etc. ?

>IF the table to be used is already open in another workarea than the current one, it will be opened in a new workarea with a different alias. That could be a problem if you were expecting it to be a known alias name. At least that is how it works in VFP6. Wouldn't it be better if you are concerned about whether the table is already open us use something like :
>
>
IF !USED("PER")
>     USE PER ALIAS PER IN 0
>ENDIF
>SELECT PER
Cheers,
Jamie
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform