|
||||||||||
|
|
||||||||||
| Related Syntax | Other Library Functions | |||||||||
| function | UTIL_SortSwitchesByKey |
Available in:
Professional Enterprise |
|
Library: omutil - miscellaneous system utilities
Include: omutil.xin |
define function UTIL_SortSwitchesByKey
modifiable switch switch-shelf
where
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
| ---- |