![]() |
|
|||||||
| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| Questions & Help Needed Post any question regarding Basic4ppc. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Hi, this is my first post on this great site. I have started playing around with the desktop version and am trying to make a loan formula, but I must be getting the syntax wrong.
Here is what it's supposed to look like: Payment = (Rate + (Rate / ((1 + Rate) ^ Months) * -1)) * Principal For some reason when I enter it like that I get a syntax error. I believe that my use of negative one is the problem. I appreciate any help. Thanks! Steve |
|
|||
|
I figured it out. I made an error. I was supposed to subtract 1, not multiply by negative one. Here's my final code:
Sub cmdCalc_Click Dim Prin Dim Rate Dim Term Dim MonthlyRate Dim Payment Dim Middle Dim bottom Prin = txtPrin.Text Rate = txtRate.Text / 1200 Term = txtLength.Text * 12 bottom = ((1 + Rate) ^ (Term )) bottom = bottom - 1 middle = Rate / bottom Payment = (Rate + middle) * Prin lblOut.Text = Payment Thanks for the help. |
|
||||
|
Quote:
You can just use the without previous settings... If you need to share a variable bettween several subs, then put them in the Global sub, like this: Prin="" Rate="" Term="" MonthlyRate="" Payment="" Middle="" bottom=""
__________________
Paulo Gomes Porto, Portugal PC: Dual-Core 1,8Ghz, 2GB RAM, 80GB HD PPC: Qtek9000, 1GB SD |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| SQLite external library newbie question | JamesC | Questions & Help Needed | 2 | 05-29-2008 03:48 AM |
| Newbie question - arrays and tables | BjornF | Questions & Help Needed | 3 | 05-15-2008 09:29 AM |
| Another newbie question: How to refere to the active form? | yildi | Questions & Help Needed | 2 | 11-17-2007 07:55 PM |
| Newbie questions | stratus | Questions & Help Needed | 2 | 11-13-2007 01:21 PM |
| Newbie - question about loadXML | yildi | Questions & Help Needed | 6 | 11-12-2007 11:43 PM |