Just to check the performance of ReDim i made the following function.
It uses only KiX (No COM-objects)
It seems to be faster than Bryce's LoadFile()
Code:
Function ReadFile($file)
Dim $i,$f,$L
$f = FreeFileHandle
$i = Open($f,$file)
If @Error
Exit @Error
EndIf
$i = 0
$L = ReadLine($f)
While @Error = 0
ReDim Preserve $ReadFile[$i]
$ReadFile[$i] = $L
$i = $i + 1
$L = ReadLine($f)
Loop
$i = Close($f)
Exit VarType($ReadFile) = 0 ; Exitcode 1 if file is empty
EndFunction
Small code is not allways the fastest
In many other situations we might consider using the force of KiX.
This could be a starter for a new thread on performans of KiX for long strings, Split, Join and Redim Of arrays and ...
-Erik