- Use wait(0) to make windows appear and make buttons work during a loop.
- Use <<RunFormulas for forcing evaluation of data table formulas to complete.
- Use wait(1) to make a script run slower, perhaps to visualize a progression of changes.
JMP's table formulas evaluate in the background, when JMP is idle. Wait( n > 0 ) makes JMP be idle so the formulas can evaluate. The idle time formula evaluation is quite slow; using dt<<RunFormulas will be dramatically faster if there are 1E6 rows in the table.
Many data table commands have the <<RunFormulas built in ( dt<<sort, for example.) But operations like row indexing ( dt:height[i], for example ) do not, and an explicit <<RunFormulas is recommended (before the loop, not in the loop...there is a small time penalty even if it does nothing.)
Wait(n) idle time allows the operating system to update the display and send keystrokes and mouse clicks to your program. If you write a loop with no wait(0) idle time that opens and closes platforms, you won't see any activity on the display. If you need to see the windows popping open, a wait(0) is appropriate there. There is a small time penalty for wait(0) as well, even if nothing happens.
Craige