Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Optional parameters and how to deal with them
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00790865
Message ID:
00790871
Vues:
13
::Is there a possibility to use optional parameters when defining a VB.NET function? If I add one additional parameter, wherever I have a call to that function, the compiler will immediately show the line as an error.

I think the only way you can do that is to overload your method. IOW, create another method of the same name with the parameter combination you want:
Namespace Morning
  Public Class Coffee
    Public Sub Brew()
      Console.Write("Ahhh!")
    End Sub

    Public Sub Brew(ByVal tlDecaf As Boolean)
      Console.Write("Ikkers!")
    End Sub
  End Class
End Namespace

Read about the greatest fraud in the history of mankind.
See TaxableIncome.net.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform