>Dear Cetin,
>
>>2) Actually answer is hidden in your question :) Select into a table.
>>It's not true that a cursor is kept in memory and table is written to disk. >Both are written to disk (even if the cursor just have 1 record with 1 logical >field). A cursor is volatile because as you close it VFP does the cleanup for >you and that's the difference. If cleanup is not a much concern for you than >use a table.
>
>As you said, the differentiate of the cursor to table is VFP will does the cleanup, but i try to open the cursor(which also store into disk as .DBF and found that the data still appear. Why ?
Cleanup is done for cursors. I think I couldn't understand. Sorry. Would you provide code portion.
>
>
>>Another difference, in normal circumstances you might think of cursors as >tables belonging to a session only. Think of this, in 2 private datasessions >you select into cursor 'myCursor'. The 2 myCursor are different because their >actual tablenames on disk are generated uniquely (that's what dbf('myCursor') >returns). One session cannot access the data in other session unless session >is changed or actual name is provided.
>>Actual disk files being generated uniquely means that if you'd use table then >you should also generate a unique name (lcTable=sys(2015)+'.tmp' for example). >Otherwise in a multiuser app you'd get into trouble (or multipl data sessions).
>>You could do so with a strategy like this :
>
>>* Grid.init
>>this.tag = sys(2015)
>>select ... into table (this.Tag)
>>index on ....
>>this.RecordSource = (this.Tag)
>>*Grid.destroy
>>use in (this.tag)
>>erase (this.tag+'.*') && Cleanup
>
>What is "this.tag" ? is it the table name ?
>
>regard,
>kengwen
this.Tag refers to 'tag' property of grid. It's not used by grid itself and for developer. You can store char data there.
Cetin