swirl
Guide to OmniMark 9   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
  Related Syntax    
action  

activate, deactivate

 
 

Syntax

activate (switch-name) indexer?

deactivate (switch-name) indexer?


Purpose

activate sets the value of a switch to true. deactivate sets the value of a switch to false. Thus:

  activate foo 
is 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
 
 
 

Top [ INDEX ] [ CONCEPTS ] [ TASKS ] [ SYNTAX ] [ LIBRARIES ] [ LEGACY LIBRARIES ] [ ERRORS ]

OmniMark 9.1.0 Documentation Generated: September 2, 2010 at 1:51:21 pm
If you have any comments about this section of the documentation, please use this form.

Copyright © Stilo International plc, 1988-2010.