Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Calculating in a scan...endscan
Message
De
02/10/2006 03:13:25
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01158457
Message ID:
01158486
Vues:
22
>:( after i asked i found my mistake and solved my problem ,
>if any good suggest will be very appreciated
>
>
>Local lnRemainder
>	m.Remainder = 0
>	Go Top
>	Scan
>		Replace CrsResult1.Remainder With m.lnRemainder + CrsResult1.debit - CrsResult1.credit In CrsResult1
>		m.lnRemainder = CrsResult1.Remainder
>	Endscan
>
Hi Soykan,

Our accountants calls this 'running balance' and is very common
calculation in accounting statements/balances of all sorts.

If Scan/Endscan is already used to prepare report info
then I differ from Hilmar here, and prefer it precalculated in that very cursor rather then using report variables.

However, if data are previosely extracted via some SQL procedure,
and all you do here is additionaly calculating that running balance,
then I agree with Hilmar, because report variables spares you of need
(time) for that additional loop on basically the same data.

BTW Wldn't it be simplier like this ?
Local lnRemainder
m.lnRemainder = 0.00
Go Top
Scan
 lnRemainder = lnRemainder + crsResult1.debit - crsResult1.credit
 Replace CrsResult1.Remainder With lnRemainder
Endscan
2c
*****************
Srdjan Djordjevic
Limassol, Cyprus

Free Reporting Framework for VFP9 ;
www.Report-Sculptor.Com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform