Solved

Multi Dimensional Array.

Posted on 2006-11-30
7
177 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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

707 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

15 Experts available now in Live!

Get 1:1 Help Now