Reputation: 493
Sorry, I am not allowed to post my full program - company rules.
I've got a portion of my program that reads a script file and reads in a timer value to the file. I need that value to pause the reading in of the next line from the script file, and the only way I'm aware of doing that is like this:
where the scan from string function retrieves the time in milliseconds and inserts it into the delay function. The problem with this is, it delays my main loop, and I have other timed functions running simultaneously based on previous commands issued from the same script file that may take more time to run. IS there any way to instantiate this, within a case structure, that will pause the reading of the next command, and let the main loop continue?
My script reader has an event handler so that the rest of my program will run without it until called.
This feeds directly into the nested case statements that feeds data directly to the timer. Any help is appreciated!
Upvotes: 1
Views: 1533
Reputation: 2986
If I understand correctly:
This is accomplished by the following simplified code.
WAIT 30
, the current time plus 30s is written to the shift register, and the button is disabled grayed out. That is, the user can't click it, and he even sees this!Timeout
case is executed. (again and again and again...) There, all the tasks which should run always, live. That case also checks if the current time is greater than the time in the shift register, and re-enables the button again.Upvotes: 1