FUNCTION GetStudentCount LPARAMETERS tnCourseID SELECT * FROM v_students WHERE iCourseID = tnCourseID TO SCREEN NOCONSOLE RETURN (_TALLY)Or there is a COUNT command
FUNCTION GetStudentCount LPARAMETERS tnCourseID LOCAL ln_count SELECT v_students COUNT TO ln_count FOR iCourseID = tnCourseID RETURN (ln_count)The last one will move the record pointer to the EOF on v_students.