LOF

LOF(buffer)
Return the highest-numbered record of the buffer you specify.

FOR R = 1 TO LOF(1)

RTS