Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Defining Optional Parameters in a VFP Class Object
Message
From
15/04/2000 09:59:29
 
 
To
15/04/2000 03:21:20
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00359990
Message ID:
00360004
Views:
10
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
Previous
Reply
Map
View

Click here to load this message in the networking platform