On Mon, 25 Feb 2008 23:43:09 +0800, "Derek" <dalikyim@[EMAIL PROTECTED]
>
wrote:
>Hi,
>How can I read the text file into an array.
>Please advise.
>
>Derek
>
Sample for a fixed length text (80)
Local NbLine, Txt
Local aTexte := {} // Array
tprg := fopen("Texte.txt",64)
if tprg = -1
PrgError("Error opening TEXT file !")
end
NbLine := fseek(tprg,0,2)/80 // How many line ?
fseek(tprg,0)
for t := 1 to NbLine
Txt := Trim(FreadStr(tprg, 80))
aadd(ATexte,{ Txt, t })
next
Not tested!
Regards
Otto


|