Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Procedure or Class - What are the Benefits
Message
De
15/01/2003 15:42:09
Mike Yearwood
Toronto, Ontario, Canada
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00740837
Message ID:
00742099
Vues:
43
I can't think of any scenarios. I haven't used them for years. The only benefit I can see is for sending a collection of related procedures to someone else. Makes it harder to forget to send one if their all in one file.

>Mike,
>
>When is it recommended to use a procedure?
>
>>Hi Alan
>>
>>If you would leave the little procedure in its own .PRG file, there would be no need to SET PROCEDURE TO and it would be even faster (especially once you compile an EXE).
>>
>>>Glenn,
>>>
>>>That is exactly what I needed to know.
>>>Thank you.
>>>
>>>>I mean that if the calling object has already done a "set procedure" to the procedure library which contains this procedure, there is no obvious benefit to contructing an object. In fact if no features of Object Oriented programming are needed, there is more overhead to creating and destroying an object.
>>>>
>>>>Glenn
>>>>
>>>>
>>>>>Glenn,
>>>>>
>>>>>By 'loaded' do you mean that there is a 'set procedure to' command or that any one of the procedures in the library has been accessed since the app has started?
>>>>>TIA.
>>>>>
>>>>>>If this procedure library is already loaded, ther is no advantage to creating a class, except if you have need to subclass.
>>>>>>
>>>>>>Glenn
>>>>>>
>>>>>>>I have a simple procedure which I have placed in a procedure library which, based upon a parameter passed, will delete all files from a directory with that filename and the various extensions (dbf, cdx, etc).
>>>>>>>
>>>>>>>Is there any benefit (speed of execution or otherwise) to creating a class and dropping it onto the forms that need to call this procedure?
>>>>>>>
>>>>>>>Thank you in advance.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform