Hi Ounis,
This code
cSubject = 'Test'
LOCAL &cSubject
works fine. What was in the subject when you got an error on the local declaration ?
>Dear Naomi ,
>It gives me strange error on the following lines 2,8,and line 17 I really do not no why, howerver when I starting ignoring it I could see that the curso was created properly and the data start being inserted horizentaly
>Thank you
>
>Select distinct subject from Report into cursor c_UniqueSubjects nofilter
>
> 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
> endscan
If it's not broken, fix it until it is.
My Blog