Property

S

shapper

Hello,

I have the following property:

' Culture
Public Property Culture() As String
Get
Return CType(Me("Culture"), String)
End Get
Set(ByVal value As String)
Me("Culture") = value
End Set
End Property ' Culture

How can I define a default value, for example "en-GB" when the culture
is empty?

Thanks,
Miguel
 
H

Hans Kesting

Hello,
I have the following property:

' Culture
Public Property Culture() As String
Get
Return CType(Me("Culture"), String)
End Get
Set(ByVal value As String)
Me("Culture") = value
End Set
End Property ' Culture

How can I define a default value, for example "en-GB" when the culture
is empty?

Thanks,
Miguel

either make sure Me("Culture") always has a value (maybe in the
constructor),
or add some code to the "get": if Me("Culture") is empty then return
"en-GB" else return it's real value.

Hans Kesting
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top