PAUSE

Synopsis
PAUSE
Description

Command or operation that enters an interactive pause mode. During pause mode, FMSLogo prompts the user for instructions to run. After each instruction is run, the execution becomes paused again. All variables that existed at the time PAUSE was run are available to these instructions.

If one of these instructions throws an error, the error is caught and printed to the commander's history. However, execution remains paused and the user is prompted for another instruction. Therefore, mistyping an instruction doesn't exit pause mode.

The name of the procedure that ran PAUSE is printed to the commander's history.

The interactive pause mode can be exited by running CONTINUE. If CONTINUE is given an input, then that input becomes the output of PAUSE. If CONTINUE is not given an input, then PAUSE does not output anything.

The interactive pause mode can also be exited by THROW as long as the tag isn't "ERROR. In this case, execution doesn't resume at the point of the PAUSE but at whatever would CATCH that tag. Therefore, THROW "TOPLEVEL can be used to completely stop execution.

The ERRACT variable can be assigned the value [PAUSE] so that Logo enters an interactive pause mode whenever an error condition occurs. This allows the user to inspect the values of local variables at the time of the error, which is useful for debugging.

Example

TO MYPROGRAM
  REPEAT 180 [RIGHT 2 IF 90=REPCOUNT [PAUSE]]
  PRINT "Done
END

MYPROGRAM
Pausing...MYPROGRAM

Enter SHOW HEADING in Pause Mode dialog box and hit OK.

180

Enter CONTINUE in Pause Box and hit OK.

Done


SourceForge.net Logo