kRx,
This is quite simple once understood. Use a
repeat until loop to read each string from the file, incrementing a count variable each time there is a string. If there is no string in the current loop, then end the loop and do not increment the variable. The value in the count variable will be what you need. Check the code snippet below.
set display mode 800,600,32
sync on
sync rate 60
open to read 1,"myfile.txt"
repeat
read string 1,string$
REM << check if there is a string on this passover
REM << if so then inc count and loop will continue
REM << else, loop will end without incrementing count
if string$ <> "" then inc count
until string$ = ""
close file 1
repeat
print count
sync
cls
until mouseclick() > 0
end

+NanoBrain+