Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
OK to search .vcx file programatically?
Message
De
15/09/1998 16:58:11
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00136686
Message ID:
00137004
Vues:
26
David -

After re-reading the entire thread including your responses, I thought you were suggesting using the Error event of the Listbox class, but given what you say below, now I'm not sure. I like the idea, however, the code I have which makes the attempt to create the object is a method of the form class, not the list box.

I did want to ask you about what you said earlier. It sounds like you don't need to necessarily do the local error business Ed recommended because aftering closing this class, the error routine reverts to the original. Is that correct? Of course, given that I have a large form class and other errors can occur while I'm in there, perhaps it is safer to do what Ed is suggesting.

Sylvia

>Sylvia,
>
>Another nuance here that might break the code in the future. Given this class tree
>
>
ListBox
>   cListBox
>      TheListBoxOnTheForm
>
>TheListBoxOnTheForm.Click()
>cError = onerror()
>on error blahblah
>newform = createobject()
>on error &cError
>
>You have a class cListbox from which all list boxes are derived. Now it appears you have not overridden it's Error() method... time passes... you add generic error handling to all of your first level subclasses. Now your form will break because the overridden Error() method in cListbox takes precedence over the global error handler.
>
>Needless to say I'm a firm believer in letting the objects handle their own errors or delegating them to another object and not using a global error handler to deal with this type of problem.
>
>>>It will not overwrite. 'cError' preserves it.
>>
>>Great! Thanks a lot for that tip. I learned something new...that hasn't happened in the past 5 minutes:)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform