Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Optional parameters...
Message
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
01117250
Message ID:
01119603
Vues:
14
This message has been marked as a message which has helped to the initial question of the thread.
If you add a OPTIONAL argument to your CheckLogin signature, you don't need to change your 543 calls if you don't need to pass a value to this argument.

Say you have:
public sub checklogin(optional byval Param1 as string = "MyOptionalValue")
You don't need to change all the calls because if you simply call:
CheckLogin()
These calls will have the value "MyOptionalValue". You will only need to change those calls that you don't want "MyOptionalValue".


>Eric,
>I know that but in my case all my 543 functions call are like this:
>
>CheckLogin()
>
>I the 543 functions call have no parameter I cannot have a option value.
>Right?
>
>
>>>Ok that is good but what if I have 543 calls to my function and none of the call has parameters.
>>>
>>>How can I make the optional parameter facultative?
>>
>>adding a OPTIONAL argument to your method doesn't requires you to modify your 543 callers. It is optional (faculative) and you don't need to provide a value when you call the method.
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform