>CLEAR >CREATE CURSOR noBuffer (du I) >ON ERROR ?? "ERROR: "+MESSAGE() > >SET MULTILOCKS ON >Create Cursor abcd (abc C(10)) >insert into abcd values('xyz') >insert into abcd values('xyz1') >cursorsetprop("buffering",5) >insert into abcd values('xyz2') >insert into abcd values('xyz3') >replace RECORD 2 abc WITH 'xyz4' > >? "Now set like active workarea a not buffered cursor, this not allow GETFLDSTATE(-1) and errors are fired" >SELECT noBuffer >? "THIS IS the value that VFP use WHERE PARSING phase: ",GETFLDSTATE(-1) >? "executing 1 " >select * from abcd with (buffering = .t.) WHERE "2" $ GETFLDSTATE(-1) INTO ARRAY pippo >?? " Expected 1" >? >? "Now set no active workarea, on SELECT it catch the issue, and then set like active workarea the result cursor," >? " but this is empty, and GETFLDSTATE(-1) return a .NULL." >SELECT 0 >? "THIS IS the value that VFP use WHERE PARSING phase: NULL" >? "executing 2 " >select * from abcd with (buffering = .t.) WHERE "2" $ GETFLDSTATE(-1) INTO ARRAY pippo >?? _TALLY," Expected 1" > >? >? "Now set a buffered cursor with a unbuffered record" >SELECT abcd >GO 1 >? "THIS IS the value that VFP use WHERE PARSING phase: ",GETFLDSTATE(-1) >? "executing 3 " >select * from abcd with (buffering = .t.) WHERE "2" $ GETFLDSTATE(-1) INTO ARRAY pippo >?? _TALLY," Expected 1" > >? >? "Now set a buffered cursor with a buffered record" >SELECT abcd >GO 2 >? "THIS IS the value that VFP use WHERE PARSING phase: ",GETFLDSTATE(-1) >? "executing 4 " >select * from abcd with (buffering = .t.) WHERE "2" $ GETFLDSTATE(-1) INTO ARRAY pippo >?? _TALLY," Expected 1" > >* WORKAROUND: force VFP to think the where condition not invariant > >select * from abcd with (buffering = .t.) WHERE "2" $ GETFLDSTATE(-1)+LEFT(abc,0) > >ON ERROR >>
clear close all SET MULTILOCKS ON Create Cursor abcd (abc C(10)) insert into abcd values('xyz') insert into abcd values('xyz1') cursorsetprop("buffering",5) insert into abcd values('xyz2') insert into abcd values('xyz3') replace RECORD 2 abc WITH 'xyz4' ?"updating Abcd : " + Icase(tableupdate(2,.t.,"abcd"),"Updated","not updated") insert into abcd values('xyz5') replace abc with "xyz5 + R" for abc = 'xyz5' ?"Replacing after insert" select * from abcd with (buffering = .t.) WHERE "2" $ GETFLDSTATE(-1)+LEFT(abc,0) ?_tally,"records returned . expected 1" select * from abcd with (buffering = .t.) ?_tally,"records returned -- total number in buffered alias" select * from abcd ?_tally,"records returned -- total number from disk"Any ideas