Counting Periods CW2003 
Author Message
 Counting Periods CW2003

Hi All,

I have an APP written in CW2003 which calculates various loans starting
at the present value and computing to zero.  The App calculates a number
of loans with different amounts and interest rates, at the same time.
Everything works fine except I haven't
figured out a method to show how many months the payoff  takes for each
loan.  At present the months are counted by the number of times the
computing processed has looped through the code to reach zero for the
largest loan.

My code is as follows:

Loop until  Fil:balance2 <=0

  if fil:balance1>0 then
    fil:interest1=fil:balance1 * fil:intrate1/12
   etc
 if fil:balanc2 >0 then
  fil:interest2=fil:balance2 * fil:intrate2/12
etc

In the report detail, I have entered a field (fil:months) and gave it a
"count" property.  Thus it counts for each calculaton made and it's
total count is the number of months needed to
payoff the largest loan. I want to be able to print the count when loan
one is payoff as well as loan two is paid off without printing a report
of 360 months/lines and thumbing back to see at which month loan one was
paid of i.e. 40 months/lines.

I was thinking Pointer, but not sure where to start?  Any help would be
appreciated.

chuck bolland



Mon, 11 Mar 2002 03:00:00 GMT  
 Counting Periods CW2003


Quote:
>Hi All,

>I have an APP written in CW2003 which calculates various loans starting
>at the present value and computing to zero.  The App calculates a number
>of loans with different amounts and interest rates, at the same time.
>Everything works fine except I haven't
>figured out a method to show how many months the payoff  takes for each
>loan.  At present the months are counted by the number of times the
>computing processed has looped through the code to reach zero for the
>largest loan.

>My code is as follows:

How about
       Data
          PayoffMonths       Short, Dim(x)

then
  Clear(PayoffMonths)

Quote:
>Loop until  Fil:balance2 <=0

>  if fil:balance1>0 then
>    fil:interest1=fil:balance1 * fil:intrate1/12
>   etc

      PayOffMonths(1) += 1
    end
Quote:
> if fil:balanc2 >0 then
>  fil:interest2=fil:balance2 * fil:intrate2/12
>etc

          PayOffMonths(2) += 1
   end
Then you can have the report print
       Loan               1                                   2 ...

       Payoff   PayoffMonths(1)     PayoffMonths(2)....

HTH
Ed



Mon, 11 Mar 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. ANN: Time period library period-0.5 released

2. ANN: Time period library period-0.5 released

3. Count Down to DevCon -- 7 Days and Counting

4. count counter counting mechanism

5. counting events and miss first count

6. count counts but any doesnt

7. Count = Count + 1;

8. How does the counter on PCI6024E count? Once a period or twice?

9. Period (".") problems and a gnubie

10. Top 10 posters for the 14 day period ending 2001-07-08

11. 1 day trial period????

12. News retention period

 

 
Powered by phpBB® Forum Software