Click here to Skip to main content
16,005,141 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Forms Handling Issue Pin
nlarson115-Oct-07 3:04
nlarson115-Oct-07 3:04 
GeneralRe: Forms Handling Issue Pin
Johan Hakkesteegt5-Oct-07 3:14
Johan Hakkesteegt5-Oct-07 3:14 
QuestionReport from SQL Server with Vb.NET Pin
mhaneefa4-Oct-07 9:41
mhaneefa4-Oct-07 9:41 
AnswerRe: Report from SQL Server with Vb.NET Pin
Johan Hakkesteegt5-Oct-07 0:16
Johan Hakkesteegt5-Oct-07 0:16 
GeneralRe: Report from SQL Server with Vb.NET Pin
mhaneefa5-Oct-07 9:53
mhaneefa5-Oct-07 9:53 
QuestionGet Access() [modified] Pin
zchwllms4-Oct-07 9:28
zchwllms4-Oct-07 9:28 
AnswerRe: Get Access() Pin
balaji baskar4-Oct-07 13:24
balaji baskar4-Oct-07 13:24 
QuestionArray Sort Pin
Scott_Roberts4-Oct-07 8:51
Scott_Roberts4-Oct-07 8:51 
I've been looking all over for the answer to this, and I'm apparently too dense today to implement the various solutions I've found. It seems this should be simple...

I have a config file that looks like this:
KZZZ (City2)|KZZZ-FM|...other values
KQQQ (City1)|KQQQ-AM|...other values

Right now there are only 2 values for each line, but I want the flexibility to add fields in the future. I want to read this file into an Array(ish Collection) and then sort it based on the second column.

Here's the code so far...
' set up needed variables
Dim ConfigFileReader As IO.StreamReader = New IO.StreamReader(My.Settings.DataRoot & My.Settings.StationConfigFileName)
Dim Configline, ConfigFields() As String
Dim ConfigDelimiter() As Char = {Convert.ToChar("|")}
Dim LineCount, FieldCount As Integer
Dim InsertLine As String = Nothing

' read in 1st line
Configline = ConfigFileReader.ReadLine

' parse line, placing each field into StationList array
Do Until Configline = Nothing
ConfigFields = Configline.Split(ConfigDelimiter)
For FieldCount = 0 To UBound(ConfigFields)
StationList(LineCount, FieldCount) = ConfigFields(FieldCount)
Next

' resize array to the right width
ReDim Preserve StationList(999, FieldCount)

' increment counters, read next line
LineCount += 1
FieldCount = 0
Configline = ConfigFileReader.ReadLine
Loop

End Sub

The issues:
I don't like declaring the oversize array (initialized as 999,1). Seems like an ArrayList would be the solution, but I'm not getting how to make a multi-dimensional ArrayList.
I'm apparently too dense today to implement a "sort on the second field" routine.

Thanks for your help!
Scott

AnswerRe: Array Sort Pin
nlarson114-Oct-07 10:29
nlarson114-Oct-07 10:29 
QuestionSelecting multipe parameters Pin
TAK784-Oct-07 7:24
TAK784-Oct-07 7:24 
AnswerRe: Selecting multipe parameters Pin
Dave Kreskowiak5-Oct-07 1:45
mveDave Kreskowiak5-Oct-07 1:45 
QuestionSMO Sample Pin
Naderrafiee4-Oct-07 6:08
Naderrafiee4-Oct-07 6:08 
AnswerRe: SMO Sample Pin
Dave Kreskowiak5-Oct-07 1:44
mveDave Kreskowiak5-Oct-07 1:44 
QuestionVB/ASP problem - HTML strings in ASP Pin
Dmitry Khudorozhkov4-Oct-07 5:51
Dmitry Khudorozhkov4-Oct-07 5:51 
AnswerRe: VB/ASP problem - HTML strings in ASP Pin
nlarson114-Oct-07 7:45
nlarson114-Oct-07 7:45 
GeneralRe: VB/ASP problem - HTML strings in ASP Pin
Dmitry Khudorozhkov4-Oct-07 7:55
Dmitry Khudorozhkov4-Oct-07 7:55 
GeneralRe: VB/ASP problem - HTML strings in ASP Pin
nlarson114-Oct-07 8:00
nlarson114-Oct-07 8:00 
GeneralRe: VB/ASP problem - HTML strings in ASP Pin
Dmitry Khudorozhkov4-Oct-07 8:05
Dmitry Khudorozhkov4-Oct-07 8:05 
GeneralRe: VB/ASP problem - HTML strings in ASP Pin
nlarson114-Oct-07 8:11
nlarson114-Oct-07 8:11 
Questionreport generation using dataenvironment Pin
devendra20uk4-Oct-07 2:48
devendra20uk4-Oct-07 2:48 
AnswerRe: report generation using dataenvironment Pin
mhaneefa4-Oct-07 9:45
mhaneefa4-Oct-07 9:45 
QuestionUpdating a datagridview with the value selected in a combo box Pin
Mr Oizo4-Oct-07 2:27
Mr Oizo4-Oct-07 2:27 
QuestionTo remove xmlns value from Xml file Pin
Sam.M4-Oct-07 1:39
Sam.M4-Oct-07 1:39 
AnswerRe: To remove xmlns value from Xml file Pin
Dave Kreskowiak4-Oct-07 4:08
mveDave Kreskowiak4-Oct-07 4:08 
AnswerRe: To remove xmlns value from Xml file Pin
richardw484-Oct-07 5:00
richardw484-Oct-07 5:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.