here is an example....

code:
break on
$file = "files.txt"

;open the file in question.
$nul = open(1,$file)

;lets create an array just as a starting point
$arraysize = 10
DIM $array[$arraysize]

;we will use $count to keep track of the size of the array
$count = 0

;prime the pump so to speak.....
$LineOfData = readline(1)
while NOT @error

;lets check $count VS the current size of the $array
if $count > ubound($array)

;looks like $array needs to be resized. lets add 10 more elements to the array.
$arraysize = $arraysize + 10
redim preserve $array[$arraysize]
endif

;add the data to the $array
$Array[$count] = $LineOfData

;increase $count to point to the next $array element
$count = $count+1

;get the next line of data from out file
$LineOfData = readline(1)
loop

;we have gone through all the lines in the file... lets
;trim back our array to only what we need, the value of $count-1
redim preserve $array[$count-1]


;a quick walk through of all the array elements...
for each $file in $array
? $file
next

hope this helps