>>>>AFIELDS(laFields, "MyTable") >>>>CREATE CURSOR MyCursor FROM ARRAY laFields >>>>>>>>
>>>>alter table alias() add column pick L
>>>>alter table alias() add column rec_no N(6)
>>>>index on myCursor.keyfield tag mykey
>>>
>>>Don't include aliases in index expressions.
>>
>>Tought someone will chime inn on this :)
>>I know that, Here I put it for code illustration purpose.
>>However this never gave me any problem with cursors created this way.
>>Reason I wld put this especially with composite indexes is to 'ensure' (paranoya) that correct field will be used in cases when you make cursor duplicate to a table which is naturally still open and the same field exist in original table. It helps somewhat readability of code as well.
>>
>>BTW remind me what was reason not to use it in this case. I knew that this is 'ofence' to coding discipline for some reason, but forgot exactly why <g>
>
>Since a field in the currently selected work area ALWAYS takes precedence, and since the table you want to create an index for must be in the currently selected work area, the alias is redundant.
I know;
As I said I do it sometime out of paranoya, for the same reason
why people (myself included) sometime put select myalias before endscan :)
Anyways I use this kind of construction mostly for report/preprocessing
purposes so never really gave me any problem.
But guilty as charged <vbg>*****************
Srdjan Djordjevic
Limassol, Cyprus
Free Reporting Framework for VFP9 ;
www.Report-Sculptor.Com