I use an other solution to load file because resizing array at each line can be expensive in time and memory.
 Code:
function LoadArrayFromFile( $filename, optional $PtrMax, optional $PtrInc )
  if vartype($PtrMax)=0    $PtrMax = 1024   endif    ; initialize max size
  if vartype($PtrInc)=0    $PtrInc = 256    endif    ; initialize increment size

  dim $Ptr                 $Ptr = -1                 ; set pointer to negative first
  dim $handle              $handle = freefilehandle()

  if open( $handle, $filename )=0
    redim $LoadArrayFromFile[$PtrMax] ; declare array var with a predefined size
    dim $line

    ; Time to add an element to the array, possibly in a loop
    $Line = ReadLine($handle)
    While Not @ERROR
      $Ptr = $Ptr + 1                                ; increase pointer
      if $Ptr > $PtrMax
	    $PtrMax = $PtrMax + $PtrInc                  ; increase array max size
        ReDim Preserve $LoadArrayFromFile[$PtrMax]   ; resize array
      endif

      $LoadArrayFromFile[$Ptr] = $Line               ; put data in array
      $Line = ReadLine($handle)                      ; read the next data line
    Loop

    $ = close($handle)
  endif

  if $Ptr=-1
    ; nothing read in the file or file not opened
	$LoadArrayFromFile = ""
	exit 1
  else
    ReDim Preserve $LoadArrayFromFile[$Ptr]
	exit 0
  endif
endfunction
This is a function that allows to define initial size of the array and increment size when array becomes too small to load next data.

See below how to test with differents sizes of buffer and increment
 Code:
$=SetOption( "Explicit", "ON" )

dim $filename, $arr, $start

$filename = "<name of a large file for test>"

$start=@TICKS
$arr = LoadArrayFromFile( $filename, 0, 1 )
$start=@TICKS-$start
"Loaded line by line (   0,   1) in " $start " ms" ?

$start=@TICKS
$arr = LoadArrayFromFile( $filename )
$start=@TICKS-$start
"Loaded with default (1024, 512) in " $start " ms" ?

$start=@TICKS
$arr = LoadArrayFromFile( $filename, 4096, 4096 )
$start=@TICKS-$start
"Loaded with buffer  (4096,4096) in " $start " ms" ?


with a file of 32000 lines (1,1MB), here are the results :
 Code:
Loaded line by line (    0,   1) in 469 ms
Loaded with default ( 1024, 512) in 312 ms
Loaded with default ( 4096,4096) in 297 ms
_________________________
Christophe