A program to calc leasing
|
05-20-2015, 10:35 PM
Post: #1
|
|||
|
|||
A program to calc leasing
hi,
I put on the HP Prime Software Library a program to calculate Leasing with advanced payments (monthly pmt and yield) and Leasing with residual. This is the link. The program uses the power of the "financial" functions of the Prime. Enjoy! Salvo ∫aL√0mic (IT9CLU) :: HP Prime 50g 41CX 71b 42s 39s 35s 12C 15C - DM42, DM41X - WP34s Prime Soft. Lib |
|||
05-20-2015, 10:51 PM
Post: #2
|
|||
|
|||
RE: A program to calc leasing
I've watched you come a long way with the Prime, congratulations on yout programming!
Regarding your latest share, the leasing program, have you considered using a DRAWMENU type interface to access the choices? Alternative menu options, such as CHOOSE, or conditional branching from an INPUT variable, also work; but with DRAWMENU a segway into the world of graphics is bound to follow. Once you have the pixels at your command, you can do pretty amazing things. -Dale- |
|||
05-20-2015, 10:58 PM
(This post was last modified: 05-20-2015 10:59 PM by salvomic.)
Post: #3
|
|||
|
|||
RE: A program to calc leasing
(05-20-2015 10:51 PM)DrD Wrote: I've watched you come a long way with the Prime, congratulations on yout programming!thanks a lot, Dale! My dream now is to have 90% of the HP 12C also in the Prime :-) Quote:Regarding your latest share, the leasing program, have you considered using a DRAWMENU type interface to access the choices? Alternative menu options, such as CHOOSE, or conditional branching from an INPUT variable, also work; but with DRAWMENU a segway into the world of graphics is bound to follow. Once you have the pixels at your command, you can do pretty amazing things. DRAWMENU would be better, but for now I'm not so able to make one. Please, help me to make one for the program! Tomorrow, in the mean time, I'll try to add also calculation for yield for "leasing with residual": it's like use IRR, but I must generalize an example, first: lessee accept to pay in advance first and last rate; like a matrix with frequencies: [-CF0+advanced*PMT, 1][PMT, n-advanced][0, 1][residual_val, 1]: I must abstract a rule yes, I'd like to have a good menu, better, drawmenu: I must learn it... Salvo ∫aL√0mic (IT9CLU) :: HP Prime 50g 41CX 71b 42s 39s 35s 12C 15C - DM42, DM41X - WP34s Prime Soft. Lib |
|||
05-21-2015, 08:47 AM
Post: #4
|
|||
|
|||
RE: A program to calc leasing
(05-20-2015 10:51 PM)DrD Wrote: Regarding your latest share, the leasing program, have you considered using a DRAWMENU type interface to access the choices? Dale, I have put just now a new version with choose menu for the choices, thank you always for the tips and advice –•• ••– TU! 73, Salvo ∫aL√0mic (IT9CLU) :: HP Prime 50g 41CX 71b 42s 39s 35s 12C 15C - DM42, DM41X - WP34s Prime Soft. Lib |
|||
05-21-2015, 10:33 AM
Post: #5
|
|||
|
|||
RE: A program to calc leasing
(05-20-2015 10:58 PM)salvomic Wrote: <<< There may be several ways to approach this, but I keep a skeleton menu framework (program) in my "master program catalog," expressly for this. To use, just put routines (or subroutines) in between the (otherwise empty) IF END constructs, that relate to the soft buttons, as set up in DRAWMENU(). An example: the "Exit" soft button, (btn 6), and it's associated routine. Rename it to your program, and embellish as needed. I hope you can find this useful, I know I sure have. One day, (maybe), I will take the time to try to work out how to do submenu popups, from DRAWMENU(). I started to do that once, but it quickly got to be a larger task than I wanted to deal with at that time. That is an exercise, as they say, left to the reader! Grobs, using graphics commands, work well for creating dynamic, or interactive screen applications, made more useful when driven by soft menu selection on screen, from DRAWMENU(). Here's the code I use for this framework: Code:
|
|||
05-21-2015, 10:47 AM
(This post was last modified: 05-21-2015 11:44 AM by salvomic.)
Post: #6
|
|||
|
|||
RE: A program to calc leasing
(05-21-2015 10:33 AM)DrD Wrote: There may be several ways to approach this, but I keep a skeleton menu framework (program) in my "master program catalog," expressly for this. To use, just put routines (or subroutines) in between the (otherwise empty) IF END constructs, ... hi Dale, thank you for the gift very interesting. I'm seeing it and I think to use in some programs of mine... For now about "Leasing" I'm using a simple choose menu, but maybe in the future I could change it... I think to use your Drawmenu with "IRR" program, today I try a bit! Salvo EDIT: I'm trying the skeleton... How to return to menu from the functions? I've having troubles with a simple code: Code:
When it revert to the Drawmenu (CFmenu) or also "Exit" button recall menu, or Prime hangs... Thank you ∫aL√0mic (IT9CLU) :: HP Prime 50g 41CX 71b 42s 39s 35s 12C 15C - DM42, DM41X - WP34s Prime Soft. Lib |
|||
05-21-2015, 02:32 PM
Post: #7
|
|||
|
|||
RE: A program to calc leasing
with your help, Dale (DrD), khapster, Eddie, I'm debugging this menu based on Drawmenu and menu handler routine.
Please help me to debug. i.e. when user press "Quit" soft key the program return to previous Print screen: any advise? Code:
∫aL√0mic (IT9CLU) :: HP Prime 50g 41CX 71b 42s 39s 35s 12C 15C - DM42, DM41X - WP34s Prime Soft. Lib |
|||
05-21-2015, 03:45 PM
Post: #8
|
|||
|
|||
RE: A program to calc leasing
(05-21-2015 10:47 AM)salvomic Wrote: EDIT: In the Main Loop, the skeleton is constantly waiting for mouse activity. Therefore the soft button menu should be present at all times. If something else is displayed at the soft button coordinates, and the contents of DRAWMENU() have disappeared due to other programmed activity, just serves to confuse a user, possibly ending up in some unanticipated routine. The way to keep the DRAWMENU() present at all times is by controlling the graphics screen, (typically, GO). The way to do that is to use textout_p() instead of the print terminal. You would keep all text content above the lines reserved for the soft button menu. As mentioned previously, grobs, and graphics commands are the next step in program evolution. Forget about the print terminal. Use the pixels on the screen to your advantage, where you control the location of text, foreground and background colors, text size, etc. It actually sounds more difficult to describe, than it actually is. I would suggest just to dive in, make some mistakes, and you'll be a pro before the weekend! What you will end up with is your soft button menu present constantly. At any time you can jump into the menu's routines or exit, accordingly. A well designed soft button driven routine, will keep the user under control such that no unanticipated activity should occur. Simpler is better in constructing your programs, unless you have a need for speed. It makes debugging easier. Small self contained routines are easiest to debug (modular programming) and they fit nicely in between those IF END blocks in the skeleton. I use this technique in the Smith Chart program, and to date, there is a lot of activity, such as rotating the text along the perimeter of the outer constant resistance circle, which could not be done without the graphics command set. I used graphics screen G1 to create "invisible" content, and BLIT_P() it back to GO, the user viewable screen, where, pixel by pixel, I recreate the font needed to appear as rotated text. I'm sure you will appreciate the programmer-side advantage once you get a handle on grob programming, and your programs will come alive for the user, in the end-game! -Dale- |
|||
05-21-2015, 03:57 PM
(This post was last modified: 05-21-2015 08:19 PM by salvomic.)
Post: #9
|
|||
|
|||
RE: A program to calc leasing
(05-21-2015 03:45 PM)DrD Wrote: In the Main Loop, the skeleton is constantly waiting for mouse activity. Therefore ... thanks a lot, Dale, I'm reading more time your advice here, I agree, and I will apply it by now. I hope to rewrite the Printed Terminal rows into TEXTOUT_P soon, but first I must understand how to do when I recall EVAL(something) inside a line to print... I'm sure some of you will have the patience to help me in that job Salvo EDIT: I've rewritten Leasing and Cash_Flow with TEXTOUT_P and eliminated Print() and MsgBox and the stability is greatly improved! ∫aL√0mic (IT9CLU) :: HP Prime 50g 41CX 71b 42s 39s 35s 12C 15C - DM42, DM41X - WP34s Prime Soft. Lib |
|||
05-23-2015, 05:15 PM
Post: #10
|
|||
|
|||
RE: A program to calc leasing
Leasing and ...mortgage.
In the HP Software Libraries for Prime (in this link) I put a program to calculate APR (Annual percentage rate) for a mortgage with fees (as percentile points %, fix amount or both). The program use the powerful financial functions of the Prime. ciao Salvo ∫aL√0mic (IT9CLU) :: HP Prime 50g 41CX 71b 42s 39s 35s 12C 15C - DM42, DM41X - WP34s Prime Soft. Lib |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)