E
Eniac
Hi there,
is there any way I can make a property returning another type than what
is declared in the "as" statement ?
ex.:
public property Age as Integer
Get
return m_intAge
End Get
Set (Value as object) '<-- note that the SET accepts an object
If isnumeric(age) andalso ctype(value, integer) > 0 then
m_intAge = ctype(value, integer)
else
m_intage = -1
end if
End Set
I'm just trying to build a set of property that take objects as input
but return specific types like string, integer, boolean..etc.
Right now they're all declared as object but it forces the caller to
cast the return value in the appropriate type.
I know it cannot be done directly (i think) but is there any workaround
I can use ?
Thanks!
is there any way I can make a property returning another type than what
is declared in the "as" statement ?
ex.:
public property Age as Integer
Get
return m_intAge
End Get
Set (Value as object) '<-- note that the SET accepts an object
If isnumeric(age) andalso ctype(value, integer) > 0 then
m_intAge = ctype(value, integer)
else
m_intage = -1
end if
End Set
I'm just trying to build a set of property that take objects as input
but return specific types like string, integer, boolean..etc.
Right now they're all declared as object but it forces the caller to
cast the return value in the appropriate type.
I know it cannot be done directly (i think) but is there any workaround
I can use ?
Thanks!