locked
Checkbook Balancer q. 2 RRS feed

  • Question

  • Hey everyone...  I found out another error in my program unfortunately.  The import ID is: VGP146 . You can see my other post HERE for all the details of my program, but this time I have a new question. After all is said and done, all is added and all is subtracted, the final number returns to be wrong. I don't know where the error is and if someone could help that would be awesome. Thanks, Tom
    Tuesday, July 6, 2010 10:29 PM

Answers

  • Use a single variable to hold the running total - you have variables balance , added , total , num1 , absolute and subtract all holding the total (or something related) at various stages and sometimes not updating each other correctly - we could try to figure out what need to be updated where, but the answer is to just use one variable for this.  See the subroutine example on previous post where I just used the variable balance to always hold the running total.
    • Proposed as answer by litdev Saturday, July 10, 2010 5:54 PM
    • Marked as answer by litdev Monday, July 12, 2010 5:58 PM
    Tuesday, July 6, 2010 10:41 PM

All replies

  • Use a single variable to hold the running total - you have variables balance , added , total , num1 , absolute and subtract all holding the total (or something related) at various stages and sometimes not updating each other correctly - we could try to figure out what need to be updated where, but the answer is to just use one variable for this.  See the subroutine example on previous post where I just used the variable balance to always hold the running total.
    • Proposed as answer by litdev Saturday, July 10, 2010 5:54 PM
    • Marked as answer by litdev Monday, July 12, 2010 5:58 PM
    Tuesday, July 6, 2010 10:41 PM
  • Also you can use while or For statement in end to save lines. Here is my version : VGP146-0  in 87 lines
    Sorry My Bad English
    Wednesday, July 7, 2010 10:26 AM