#DEFINE CRLF CHR(13)+CHR(10) LOCAL lcText, lnNumLines, lnLine, lcLine lcText = CRLF + FILETOSTR("myfile.txt") IF RIGHT(lcText,2) = CRLF lnNumLines = OCCURS(CRLF,lcText) - 1 ELSE lnNumLines = OCCURS(CRLF,lcText) ENDIF FOR lnLine=1 TO lnNumLines lcLine = STREXTRACT(lcText,CRLF,CRLF,lnLine,2) ? lcLine ENDFORThe CRLF is added to the beginning to allow STREXTRACT to extract the first line.