swirl
Guide to OmniMark 9   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
  Related Topics   Other Library Functions  
function  

UTIL_SortSwitchesByKey

 
 

Library: Utilities (OMUTIL legacy)
Include: omutil.xin

Declaration

define function UTIL_SortSwitchesByKey
   modifiable switch switch-shelf 

Argument definitions

switch-shelf
is a keyed shelf of switches


Purpose

Use UTIL_SortSwitchesByKey to sort a shelf of switches by their keys in ascending order.

Requirements

You must include the following line at the beginning of your OmniMark program:

  include "omutil.xin"

switch-shelf must have a key for every switch (else OmniMark Error 6052)

Usage Notes

You may want to write a function to build your keyed switch shelf from your existing data.

Example


  include "omutil.xin"
  process
     local switch my-switch variable initial {true with key "a", 
                                              false with key "c",
                                              true with key "b"}
     UTIL_SortSwitchesByKey my-switch
     
     repeat over my-switch
       output "key " 
          || key of my-switch
          || "; item " 
       do when my-switch
          output "true"
       else
          output "false"
       done
       output "%n"
     again

    Related Topics
 
Other Library Functions
 
 

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

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

Copyright © Stilo International plc, 1988-2010.