Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Unlimited number of parameters
Message
From
27/01/2005 12:48:58
 
 
To
26/01/2005 17:56:02
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00981000
Message ID:
00981282
Views:
46
>I have an application that will receive an unlimited number of parameters. In VB.NET, I can have:
>
>
>    Sub Main(ByVal CmdArgs() As String)
>
>
>to define the entry parameters and have as much as I want.
>
>But, in VFP, I don't know if the same can be obtained. Is the only way to define, for exemple, up to 20 parameters, and verify each of them until I find one that is not passed? This approach would be like creating a long buffer of parameters in order to respond to an unlimited number of parameters being passed. Is that the only way or there is a VB.NET like mechanism?

A better solution is to use a parameter object and add a property each parameter you want to pass.

You also should be rethinking any method that needs that many parameters. Maybe you should be instantiating an object and setting properties before calling the method. I know that Steve Black talked about this in a conference session some years back. Looks like some of it is in this topic: http://fox.wikis.com/wc.dll?Wiki~OperandPrinciple


Tamar
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform