Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Having an optional parameter as an object
Message
De
17/04/2006 21:00:31
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Titre:
Having an optional parameter as an object
Divers
Thread ID:
01114198
Message ID:
01114198
Vues:
55
Is there way to have an optional parameter which has a default of a class?

I have this declared function and I would like toApplication to be optional but would default to the Framework.App class.
    Public Shared Function Encrypt(ByVal tcString As String, ByVal tcKey As String, _
     Optional ByVal toApplication As Object = "") As Boolean
If I try the following, it gives an error:
    Public Shared Function Encrypt(ByVal tcString As String, ByVal tcKey As String, _
     Optional ByVal toApplication As Framework.App = New Framework.App) As Boolean
The error is "Constant expression is required".
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform