I have a control the emulates a “terminal”.
I also have an “array” the holds a series of instructions (ie. a user entered program)
my “run loop” executes those programs, jumping around as required (goto, gosub etc)
along the way it needs to update the “terminal” with changes in output.
This works fine when the program has no branches or loops
but when it does, the output doesn’t update until the main thread is complete
I think this can be solved with some kind of a timer mechanism that would submit the user instruction in a thread, and the display would be updated each time that subthread completed…
But I cannot seem to figure out how this should be constructed to waste the minimal amout of run time, still be responsive (some instructions require user input, so the GUI must be active at least during that time etc)