I am trying to debug some ActiveX and found this article that says that VFP makes a call to the PeekMessage API between every line of code to process the OKL commands (at least), so, a call to _tally after a select statement might not occur inmediately after the select, and if in the called code you have a command that modifies _tally you are back in trouble
http://support.microsoft.com/default.aspx?scid=kb;en-us;143303
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?
"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare
"To die for a religion is easier than to live it absolutely"
Jorge L. Borges