Bernhart,
When you use EXECSCRIPT VFP compile that script as external program and execute it, so everithing that is not declared is out of scope after finishing the scrip. That's why you get the array not declared but the _TALLY is 33 :o))
try:
DIMENSION tsSelectedList[1,2]
=EXECSCRIPT(lcSQL)
etc.
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.