Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Memory objects saved into cursors
Message
De
19/02/2019 08:55:15
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01666501
Message ID:
01666536
Vues:
56
>>I'm looking for a way to reference memory objects that are live in memory, instantiated, viable, able to be called, but to reference them later, not now, meaning in a few minutes while they are still live and viable.
>>
>>In C/C++ I would store a reference to the pointer in a memory structure, or save the memory address to a disk file and then reconstitute the pointer by decoding the address. I don't know of a way to do this in VFP, and I'm needing it. :-)
>
>In this case you could add those classes to a collection with a key and use the key to reference the objects. You could implement the collection as singleton.
>
>lcGuid = GenerateGuid()
>ObjectCollection.Register(lcGuid, loMyObject)
>INSERT INTO MyTable (ProcessID) Values (lcGuid)
>
>SCAN
> loObject = ObjectCollection.Get(MyTable.ProcessID)
> …
> RELEASE loObject
> ObjectCollection.Remove(MyTable.ProcessID)
>ENDSCAN
>
>Question is then, why you need a table in the first place, the collection itself could handle the storage and access logic.

The table conveys information about the operation taking place so the user can review and enable / disable it.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform