A Schedule function lets you set up a script to be executed some number of seconds later.
JMP Scheduler
A Scheduler window shows the time until the next event and has buttons for restarting (Go) or stopping (Stop) the schedule. Its pop-up menu has a command Show Schedule, which echoes the current schedule to the log. For example, if you checked the schedule several times during the “hello” example, you would see something like this:
Schedule initiates an event queue, but once it has the event queued, JMP proceeds with the next statement in the script. For example, the following has results that might surprise you:
If you want the script to wait until the scheduled events are finished before proceeding, one solution would be to use Wait( ) with a suitable pause. Another is to embed the subsequent actions into the schedule queue. Schedule accepts a series of arguments to queue many events in sequence. Each event is a separate call to the schedule. Each event time is an absolute time relative to “now” (or the instant that Go is clicked). Therefore, the following sequence finishes in five seconds, not in twelve:
Note: It is not possible to create multiple threads using Schedule.
sc=Schedule(n, script)
Queues an event to run the script after n seconds.
sc<<Clear Schedule( )