Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Defining Optional Parameters in a VFP Class Object
Message
De
15/04/2000 09:59:29
 
 
À
15/04/2000 03:21:20
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00359990
Message ID:
00360004
Vues:
11
Martin,

>In VFP I do not receive an error if I use...
>MyData.Close()
>
>... this should close all open tables. But when I try to do the same in VB I get an error "Agrument not optional...". This is how I used the object in VB.

Obviously your VFP COM object is designed to test the presence of a filename parameter and close just that file, or if the parameter is .f. or PARAMETERS() is 0, you close all. That works since VFP defaults to .f. for unpassed parameters and you can call the class from VFP without an error.

Why not just change the class slightly to accept "ALL" as a parameter and call it with that parameter when you want all tables closed.

Or perhaps a CloseAll method that requires no parameters. Either one of these should make VB happy.

I'm not a VB person, so I might be missing something here, but that is what logic tells me to try.
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