HP-42 Program Critique - Kinematic Equations (first program)
|
06-14-2020, 12:41 AM
(This post was last modified: 03-21-2021 07:49 PM by DM48.)
Post: #1
|
|||
|
|||
HP-42 Program Critique - Kinematic Equations (first program)
I've been writing small programs trying to get a feel for different areas of Free42/DM42.
Here is my version for the Kinematic equations (three instances). On the menu, the first variable listed is the data you have -> the data you want. Time -> Distance for example. Don't hold back and let me have it. I welcome any and all suggestions and corrections. My biggest obstacle at the moment is understanding when to use GTO vs XEQ. The difference is GTO goes and stops unless you point it somewhere else to go and XEQ executes and comes back and continues on. In the early days experimenting with the Menu layout and just have a 1 + option XEQ seemed to fail after four pushes of the soft key. This is why I used GTO here. Many thanks in advance! Code: 00 { 137-Byte Prgm } HP48GX, HP42s and DM42. |
|||
06-14-2020, 02:26 PM
Post: #2
|
|||
|
|||
RE: Program Critique
You might have been running into issues with the KEY XEQ instructions since your menu doesn't loop back to itself. Typically, after MENU, STOP, you'll want a GTO that jumps back to the same menu. This can either be a LBL directly before the MENU instruction, or all the way before the CLMENU (sometimes it depends on the program and whether it needs to refresh the contents of the menu every time it's displayed).
By doing that, and also leaving out the KEY 9 GTO... (i.e. not moving the program pointer when closing the menu), the user can redisplay the last menu by simply pressing R/S. Of course, there are plenty of times where you DO want to handle the EXIT key and RTN or GTO, particularly if you're building a tree of submenus and you want EXIT to go back up a level. |
|||
06-14-2020, 06:23 PM
Post: #3
|
|||
|
|||
RE: Program Critique
Thank you for the insight. I didn't even think about handling the program pointer when closing the menu. Will have to weight that out. I'm still trying to hold on to my 48G roots and soft menus.
I will play around with the looping back to the same menu and the KEY XEQ call you described. Thank you. HP48GX, HP42s and DM42. |
|||
03-18-2021, 12:59 AM
(This post was last modified: 03-18-2021 01:00 AM by DM48.)
Post: #4
|
|||
|
|||
RE: Program Critique
Updated. Comments welcome.
This program handles a few kinematic equations and sets a Custom menu (Key 4). Code:
HP48GX, HP42s and DM42. |
|||
03-18-2021, 03:17 AM
Post: #5
|
|||
|
|||
RE: Program Critique
The "00 { Header }" clarifies this program is intended for the 42S/Free42/DM42, but it's a good idea to include that in the posting Subject. This also makes it easier to locate the thread later when looking for this thread.
--Bob Prosperi |
|||
03-18-2021, 11:17 AM
Post: #6
|
|||
|
|||
RE: HP-42 Program Critique - Kine
Done and thank you.
HP48GX, HP42s and DM42. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)