I would do that:

Local lcFilter, liRecno

lcFilter = 'lastWorked < Date() - 15
liRecno = Recno()
Locate for &lcFilter
GO m.liRecno
IF Found()
  SET FILTER TO &lcFilter
ELSE
  SET FILTER TO
ENDIF

Thierry Nivelet
http://foxincloud.com/
Give your VFP app a second life in the cloud

Le 26 avr. 2012 à 11:41, Michael Madigan <mmadi10...@yahoo.com> a écrit :

> OK, this hasn't been a problem in the past, mainly because nobody bothered to 
> tell me.   The operators just fume 
> 
> This rarely happens because rarely does this condition ever happen.  
> 
> 
> If i have a filter like
> 
> set filter for lastworked< date()-15   
> 
> 
> and the lastworked date is altered by the operator, and it's the last record 
> in that filter, I get an "Record out of range" error. 
> 
> Now I do check for EOF() if i am skipping forward and BOF() if I'm skipping 
> backward, but I'm not checking if both BOF() and EOF() is true at the same 
> time. 
> 
> Questions.
> 
> Is that the correct way to check if the filter condition is empty or should I 
> do something else? 
> 
> I ultimately want to remove the filter if there are no records that meet that 
> condition
> 
> A SQL select is way too slow for what i want to do.  
> 
[excessive quoting removed by server]

_______________________________________________
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
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/c70b6a6b-2c43-4de8-bf21-e5749cd01...@foxincloud.com
** 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