Information générale
Catégorie:
Codage, syntaxe et commandes
>Hi Sandy.
>
>>As c# developers know, we can't write a method/procedure/function in c# outside of a class.
>>But in VFP you can.
>
>Think of a VFP function or procedure as a static method of a class in that you can call it without having to instantiate the class. Sometimes it makes sense to make a method static, other times to require instantiating the class so you get persistent state (that is, the properties of the class).
>
>One big benefit of VFP functions is that they can be called from expressions, such as in reports. e.g. MyFunction(SomeParameter). Class methods can't be called that way unless the class has been instantiated into an object that's visible to the expression evaluation e.g. SomeObject.MyFunction(SomeParameter). That means the report (or whatever has the expression) is more tightly coupled to the calling code, which is never a good thing.
>
>Doug
Good points.
Thanks
Précédent
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