John Weller wrote:
> I have an index on DELETED() in most of my tables.  To check if a table
> needs packing I look for a deleted record using this index.  When I look at
> a table with no deleted records I'm finding that the line:
>
> LOCATE FOR DELETED()
> ?FOUND()
>
> returns False, whereas
>
> ? SEEK(DELETED(), 'MyTable', 'DelRecs')
>
> is returning True - which is obviously wrong!  This happens on all of the
> tables which do not have deleted records.  Any suggestions as to what I am
> doing wrong?  (I'm going to change the code to use LOCATE rather than SEEK
> as an interim measure).
>   
I'm going to hem and haw my way carefully through this, so I don't look 
much more ignorant then most people already think I am.
I can't answer the question, but maybe this will get someone a bit 
closer to it.

IIRC, Deleted() returns a .T. for the current record.  Since you have no 
deleted records, you are doing a Seek(.F.)

With an index on Deleted():
with all records non-deleted, if you literally do a Seek(.F.), it always 
returns .T., and a Seek .T. always returns .F.
with all records deleted, if you literally do a Seek(.F.), it always 
returns .F., and a Seek .T. always returns .T.
With a mix, both always return .T.

If you reverse your index, though ( "Index on !Deleted()" etc ), 
everything works exactly as you would expect, including  your 
Seek(Deleted())

I dunno.


_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to