|
Public Function File2ALists(ByVal vFile As Variant, Optional ByVal strDelim As String) As clsArrayLists
'Implements Line2AList() to create an ArrayLists object 'collection/representation of an entired file 'Note: Be careful to lose memory when file is large Dim objArrayLists As clsArrayLists Dim intFile As Integer On Error Goto errFile2ALists Set objArrayLists = New clsArrayLists intFile = GetFileNum(vFile, "Input", "Read") Do While Not EOF(intFile) 'Loop to the end-of-file and add each line to the collection objArrayLists.Add Line2AList(ReadFileLine(intFile), strDelim) Loop 'Close vFile if this function opened it If VarType(vFile) = vbString Then Close #intFile Set File2ALists = objArrayLists Set objArrayLists = Nothing Exit Function errFile2ALists: ShowErrorMess Err, "File2ALists" End Function |