[Mono-list] Multidimensional arrays -- How do I do this?

Rob.Tillie@Student.tUL.EDU Rob.Tillie@Student.tUL.EDU
Sun, 13 Jun 2004 20:28:37 +0200


The main difference between php / c and C# is that the latter is an object
oriented language. In oo fashion you normally would create an object 'Entry'
with attributes 'Id', 'Title' etc. If you have never used an OO language, I
suggest to read some on OO first.

This is exactly the problem whit what you're trying to do. ArrayList is an
object, not an array. If you want to use a multidimensional array, you can
do so by using something like 'object[][] bla = new object[2][10];'
Only with this construct you are using an array.

Good luck with it,
-- Rob.

> -----Original Message-----
> From: Kevin Francis [mailto:kevin@arslinux.com]
> Sent: Sunday, June 13, 2004 6:05 PM
> To: mono-list@lists.ximian.com
> Subject: [Mono-list] Multidimensional arrays -- How do I do this?
> 
> I am writing what is basically a feed compiler ala PlanetPlanet or
> Monologue. My problem has come about just as I reach the actual part
> where I compile feeds into one massive feed.
> 
> I actually thought to use a structure as follows:
> 
> Collective
>     Entry
>        Id
>        Title
>        Date
>        ...
>     Entry
>        Id
>        Title
>        Date
>        ...
>     Entry
>        Id
>        Title
>        Date
>        ...
> ...
> 
> and so forth. The idea is to take these feeds, place them in an array
> and then sort by date.
> 
> In the only other languages I know, (php, C etc.) I'd use a
> multidimensional array, however I've run into problems uisng ArrayList,
> since it seems to be inherently single-dimensional, unless I embed/nest
> ArrayLists within it. That could well get sticky -- imagine something on
> the order of 1000 ArrayLists within Collective. I do realise that this
> sound suspiciousl like "I want my other language back!" but I've looked
> @ the book I have and ... I really can't come up with anything better.
> As it is it feels like a huge kludge.
> 
> Would this be a problem performance wise? Does anyone have suggestions
> on how to do it another way? I really am stuck. This ArrayList deal is
> very foreign in feel/thought flow.
> 
> Thanks and cheers.
> 
> --
> Kevin Francis
> <http://denial.loose-screws.com/>
> 
> _______________________________________________
> Mono-list maillist  -  Mono-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list