action
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
Similarly:
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 { 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 output "Switch bar is true!%n" else output "Switch bar is false!%n" done ;Output: "Switch foo is false! ; Switch bar is true!"