> local lcSubjects, lnCount, "Syntax error" > lcSubjects = "" > select c_UniqueSubjects > lnCount = 0 > scan > lcSubjects = ", " + Subject + " I" > local &Subject "command contains unrecognized phrase/keyword" > endscan > > create cursor c_FinalResult (iID I, cStudentName C(40) &lcSubjects) > && If this would not work, we can construct the whole create cursor command as a string > index on iID tag iID > > select Report > set order to StudentID > scan > if not seek(StudentID, c_FinalResult ') > insert into c_FinalResult (iID, cStudentName) values (Report.ID, Report.Name) > endif > store Report.Mark to ("m." + Subject) "Variable subject is not found" > replace (Subject) with ("m." + Subject) in c_FinalResult > endscanlocal lcSubjects, lnCount, "Syntax error" && Remove last comma, should be
local lcSubjects && (we don't need lnCount variable, I changed my mind while writing it).I forgot how can we declare a variable this way, try experimenting a little. What is the subject at that moment refers to?
replace (Subject) with Report.Mark in c_FinalResultI think I had another idea of using scatter/gather at first and then dismissed it while coding.