Re: Hours
From: Jay B. Harlow [MVP - Outlook] (Jay_Harlow_MVP_at_msn.com)
Date: 07/14/04
- Next message: VM: "Re: Copying datatable contents to another datatable"
- Previous message: T. Barley: "NumLock Status"
- In reply to: Geoff Jones: "Re: Hours"
- Next in thread: Geoff Jones: "Re: Hours"
- Reply: Geoff Jones: "Re: Hours"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 14 Jul 2004 12:49:49 -0500
Geoff,
> but that doesn't say if it holds strings, doubles or integers etc.
ArrayList holds objects, when you take a value out you need to cast the
value to the specific type you put in.
If you want strongly typed, either use pure arrays, either:
Dim y()() As DateTime ' Array of Arrays of DateTime
Dim x(,) As DateTime ' 2 dimensional
The "problem" with both of these is that both dimensions are "fixed",
System.Collections.ArrayList is dynamic, in that you can add elements to it.
If you want a strongly typed "ArrayList" you can inherit from
System.Collections.CollectionBase and create a strongly typed list.
NOTE: VS.NET 2005 (.NET 2.0) (Whidbey) due out sometime next year, will
support Generics so it will be easier to get an array of list of datetime...
Hope this helps
Jay
"Geoff Jones" <geoff@NODAMNSPAM.com> wrote in message
news:40f56ed3$0$296$cc9e4d1f@news.dial.pipex.com...
> That helps a lot. Thanks Jay
>
> As you can gather, I'm very new to programming. Your help and others is
> invaluable during my steep learning curve.
>
> One question that occurs to me now how to tell the ListArray what values I
> need to store. I know for an array this can be done as:
>
> Dim x() As Integer
>
> However, and forgive me if this is wrong, I set up an array of an
ListArray
> by
>
> Dim y() As ListArray
>
> but that doesn't say if it holds strings, doubles or integers etc.
>
> Can you help?
>
> Geoff
>
> "Jay B. Harlow [MVP - Outlook]" <Jay_Harlow_MVP@msn.com> wrote in message
> news:uzRAaScaEHA.3716@TK2MSFTNGP11.phx.gbl...
> > Geoff,
> > I would use an array of arrays or an array of ArrayLists.
> >
> > I would expect index 0 be from midnight to 1:00?
> >
> > Then you can simply use the hour of the Time (DateTime.Hour) as your
> index,
> > and use ArrayList.Add to add the time to that row...
> >
> > Hope this helps
> > Jay
> >
<<snip>>
- Next message: VM: "Re: Copying datatable contents to another datatable"
- Previous message: T. Barley: "NumLock Status"
- In reply to: Geoff Jones: "Re: Hours"
- Next in thread: Geoff Jones: "Re: Hours"
- Reply: Geoff Jones: "Re: Hours"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|