>>>>why not :
>>>>sele * from some_alias into cursor tmpCur where .f.
>>>>
>>>>this gives you the same in one line!
>>>
>>>Hi Peter
>>>
>>>I know. With readwrite clause you should get the same; proper local cursor. But somehow it just isn't !
>>>
>>>I started in fact doing doing it at some point in the past, but then run into some strange/unexpected problems on resulting cursor
>>>which I simply could not explain. It was one of those situation where by all logic everything should just work but for some reason it does not!
>>>
>>>After beating my head for a while, I tried to reverse steps in terms of thinking what I did different now then what I did so many times before,
>>>and it was exactly that switch from creating cursor from array - versus cute/elegant one line statement.
>>>
>>>Moment I reverted back to old way - problem was gone! You can't explain it rationally (at least I can't) but this is exactly what happened. It does not happen every time you create cursor with one line sql, but problem DID occur in a worse possible
>>>manner - which is random and without logical reason or bug in the program.
>>>
>>>I wish I had time/skill of that Italian guy (Fabio ?) to dig deep/debug and come to the bottom of why/how it is all happening,
>>>but since that is not the case I simply reverted back and continued down the line my old less elegant but problem-free way.
>>>To clarify, I did NOT have field longer then 10 chars which created problem to Denis. In this case problem was something else.
>>>What exactly I do not know, but it did happen.
>>>
>>>I know it is just war zone anecdote, but it might help someone to look at yet another possible cause of some weird problem in similar scenario.
>>
>>
>>A cursor is just a hybrid - table / free table
>>
>>For alter table, it behaves like a free table
>>
>>It is possible - I've done it in the past - to have a record validation rule (and I think also insert/delete/update triggers ) as long as you create the cursor with 'create from array'
>
>Yes, indeed you can noodle with the structure array to add cursor some extra props. You can index it, alter it(*) and what not, no mystery there;
>What interests me is what's the difference between cursors created with sql query + readwrite clause and cursor created from struct array.
>Normally they should both end up being dbfs in some temp directory. (Which can be checked by calling dbf() function on given alias)
>
>It seems that they are not exactly the same. That diff is what made former being prone to problem I had (see above post to Peter)
>and later working just fine. My best guess is that VFP internals involved in their processing are different when sql query is involved
>(maybe some internal table dictionary function supporting for instance long field names etc) versus direct create cursor command
>which perhaps limited to fox2x scope. Do you have more insights what that difference can be?
I wasn't aware that there was any difference at all
Also, in vfp9 SP1 - like in vfp6
select ... into cursor tmp
index on field tag field
index on field2 tag field2 && error
You can create one and only one index
vfp9 SP2
select ... into cursor tmp
index on field tag field
index on field2 tag field2 && no error
You can create more than one index
If you use into cursor readwrite you can create more than one index in vfp9 SP2
Gregory