>It's much simpler to do with a query
SELECT date, SUM(dr_amount) AS debit, SUM(cr_amount) AS credit ;
> FROM vouchers ;
> WHERE acc_code = m.acc_code1 AND date = m.fdate1 ;
> INTO CURSOR crsSums
>
>SELECT cash_f
>APPEND FROM ( DBF("crsSums") )
>
Since this is repeated for several dates, I would also apply a GROUP BY DateField to avoid the loop.
(I gave an example with GROUP BY, but still used a SCAN loop. Adding an APPEND FROM makes this unnecessary.)
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)