Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Unlimited number of parameters
Message
De
27/01/2005 12:48:58
 
 
À
26/01/2005 17:56:02
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00981000
Message ID:
00981282
Vues:
47
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform