Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFPConversion Seminar - May 9-10 - Dallas, TX
Message
De
14/04/2005 11:02:13
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Conférences & événements
Divers
Thread ID:
01002513
Message ID:
01004680
Vues:
50
Rod,

I agree -- this is an interesting discussion. Thanks for the .NET example.

>Hi Walter and Martin
> This is a great discussion. I just wanted to add a couple of items.
>
> In .NET all objects inherit from the object class so it is possible to pass objects to a function in a generic way. It's basically the job of the function to deal with that object as it sees fit.
>
>I like the example walter used where he recurses a form hierarchy testing for the data type of the object and partying on that object correctly. You can do this in .NET as well
>
>The syntax is similar as well....
>
>Basically it's like this
>
>Function MyFunction(oObject as object)
>
>If TypeOf oObject is Form
> '-- party on the form object
>ElseIf TypeOf oObject is Button
> '-- party on the button object
>Else.....
>and so-on
>
>You can also add Interfaces to your objects and test for the existance of that interface.
>Example
>
>If TypeOf oObject is IRodBinding
> Ctype(oObject,IRodBinding).BindingFunction
>Else......
>
>I like the .NET way of doing this. It's different than in VFP. Like where we use the Type() function to determine whether an object supports a particular property or method...
>
>
>Thanks
>Rodman
David Stevenson, MCSD, 2-time VFP MVP / St. Petersburg, FL USA / david@topstrategies.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform