_Tally
This system variable|
Usage |
nNumAffected = _TALLY |
|
Append From
|
Delete
|
Replace
|
|
However, there's one real oddity on this list. _TALLY after REINDEX contains the number of records for which the last tag indexed applies. If you have filtered tags (indexes using a FOR clause), _TALLY returns the number of records contained in the last index. "Last" here refers to the creation order of the tags, since they're re-created in the same order. This isn't really a big problem since we suggest you never use REINDEX anyway. |
|
In VFP 3 and VFP 5, when TALK is OFF, INDEX and REINDEX don't update _TALLY. This bug is fixed in VFP 6. |
|
Example |
SELECT First_Name, Last_Name FROM Employee ; WHERE MONTH(Birth_Date)=MONTH(DATE()) ; INTO ARRAY aThisMonth * Check if any records met the criteria. IF _TALLY=0 * If not, create the array with blank values. DIMENSION aThisMonth[1,2] aThisMonth = "" ENDIF |
USE Employee
COUNT FOR MONTH(Birth_Date)=MONTH(DATE())
WAIT WINDOW ;
LTRIM(STR(_TALLY))+" employees have birthdays this month"
Do watch out for one thing with _TALLY. Because so many commands affect it, it's important to grab the value right away if you want to keep using it. Otherwise, you run the risk that a later command will overwrite the value.
|
See Also |
Append From, Average, Blank, Calculate, Copy To, Copy To Array, Count, Delete, Delete-SQL, Export, Index, Join, Pack, Recall, Reindex, Replace, Replace From Array, Select-SQL, Sort, Sum, Total, Update, Update-SQL |
View Updates
Copyright 2002 by Tamar E. Granor, Ted Roche, Doug Hennig, and Della Martin. All Rights Reserved.
TerminateRead
This is another property included only for conversion of FoxPro 2.x screen sets. It corresponds to the Terminate Read option|
Usage |
oObject.TerminateRead = lEndItAll lEndItAll = oObject.TerminateRead |
|
See Also |
Release Method, WindowType |
View Updates
Copyright 2002 by Tamar E. Granor, Ted Roche, Doug Hennig, and Della Martin. All Rights Reserved.