Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Having a date as optional parameter
Message
De
22/04/2006 15:27:22
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
22/04/2006 15:13:16
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
01115718
Message ID:
01115721
Vues:
10
>I have this function:
>
>
>        ' Ajoute un cookie
>        ' expC1 Cookie
>        ' expC2 Value
>        ' expC3 Path
>        ' expC4 Expiration
>        Public Function AddCookie(ByVal tcCookie As String, ByVal tcValue As String, _
>         Optional ByVal tcPath As String = "/", _
>         Optional ByVal tdExpiration As Date = Date.Now) As Boolean
>            Dim loCookie As New System.Web.HttpCookie(tcCookie)
>            loCookie.Value = tcValue
>            loCookie.Expires = tdExpiration
>            loCookie.Path = tcPath
>            oApp.oCookie.Add(loCookie)
>        End Function
>
>
>The optional parameter tdExpiration should have a default value. However, it cannot accept what I did. It has to be a constant. How can I define it?
...tdExpiration As Date = SomeConstantDateHereInFarPast 
' or null

if tdExpiration = SomeConstantDateHereInFarPast
  tdExpiration = DateTime.Now
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform