Connecting Tech Pros Worldwide Forums | Help | Site Map

object/class question

Jim
Guest
 
Posts: n/a
#1: Nov 24 '05
How do you get an object to return the same type as itself. I want to have
a calendar object that returns a date object as its default so you could do
something like this

myCalendar(date).FirstOfFollowingMonth.DayOfWeek

I want to do something like the string object where you can cascade methods
in the same line.


Sorry for the dumb question.


Jim



Herfried K. Wagner [MVP]
Guest
 
Posts: n/a
#2: Nov 24 '05

re: object/class question


"Jim" <jim@n_o_s_p_a_m_the-e-office.com> schrieb:[color=blue]
> How do you get an object to return the same type as itself. I want to
> have a calendar object that returns a date object as its default so you
> could do something like this
>
> myCalendar(date).FirstOfFollowingMonth.DayOfWeek
>
> I want to do something like the string object where you can cascade
> methods in the same line.[/color]

\\\
Public Class Foo
Private m_Foo As Foo

Public Property MyFoo() As Foo
Get
Return m_Foo
End Get
Set(ByVal Value As Foo)
m_Foo = Value
End Set
End Property
End Class
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Jim
Guest
 
Posts: n/a
#3: Nov 24 '05

re: object/class question


Thanks very much for your time to answer my question.. Mystery solved!


Jim

"Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
news:en9$yeM8FHA.1276@TK2MSFTNGP09.phx.gbl...[color=blue]
> "Jim" <jim@n_o_s_p_a_m_the-e-office.com> schrieb:[color=green]
>> How do you get an object to return the same type as itself. I want to
>> have a calendar object that returns a date object as its default so you
>> could do something like this
>>
>> myCalendar(date).FirstOfFollowingMonth.DayOfWeek
>>
>> I want to do something like the string object where you can cascade
>> methods in the same line.[/color]
>
> \\\
> Public Class Foo
> Private m_Foo As Foo
>
> Public Property MyFoo() As Foo
> Get
> Return m_Foo
> End Get
> Set(ByVal Value As Foo)
> m_Foo = Value
> End Set
> End Property
> End Class
> ///
>
> --
> M S Herfried K. Wagner
> M V P <URL:http://dotnet.mvps.org/>
> V B <URL:http://classicvb.org/petition/>[/color]


Closed Thread