function
Library: Utilities (OMUTIL legacy)
Include: omutil.xin |
define function UTIL_SortSwitchesByKey modifiable switch switch-shelf
Argument definitions
Use UTIL_SortSwitchesByKey to sort a shelf of switches by their keys in ascending order.
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)
You may want to write a function to build your keyed switch shelf from your existing data.
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