General information
Category:
Coding, syntax & commands
>>Seems like there should be an easy way to do this like reccount could have a parameter to respect "set deleted" or something. Oh well... Got it done. Thanks!
>
>reccount() is extremely fast, and straightforward, because no actual count is done. The information is extracted from the current table - how many records are there.
>
>This doesn't work for any kind of filter condition (including the implicit "set filter on not deleted()" if you SET DELETED ON). In this case, if you do a COUNT, Visual FoxPro has to go through the records and analyze the condition for each record, to see whether it should be included in the count, or not.
>
>You can create a UDF to have a straightforward (but not necessarily fast, especially on large tables) method of counting records. To take buffering into account, you could save the filter to a variable, re-open (USE...AGAIN) the table in another work area, apply the filter, count, save _tally to a variable like lnReturnValue, clean up (close the table and go back to the previous work area), and return lnReturnValue.
Yeah I know how reccount works. I was just wishing (out loud) it could work with set deleted on. Seems like a common thing to want to do. Count records, not deleted ones, pretty basic.
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only