'This I reconstructed from the info you gave me
Private Type player
username As String
password As String
End Type
'I've organized them into types of variables (use whatever the project calls for)
Dim strArray() As String
Dim players() As player
Dim TotalPlayers As Single
Dim i As Integer
Dim i2 As Integer
'I put a sub in here (replace it as you need) because I wanted
'to have you know the difference between the declarations
'section and a sub's declarations (you may already)
Private Sub Form_Load()
'I think you know most of what this does, but you didn't quite
'get the array you put it in (you were splitting at vbCrLf which
'wouldn't exist in your data anymore)
'It inputs each LINE into the next array position which is why
'there are no line breaks.
TotalPlayers = 0
Open "C:\players.txt" For Input As #1
Do Until EOF(1) = True
ReDim Preserve strArray(0 To TotalPlayers) As String
Line Input #1, strArray(TotalPlayers)
TotalPlayers = TotalPlayers + 1
Loop
Close #1
Label2.Caption = "Total Players: " & TotalPlayers
'Many ReDims can give you a speed hit. It's better to do it all at
'once (especially when you know how big it is, ie. For loop
'instead of, say, Do)
ReDim players(LBound(strArray) To UBound(strArray)) As player
For i = LBound(strArray) To UBound(strArray)
'Ok, this is the most major change.
'The first line goes in from the left of the string strArray(i),
'going InStr(1, strArray(i), ";") - 1 characters right. For example,
'strArray(i) = "one;two" makes Left("one;two", 4 - 1)
players(i).username = Left(strArray(i), InStr(1, strArray(i), ";") - 1) '
'This one is similar, only using the Mid function. Explained as before,
'this means Go into the string strArray(i) starting at
'InStr(1, strArray(i), ";") + 1, [going 'till the end]
'Using the other example, this means Mid("one;two", 5 [, go
'till the end. This is an optional argument. If not specified,
'it is assumed you want to go 'till the end of the string])
players(i).password = Mid(strArray(i), InStr(1, strArray(i), ";") + 1)
Next i
End Sub