swirl Guide to OmniMark 5   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesOMX VariablesErrors
 
  Related Syntax    
action   activate, deactivate    

Syntax

  activate (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
   true, false
 
 
----

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

Generated: August 11, 2000 at 3:06:57 pm
If you have any comments about this section of the documentation, send email to docerrors@omnimark.com

Copyright © OmniMark Technologies Corporation, 1988-2000.