How do you create Listings().ListingItems()

  • Thread starter Thread starter Name Withheld
  • Start date Start date
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.
 
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
 
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.
 
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
 
Back
Top