6.2 Mode Handling Declarations

The ON and OFF declarations are available to the user for controlling various system options. Each option is represented by a switch name. ON and OFF take a list of switch names as argument and turn them on and off respectively, e.g.,

       on time;

causes the system to print a message after each command giving the elapsed CPU time since the last command, or since TIME was last turned off, or the session began. Another useful switch with interactive use is DEMO, which causes the system to pause after each command in a file (with the exception of comments) until a Return is typed on the terminal. This enables a user to set up a demonstration file and step through it command by command.

As with most declarations, arguments to ON and OFF may be strung together separated by commas. For example,

        off time,demo;

will turn off both the time messages and the demonstration switch.

We note here that while most ON and OFF commands are obeyed almost instantaneously, some trigger time-consuming actions such as reading in necessary modules from secondary storage.

A diagnostic message is printed if ON or OFF are used with a switch that is not known to the system. For example, if you misspell DEMO and type

     on demq;

you will get the message

        ***** DEMQ not defined as switch.