Solved

Multi Dimensional Array.

Posted on 2006-11-30
7
178 Views
Last Modified: 2010-04-23
Please help me,

I need to create an array or some sort of in-memory storage to:

Store a:    Number of channels(1-20)
           
Each channel can have multiple lines of data.
This data must be split into its relative fields.

Public gSMDRArr As String()()()         '(Ch#)(Line)(Field)

This seems a bit redundant, for example if channel(Ch#) 17 has 3 (Line)s of data each (Line) has (Field)s: "ID,Date,Time,Duration"

Line 1 for CH# 17
gSMDRArr(17)(0)(0) = "453"                       'ID
gSMDRArr(17)(0)(1) = "11/17/06"               'Date
gSMDRArr(17)(0)(2) = "02:38PM"                'Time
gSMDRArr(17)(0)(3) = "00:02:14"               'Duration
Line 2 for CH# 17
gSMDRArr(17)(1)(0) = "453"                       'ID
gSMDRArr(17)(1)(1) = "11/17/06"               'Date
gSMDRArr(17)(1)(2) = "02:40PM"                'Time
gSMDRArr(17)(1)(3) = "00:01:04"               'Duration
Line 3 for CH# 17
gSMDRArr(17)(2)(0) = "453"                       'ID
gSMDRArr(17)(2)(1) = "11/17/06"               'Date
gSMDRArr(17)(2)(2) = "02:42PM"                'Time
gSMDRArr(17)(2)(3) = "00:02:14"               'Duration

Then for channel 4 has 2 lines  then once the last line comes with its termination code i need to clear the channel, all the lines and fields.


I hope i was clear,
Thanks
0
Comment
Question by:ryankahan
7 Comments
 
LVL 9

Accepted Solution

by:
noulouk earned 500 total points
ID: 18044180
Hi ryankahan,

Why not use a  DataSet ?

As you tell, "This seems a bit redundant".

Hope this  helps.
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 18044817
What .NET version do you have?

Bob
0
 
LVL 85

Expert Comment

by:Mike Tomlinson
ID: 18046155
I would create a Class to hold the fields, and then use an ArrayList to hold multiple instances of that class...one for each line.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 96

Expert Comment

by:Bob Learned
ID: 18046737
Yeah, Mikey, but 2005 has generics, which is much better than an ArrayList ;)

Bob
0
 
LVL 85

Expert Comment

by:Mike Tomlinson
ID: 18048033
True...just depends on what flava we're workin with.  =)

How ya been Bob?...haven't seen as much of ya lately.
0
 

Author Comment

by:ryankahan
ID: 18051719
vb.net 2005.
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 18053155
Simplified version:

Public Class Entry

   Public ID As Integer
   Public Date_Time As Date
   Public Duration As TimeSpan

End Class

Public Class Lines

    Public Entries As New List Of(Entry)

End Class

Private m_channels As New List(Of Lines)

Bob
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now