HP Forums
Loading Program with multiple interdependent Sub Routines - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: Loading Program with multiple interdependent Sub Routines (/thread-18346.html)



Loading Program with multiple interdependent Sub Routines - bobkrohn - 05-09-2022 06:57 PM

I developed a rather large program. It has about 100 Sub Routines. Many are interdependent. One Sub Calls another that Calls another. No problems as I developed the main Program. However, after doing a Reset I tried loading all the Subs and that’s when I made the horrible discovery that when you load a Sub it checks for all the Calls and if those Calls refer to other Subs that have not been loaded yet, then the Sub won’t Load! It’s a “Catch-22”.
Why won’t it allow you to Load everything THEN check the Calls?
I don’t really want to combine ALL the Subs into one big file because…
1) Makes debugging and editing a slow nightmare
2) Want Subs to be available to other Programs.

Ideas??


RE: Loading Program with multiple interdependent Sub Routines - Tim Wessman - 05-10-2022 05:28 AM

This was exactly why the update to programs that turned on python now allow multiple source files of different types. A program is actually now more of a "project" that will correctly scan all the sources and eliminates this type of situation.

have you put your sources into one program group?


RE: Loading Program with multiple interdependent Sub Routines - bobkrohn - 05-12-2022 08:42 PM

I have not done any programming for quite a while after that disaster.
I’ll try to reengage using your suggestions.
Thanks for your help.