Information générale
Catégorie:
Programmation Orientée Object
>>>>Jim
>>>>How do I set up and save a class based on Session in a Class library. "Session" is not available on the drop down - but is in DEFINE CLASS....
>>>
>>>David,
>>>
>>>You don't, you use DEFINE CLASS in a prg.
>>
>>Jim, can I give you a simple non-real example of what I would like to do?
>>Lets say I have an addressing module and it does all sorts of neat things with addresses. It also uses an "Address" table which I wan't to be in a private data session belonging to the class.
>>I would then want to be able to write, for example, a method called exists..
>>function exists
>>lparameter nAddrnum
>>return indexseek(m.nAddrNum, 'Address', 'Addrnum')
>>
>>In my main program I would have:
>>private oAdr
>>oAdr= NewObject('Address', ....)
>>
>>Where, how, would you suggest I incorporate a "session" so that this object, which persists for almost the entire application, has it's own "hidden" use of the "address" table? Assume oAdr is currently based on a custom class.
>
>
>Maybe in the init of the address object you have to create an instance of a session, assign the appropriate properties, and bind it to a property of the Address object.
Then the data session of the object will still be the default data session, since that is where it was created. I wan't to be so that whenever a method is run in the object it refers to its own datasession, like a form.
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement