Results 1 to 7 of 7

Thread: What is not write about my program? Can someone help me solve this. Financial Prog.

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2004
    Posts
    13

    What is not write about my program? Can someone help me solve this. Financial Prog.

    My program is supposed to determine if a user qualifies for a loan or not. I think I did all the coding right, with the write equations, ect. But it always says that it has performed some type of "Arithmatic Overflow"

    My teacher says that if you put in salary of 8,000. Sales price - 200000, downpayment - 5000, interest - 7%, term - 360, and debt - 500. It should qualify for a loan. But it still says the Arithmatic Overflow. I was wondering if anyone good look at my coding to see whats wrong with it

    The program file is attached in a zip.
    Attached Files Attached Files

  2. #2
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687
    An overflow happens when you take a large number and try to stuff it into something too small, like trying to stuff a Long into an Integer.

    Sounds like there is some math going on that's causing it to overflow its bounds. Try running through, breaking on all errors, and see where the error happens.

    TG
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3
    New Member
    Join Date
    Mar 2003
    Posts
    9

    Root of the problem

    Your problem stems from the usage of integer variables for your calculations when some, or all of them need to be some sort of floating point data type. Ex, trying to stuff/convert .07 into an integer field gives you a zero.

    Try the other solution listed here and you will see.

  4. #4

    Thread Starter
    New Member
    Join Date
    Mar 2004
    Posts
    13
    I don't get it changed them all to longs and still doesn't work.. please help!

  5. #5
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    not longs... doubles

  6. #6

    Thread Starter
    New Member
    Join Date
    Mar 2004
    Posts
    13
    still not work..

  7. #7
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    I just downloaded your project, changed all those variables declared at the top to doubles, and i got no errors.

    VB Code:
    1. Dim intGross As Double
    2.     Dim intDebt As Double
    3.     Dim intRate As Double
    4.     Dim intTerm As Double
    5.     Dim intDownPayment As Double
    6.     Dim intLoanAmount As Double
    7.  
    8.     'This dims the variables that will be used to complete the equation
    9.     Dim intGross28 As Double
    10.     Dim intGross36 As Double
    11.     Dim intSalesPrice As Double
    12.     Dim intR As Double
    13.     Dim intN As Double
    14.     Dim intP As Double
    15.     Dim intPMT As Double
    16.     Dim intTaxes As Double
    17.     Dim intDebtRatio As Double

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width