swirl
Guide to OmniMark 8   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
Prerequisite Concepts     Related Syntax  

Switch data type

You can use the switch data type to store and manipulate Boolean values. The value of a switch can be used anywhere a test expression is permitted.

Switches are automatically initialized to false when they are created. You should explicitly initialize switch variables before using them. Forgetting to initialize (or re-initialize) variables is a frequent source of errors.

You can initialize a switch when you declare it:

  local switch is-special-case initial {false}

You can set the value of a switch variable to a Boolean constant (true or false) or to the value of a switch expression:

  set is-special-case to true
  set is-special-case to quantity > 50 or quantity < 0

You can use the following operators with switch variables:

Prerequisite Concepts
   Variables and Constants
 
  Related Syntax
   global, local, constant, field
   true, false
 
 

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

OmniMark 8.2.0 Documentation Generated: March 13, 2008 at 3:25:49 pm
If you have any comments about this section of the documentation, please use this form.

Copyright © Stilo International plc, 1988-2008.