You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Two things were broken. COUNT without the TO clause didn't even compile: the VO rule in dbcmd.xh expands to "<xvar> := 0", so leaving TO out gives you a naked := and an XS9002. And _TALLY was declared in SystemVariables.prg but nothing in the runtime ever wrote to it, so COUNT TO n gave you n = 2 and _TALLY = 0.
Added three COUNT rules plus a __VfpCount() helper in Commands.prg. The helper just wraps DbEval(), same as the VO rule did, but counts inside and stores the result in _TALLY.
Irwin,
I am considering to add a setting to the runtime, where dbeval() stores the # of records processed in it's last run.
Something similar to the field where the error code for the low level file operations is stored.
That can then be used to assign _tally but is also available for other code.
I cannot assign to _tally directly since that field is inside the vfp assembly.
I will create a local inside the dbeval code and assign the setting after dbeval() finishes.
What do you think of this?
Sounds good to me. My helper only counts for COUNT, every other command would need its own. One thing I hit while checking this against VFP 9 is that _TALLY is the records affected, not the ones visited. With 5 records and 1 deleted, RECALL ALL reports 1, but our RECALL goes through DbEval with scope ALL, so a counter in there would say 5. Might need special casing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2024, or at least the
COUNTpart of it.Two things were broken.
COUNTwithout theTOclause didn't even compile: theVOrule indbcmd.xhexpands to"<xvar> := 0", so leavingTOout gives you a naked:=and anXS9002. And_TALLYwas declared inSystemVariables.prgbut nothing in the runtime ever wrote to it, soCOUNT TOn gave youn = 2and_TALLY = 0.Added three
COUNTrules plus a__VfpCount()helper inCommands.prg. The helper just wrapsDbEval(), same as theVOrule did, but counts inside and stores the result in_TALLY.