Circular Reference or Fatal Loop in Calculation?

AUTHOR’S NOTE - Fixed. See comments at http://forum.servoy.com/viewtopic.php?t=8448

I am having a problem with performance related to calculations on a form. Pls see the attached file (plain text). Sorry it’s an attachment - I am having problems posting the attached to the forum as the forum throws a PHP posting error.

Appreciate any feedback on attached,

thx,

Michael

ServoyPost.txt (1.71 KB)

Where is ‘other_monies_recd’ based on?

I see that you refer to the calc itself in ‘calc_amount_due’.

Calc Name is calc_amount_due

if (calc_amount_due)
	{
	return number_shares * price_share
	}
else
	return 0.00

;Maybe that is the reason

other_monies_recd is a std database field (type number) on the form. I am suspicious about it as it also is a calculation (ie - stored calc). In the calculation window it appears after the initial calculation (calc_amount_due). If I comment this calculation out the form runs fine.

And what is in there?

And what is in there?

Maybe I should not be using a stored calc on the first “sub-total” (calc_amount_due) … the compiler might be getting in a loop as there doesn’t appear (at least at the javascript level) to be a distinction between the calc_amount_due calculation variable and the foundset buffer (also carrying the calc_amount_due name as a “variable”).

By default it is = 0.00 (db assigned)

AUTHOR’S NOTE - Fixed. See comments at http://forum.servoy.com/viewtopic.php?t=8448