>>>I just found out this works, with a caveat (at least in VFP5). I used a complex SELECT - SQL to generate a report cursor. I wanted to add a memo column to the resultant cursor:
>>>SELECT ;
>>> ... ;
>>> INTO CURSOR MyCursor ;
>>> ...
>>>
>>>* Make the cursor read-write:
>>>USE ... AGAIN etc.
>>>
>>>* Add the memo column:
>>>ALTER TABLE ... ADD COLUMN MyMemo M
Yes, I know you can use CREATE CURSOR to create a dummy cursor with a single M column, then add that into the JOINs in the SELECT - SQL, but it was a pretty heinous statement already so I thought I'd be lazy ;-)
>>>
>>>One caveat I've found that any long cursor column names are truncated to the old FP standard 10 characters (watch out if you have column names that match to that length).
>>>
>>>Maybe just of academic interest, but it could be a useful tool in report generation or just general-purpose data munging.
>>>
>>>BTW can anyone confirm if this works in VFP6?
>>
>>Yep, this still works in VFP6. Now, can someone tell us if it works with VFP7 and just using the READWRITE clause of the SELECT and the ALTER TABLE?
>
>Another apparent caveat - using ALTER TABLE this way seems to "leak" temp files:
CREATE CURSOR Temp (cChar C(1))
>ALTER TABLE Temp ADD COLUMN mMemo M
>CLOSE DATABASES ALL
>QUIT
Checking your temp directory, you will see a .TMP and a .FPT still hanging around. Again, this is VFP5, is it still the same in 6/7?
Still that way in 6. We ran into similar behavior with indexes on USE..AGAIN cursors. The .CDX file wouldn't go away if you created more than one tag. You can probably get around this by saving the name of the .TMP file before the ALTER TABLE, and deleting those files afterwards.