Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Auto reload program upon RUN
#1
Anybody have any clever ideas on how one would get the IDE to reload a program when it was run? The program in question actually updates  itself when it runs, and I was just wondering if there was a way to get the ide to reload the code so I wouldn't forget to reload it and go change some code save it and destroy the changes the program made last time it ran.
Reply
#2
(07-06-2023, 08:58 PM)Cobalt Wrote: Anybody have any clever ideas on how one would get the IDE to reload a program when it was run? The program in question actually updates  itself when it runs, and I was just wondering if there was a way to get the ide to reload the code so I wouldn't forget to reload it and go change some code save it and destroy the changes the program made last time it ran.
Hi Cobalt, I am sorry that I cannot help on the IDE question, but I would think you could set up a private git repo to do this....maybe?  Two separate thoughts below.

Simple method (may not work for your use case with metaprogramming): I have all my code in a local (non-cloud account) that then updates to a local git and can be pushed/sync'd to GitHub.   The IDE will not close with changes without giving you the warning that you have unsaved changes; so that is a stop gap too.  Once it is saved you can commit and sync whenever you want - and/or set it up in a particular way.  I use GitHub Desktop which is very powerful these days, i.e. you can do just about everything with a repo as you can on the command line.

Complex case where program updates the source code when run:   In your case, can you program in QB64pe source code to save the file after you run it with a sequentially adjusted (version control) name.  Your case seems different than mine since your program updates itself (the source code) when run (metaprogramming maybe).  So why not program a file I/O (very last thing to run before returning control to the OS) to save it each time it is run.  You could presumably reload the new program with the new filename as well.  But this way you have the before-and-after saved to disc (if not local git/GitHub as well) each time you run it.   

Interesting situation.....
Reply
#3
Taskkill to close the old IDE.  Then just open a new one with the changed bas file as a parameter.
Reply




Users browsing this thread: 1 Guest(s)