using for loop to decrement a value

Please help me with the following code…

for i=1 to “No. of expected interest period” do begin

“carrying value”:=1000000;

Interest:=(“Effective Interest”*“Carrying Value”)/100;
Amortization:=“Expected Interest Amount”-Interest;
“Carrying Value”:=“Current Value”-Amortization;

end;

Having made the required definitions prior to this code i was not able to get the desired results. I expected the “carrying value” to decrement by the value of amortization and the new value is used for calculation of Interest.

please help. agent.

I think you have to write “carrying value”:=1000000; before for i=1 to “No. of expected interest period” do begin

If you always take that number from the Current Value, and you don’t change the Current Value, the carrying value is never going to change. This is what the debugger is for, so that you can find these things yourself.