'======================================== Function zFile_LoadArray(sFile) 'This function loads an array from a text file 'Usage: 'Dim aList 'aList = zFile_LoadArray(sFile) 'Where: 'sFile is the file containing the text required 'aList is the returned array containing the lines from the text file 'Note the zeroth entry is reserved for indicating Empty/No file Dim iCount, aList(), oFso, oFile, sLine Const ForReading = 1, ForWriting = 2, ForAppending = 8 iCount = 0 ReDim aList(0) If zFile_Exists(sFile) Then Set oFso = CreateObject("Scripting.FileSystemObject") Set oFile = oFso.OpenTextFile(sFile, ForReading) Do While oFile.AtEndOfStream <> True sLine = oFile.ReadLine iCount = iCount + 1 ReDim Preserve aList(iCount) aList(iCount) = sLine Loop oFile.Close Set oFso = Nothing End If zFile_LoadArray = aList End Function '========================================