INDEX ON DELETED() TAG deletedIn a number of places within the App I have code to turn a cursor created by SQL into a writeable cursor. E.g:
SELECT myfield1,myfield2 ; FROM mytable ; WHERE mywherecondition ; INTO CURSOR mycursor USE (DBF("mycursor")) AGAIN IN 0 ALIAS mywriteablecursor USE IN mycursorI've noticed that when looking at the DBF() of the cursor when the source table has an index on DELETED() it returns the DBF of the source table, but when dropping the DELETED() index and recreating the cursor the DBF() of the cursor returns the temporary cursor name as expected. The following code proves my point:
CLOSE DATA ALL SET DEFAULT TO [c:\myfolder] CREATE DATABASE testdbc CREATE TABLE testdbf ( testfield C(1) ) INDEX ON DELETED() TAG DELETED INSERT INTO testdbf ; VALUES ( "1" ) SELECT * ; FROM testdbf ; INTO CURSOR testcursor * ----- CURSOR DBF appears to be the same as the TABLE DBF * BAD MESSAGEBOX("TABLE DBF is " + DBF("testdbf") ; + CHR(13) ; + "CURSOR DBF is " + DBF("testcursor") ; , 64 ; , "TABLE Indexed on DELETED().") USE IN testcursor SELECT testdbf DELETE TAG deleted SELECT * ; FROM testdbf ; INTO CURSOR testcursor * ----- CURSOR DBF appears to be a temporary file name * GOOD MESSAGEBOX("TABLE DBF is " + DBF("testdbf") ; + CHR(13) ; + "CURSOR DBF is " + DBF("testcursor") ; , 64 ; , "TABLE not Indexed on DELETED().")Can anyone explain why this is happening? I've worked around the problem by removing the DELETED() Index Tags from my tables as I don't use record recycling, but I'm curious as to why this behaviour is occuring. Why would adding an index on DELETED() cause this? I've even changed the name of the Index Tag to something other than 'deleted' and the problem still occurs.