swirl Guide to OmniMark 5   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesOMX VariablesErrors
 
  Related Syntax   Related Concepts  
constant   true, false    

Purpose

True and false are Boolean values that you can use to set or test the value of switch variables:

  process
     local switch fred
     local switch barney variable initial-size 3 initial {true, false, true}
     set fred to true
     do when fred = true
        output "Switch fred is true!%n"
     else
        output "Switch fred is false!%n"
     done
     set barney[3] to false
     do when barney[3] = false
        output "Switch barney[3] is false!%n"
     else
        output "Switch barney[3] is true!%n"
     done
  ; Output: "Switch fred is true!
  ;          Switch barney[3] is false!"

Note that switch variables return a true or false value directly so that do when fred = true and do when fred do the same thing. Similarly, do when fred = false does the same thing as do unless fred.

While all switches default to false, you should explicitly set the value of all variables before using them. This makes your programs easier to read and helps avoid errors.

  Related Syntax
   activate, deactivate
   active
 
Related Concepts
   Switch data type
 
----  

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

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

Copyright © OmniMark Technologies Corporation, 1988-2000.