Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Design question - how to interrupt process
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01018971
Message ID:
01019009
Vues:
23
Nadya,

If the object releases itself upon setting the cError property, how will the calling object know there was an error or what it was? I would think that you would just want your RunProcess method to return a value (maybe true/false or some numeric return codes). Then, your calling object could just create the object, call RunProcess, check the return value for success or failure, and if failure, check the cError property. Then, once the RunProcess either finished successfully or the cError property was checked and acted upon, the calling object could destroy the BusinessProcess (if necessary).

Typically, the only time you want objects to destroy themselves is when they run unattended (or in another thread) and can log results by themselves to someplace that remains after the object is gone. Such as an object that creates a log file of what it did as it ran overnight.

HTH,
Chad

>Hi everybody,
>
>I'm creating a custom class called BusinessProcess. In this class I'm going to have RunProcess method. If some error conditions occur, I want to be able to stop the process immediatelly.
>
>I have cError property. If I set this property to something, it means, I have an error and want to stop. My question is: is it advisable to create a custom Release method (call Destroy() in it) and call this method in cError_Assign?
>
>Or there are better ideas?
>
>Thanks in advance.
_________________________________
There are 2 types of people in the world:
    Those who need closure
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform