Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Having a date as optional parameter
Message
From
22/04/2006 15:27:22
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
22/04/2006 15:13:16
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Miscellaneous
Thread ID:
01115718
Message ID:
01115721
Views:
11
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform