jmfrank63
Member
- Joined
- Mar 5, 2013
- Messages
- 5
- Programming Experience
- 1-3
Hello Community,
this is my first time and my first question, so if I do something wrong please notify me.
I am trying to build a class with a date as optional parameter. If none is given the current date shall be assumed.
Since optional parameters require a default value I tried the following:
...
Public Sub New(Optional ByVal givendate As System.DateTime = System.DateTime.MinValue)
...
Unfortunately this does not work. The error is : "Constant value required". Has anyone an idea how achieve my goal to have an optional date as parameter?
Thank you for your audience.
Johannes Frank
this is my first time and my first question, so if I do something wrong please notify me.
I am trying to build a class with a date as optional parameter. If none is given the current date shall be assumed.
Since optional parameters require a default value I tried the following:
...
Public Sub New(Optional ByVal givendate As System.DateTime = System.DateTime.MinValue)
...
Unfortunately this does not work. The error is : "Constant value required". Has anyone an idea how achieve my goal to have an optional date as parameter?
Thank you for your audience.
Johannes Frank