Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Safe Table Opening Code -How's This?
Message
De
26/10/2001 16:33:43
 
 
À
26/10/2001 16:28:18
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00573683
Message ID:
00573998
Vues:
18
Hilmar,

Oh, I see. You are saying to put the code to close the table in the destroy() method. Are thought you were saying the tables would automatically close when the class went out of scope.

I'm with ya!


>
>No: what I meant is that you create an object (or class) to open a table. The object remembers the name of the alias, and closes it, when the corresponding variable goes out of scope. Thus, after doing this programming once, in the "Table_Open" class, you save yourself the table closing later.
>
>All this isn't required when you have a private datasession, since the tables are closed automatically, anyway.
>
>Let me illustrate:
>
>
>Function SomeProcess
>local loTableObject
>* This command will open the table, with the specified index, assign buffering, etc.
>loTableObject = CreateObject("cTableObject", TableName, Index, Alias, Buffering, etc.)
>...
>Further processing here
>...
>* Here, at the EndFunc, the table gets closed, because:
>* 1) Variable loTableObject gets destroyed (out of scope),
>* 2) This, in turn, invokes loTableObject.Destroy(),
>* 3) which was appropriately programmed to close the table.
>EndFunc
>
>
>Hilmar.
Steve Gibson
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform