|
|||||
|
|||||
Related Syntax | |||||
action |
activate, deactivate |
Syntax
activate (switch-name) indexer? deactivate (switch-name) indexer?
activate
sets the value of a switch to true. deactivate
sets the value of a switch to false. Thus:
activate foois equivalent to
set foo to true
For shelves:
deactivate bar[3]is equivalent to
set bar[3] to false
Putting these fragments together to make a program, you can run the following:
process local switch foo local switch bar variable initial-size 3 initial {true, false, true} activate foo set foo to false do when foo = true output "Switch foo is true!%n" else output "Switch foo is false!%n" done deactivate bar[3] set bar[3] to true do when bar = true output "Switch bar is true!%n" else output "Switch bar is false!%n" done ;Output: "Switch foo is false! ; Switch bar is true!"
Obviously, activate
and deactivate
cannot be used when the switch value is calculated, so setting values to true or false is more generally useful. You can, however, use activate
and deactivate
to set several values at once:
activate tom and dick and harry
Related Syntax true, false |