Toggle command

From m204wiki
Jump to navigation Jump to search
Action:

Reverses the state ("True" or "False") of a macro variable. If the variable value is 0 or a zero length (null) string, or if it is undefined, its state is considered to be False. For all other values, its state is considered to be True.

The toggle command sets to 0 ("toggles to False") a variable whose state is True. And it sets to 1 ("toggles to True") a variable whose state is False.

Syntax:

toggle &var[msg_string]

where:

  • &var is a macro variable that may or may not already exist.
  • msg_string is an optional message string, useful for constructing a  message to report what was toggled.
If msg_string is specified, either of the following is displayed in the Status bar after the toggle:
"msg_string is on " (if toggled on)
"msg_string is off " (if toggled off)

Example:

# toggle history

toggle &historyWanted Auto History 

Client menu: --
Introduced: Build 37