YIELDYIELD tells FMSLogo to let other programs use the CPU while it is working. NOYIELD tells FMSLogo not to let other programs use the CPU while it is working. The default is to yield.
Note that the commander window itself is like another program. That is, if you have issued a NOYIELD, the commander will lose control. This means that the Halt Button won't work until a YIELD is issued or FMSLogo is idle again. The reason that NOYIELD is available is that FMSLogo runs faster if it prevents other programs from using the CPU.
You can achieve the proper balance between performance and yielding for your programs by understanding the examples given below. Let's say that you have nested loops in your program and that most of the real work is done in the inner loop.
Case 1: User in control for 10,000 operations, lower performance:
YIELD
REPEAT 100 [
REPEAT 100 [
; (work to be done)
]
]
Case 2: User out of control for 10,000 operations, good performance:
NOYIELD
REPEAT 100 [
REPEAT 100 [
; (work to be done)
]
]
Case 3: User out of control for 100 operations, still good performance:
REPEAT 100 [
NOYIELD
REPEAT 100 [
; (work to be done)
]
YIELD
]