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


Possibly Related Threads…
Thread Author Replies Views Last Post
  Run a YouTube Video From a QB64 Program? Magdha 4 346 12-13-2025, 02:57 PM
Last Post: Magdha
  auto-detecting screen resolution for optimal window size on non-Windows systems madscijr 11 1,048 11-10-2025, 07:23 PM
Last Post: madscijr
  auto-detecting screen resolution for optimal window size on non-Windows systems madscijr 0 214 10-26-2025, 06:58 PM
Last Post: madscijr
  Run code without compiler phil 9.0 7 1,284 12-05-2024, 08:52 AM
Last Post: phil 9.0
  HELP TO RUN QBASIC CODE FROM 90s ! musss1 12 2,745 06-10-2024, 09:19 PM
Last Post: Kernelpanic

Forum Jump:


Users browsing this thread: 1 Guest(s)