HP-42 Program Critique - Kinematic Equations (first program) - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html) +--- Forum: General Forum (/forum-4.html) +--- Thread: HP-42 Program Critique - Kinematic Equations (first program) (/thread-15187.html) |
HP-42 Program Critique - Kinematic Equations (first program) - DM48 - 06-14-2020 12:41 AM 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 } RE: Program Critique - Dave Britten - 06-14-2020 02:26 PM 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. RE: Program Critique - DM48 - 06-14-2020 06:23 PM 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. RE: Program Critique - DM48 - 03-18-2021 12:59 AM Updated. Comments welcome. This program handles a few kinematic equations and sets a Custom menu (Key 4). Code:
RE: Program Critique - rprosperi - 03-18-2021 03:17 AM 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. RE: HP-42 Program Critique - Kine - DM48 - 03-18-2021 11:17 AM Done and thank you. |