Hey all,

I am trying to use an array to log data,
the data is too long for a string. I have the array sample it seems to read by the counter, but I only get one line written to the file.

Thanking you in Advance
Phoe.

code:
  

$array=ReadFile('c:\kix\archlist.txt')
$=WriteFile('c:\kix\file.txt',$array)

Function ReadFile($file)
Dim $lf, $f, $_, $t ,$x
$x = 0
$lf=chr(10)
$f=freefilehandle
$_=open($f,$file)
if @error exit @error endif
do $t=$t+$lf+readline($f) $x=$x + 1 until @error
$_=close($f)
$ReadFile=split(substr($t,2),$lf)
$x
EndFunction


Function WriteFile($file,$array)
Dim $f, $line,$y
If Not VarType($Array) & 8192 Exit(1) EndIf
$y = 0
$f=freefilehandle
$=open($f,$file,5)
if @error exit @error endif
for each $line in $array
$y=$y + 1
$=writeline($f,$line+@crlf)
if @error exit @error endif
$=close($f)
??$y
EndFunction