How do you create Listings().ListingItems()

N

Name Withheld

OK i know this is a 101 question but...

ASP.NET/VB.NET

ListingItems() as string

I need a nested array of Listings().ListingItems() so i can read a text file
and split each line and insert the results into this array. The read and
split are easy (and so should be setting up this array), but i am banging my
head on how to get my class defined as an array.

Again, end result is Listings().ListingItems()

Thank you in advance for your help.
 
C

Chris Dunaway

OK i know this is a 101 question but...

ASP.NET/VB.NET

ListingItems() as string

I need a nested array of Listings().ListingItems() so i can read a text file
and split each line and insert the results into this array. The read and
split are easy (and so should be setting up this array), but i am banging my
head on how to get my class defined as an array.

Again, end result is Listings().ListingItems()

Thank you in advance for your help.

If I understand correctly, you just need to declare an array of string
arrays:

Dim Listings(size) As String()
Listings(0) = methodThatGetsAStringArray()


Instead of using an array for this purpose, consider using a List:

Dim Listings As New List(Of String())
Listings.Add(methodThatGetsAStringArray())

That way you don't need to know how many in advance to create like you
would when using an array.

Chris
 
N

Name Withheld

Here is what i am doing.

Lindex = 0
Do
Line = r.ReadLine()
If Line IsNot Nothing Then
ListingItem = Split(Line, chr(9))
Lindex += 1
End If
Loop Until Line Is Nothing

This works for ONE line, the last line. I think what i need to do here is:

Lindex = 0
Do
Line = r.ReadLine()
If Line IsNot Nothing Then
Listings(LIndex).ListingItem = Split(Line, chr(9))
Lindex += 1
End If
Loop Until Line Is Nothing

That is why the structure of the variable needs to be
Listings().ListingItems(). Or is there another way to do this. I need to
take this information and display it two ways, one as a summary (select
fields) list and secondly all the data per a user's selection (index)
formatted as a real estate listing.
 
L

Lloyd Sheen

Name Withheld said:
Here is what i am doing.

Lindex = 0
Do
Line = r.ReadLine()
If Line IsNot Nothing Then
ListingItem = Split(Line, chr(9))
Lindex += 1
End If
Loop Until Line Is Nothing

This works for ONE line, the last line. I think what i need to do here
is:

Lindex = 0
Do
Line = r.ReadLine()
If Line IsNot Nothing Then
Listings(LIndex).ListingItem = Split(Line, chr(9))
Lindex += 1
End If
Loop Until Line Is Nothing

That is why the structure of the variable needs to be
Listings().ListingItems(). Or is there another way to do this. I need to
take this information and display it two ways, one as a summary (select
fields) list and secondly all the data per a user's selection (index)
formatted as a real estate listing.

Try the following ::

Dim tst As New List(Of List(Of String))

LS
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top