Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Table from Vertical to horizontal
Message
 
 
To
08/12/2008 01:41:15
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01365804
Message ID:
01365919
Views:
10
>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
local 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?

May be something like

local ("m.i" + Subject) will work ?

Can not test at this moment.

But anyway, I now see that in my algorithm I don't need extra variables, I can use straight replace,

e.g.
replace (Subject) with Report.Mark in c_FinalResult
I think I had another idea of using scatter/gather at first and then dismissed it while coding.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform