Solved

Multi Dimensional Array.

Posted on 2006-11-30
7
179 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
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
vb.net checkbox 7 46
Gridview selected row 9 44
VB.NET 2008 Populate DataModel with DataTable 44 28
Sql server, import complete table, using vb.net 9 33
This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

776 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