I run VB6 at work and had that same problem the other day. The reason you get that array error when using the split function is because split turns the variable into an array using a delimiter to make distinctions between elements. An example is:


dim fso as FileSystemObject
dim myTextStream as TextStream
dim myReadText() as String

set fso = New FileSystemObject

set myTextStream = fso.OpenTextFile("C:\File.txt")

myReadText = Split(myTextStream.ReadLine, "|") 'The "pipe" symbol is the divider of the text
MsgBox (myReadText(0))
MsgBox (myReadText(1))
MsgBox (myReadText(2))



This is just an example. The split function turns the variable into an array. So make sure you dim that variable accordingly.


I hope this helps.