Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why reccount() and _tally are different ?
Message
 
To
08/05/1998 15:28:32
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00097511
Message ID:
00098268
Views:
61
Jim,

Just to add to the discussion, from the help file for RECCOUNT()

"Returns the number of records in the current or specified table."

"Remarks

The value RECCOUNT( ) returns isn’t affected by SET DELETED and SET FILTER."

and now _TALLY

"Contains the number of records processed by the most recently executed table command."

"Certain table processing commands return information about their status (“talk”) while they execute. When such a command finishes executing, it displays the number of records it processed (if SET TALK is ON), and stores this number to the _TALLY system variable.

The following commands return status information:

APPEND FROM AVERAGE
CALCULATE COPY To
COUNT DELETE
INDEX PACK
REINDEX REPLACE
SELECT - SQL SORT
SUM TOTAL
UPDATE

When you start Visual FoxPro, _TALLY is set to 0. Executing one of the commands above replaces the _TALLY value with the number of records the command processed."

These two definitions seem pretty clear to me. The unclear part of all of this has nothing to do with these two functions (actually one function and one variable) it has to do with the fact that an SQL SELECT may be optimized by using the table again in another work area under another alias and setting a filter on it. In that case _tally tells us the number of records which meet the filter condition and reccount() tells us the number of records in the table.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform