>Hello all
>
>I have a text file with 7 lines and 8th line is blank when i issue
>lcFile=Filetostr(cfile)
>numLines=Alines(aTextArray,lcFile)
>
>i get numlines as 8 how to get it to 7
>
>txs
Alines counts CRLF or LF and trim() doesn't trim CRLF chars. Below code assumes linecount is not over array limit and returns result eliminating blank lines at top, between lines or at end.
lnLines = alines(arrLines,FileToStr('myFile.txt'))
TotLines = lnLines
for ix=1 to lnLines
if trim(arrLines[ix])==''
TotLines = TotLines - 1
endif
endfor
? TotLines
Cetin