☜ | $ORDERDraft MDC Standard | ☞ |
This form returns a value which is a subscript according to a subscript ordering sequence. This ordering sequence is specified below with the aid of a function, CO, which is used for definitional purposes only, to establish the collating sequence.
CO(s,t) is defined, for strings s and t, as follows:
When t follows s in the ordering sequence or if s is the empty string, CO(s,t) returns t.
Otherwise, CO(s,t) returns s.
The ordering sequence is defined using the collation algorithm determined as follows:
The collation value order of a string subscript using a collation algorithm collate may be determined by executing the expression ("S order="_collate_"(subscript)"). Two collation values are compared on a character-by-character basis using the $ASCII values (i.e. equivalent to the follows (]) operator).
Only subscripted forms of glvn are permitted. Let glvn be of the form NAME(s1, s2, ..., sn) where sn may be the empty string. Let A be the set of subscripts such that, s is in A if and only if:
Then $Order(NAME(s1, s2, ..., sn)) returns that value t in A such that CO(t,s) = s for all s not equal to t; that is, all other subscripts in A which follow sn also follow t.
If no such t exists, $Order returns the empty string.
Let S be the value of expr. Then $Order(glvn,expr) returns:
If S = –1, the function returns a value which is a subscript, according to a subscript ordering sequence. This ordering sequence is specified below with the aid of functions CO and CP, which are used for definitional purposes only, to establish the collating sequence.
CO(s,t ) is defined, for strings s and t, according to the collation algorithm of the specific charset.
CP(s,t ) is defined, for strings s and t, as follows:
When t follows s in the ordering sequence and
s is not the empty string, CP(s,t ) returns
s.
Otherwise, CP(s,t ) returns t.
The following cases define the ordering sequence for CP:
Only subscripted forms of glvn are permitted. Let glvn be of the form NAME(s1, s2, ..., sn ) where sn may be the empty string. Let A be the set of subscripts such that, s is in A if and only if:
Then $Order(NAME(s1, s2, ..., sn ), 1) returns that value t in A such that CP(t,s) = t for all s not equal to t; that is, all other subscripts in A which precede s also precede t.
If no such t exists, $Order(NAME(s1, s2, ..., sn ), 1) returns the empty string.
Copyright © Standard Documents; 1977-2024 MUMPS Development Committee;
Copyright © Examples: 1995-2024 Ed de Moel;
Copyright © Annotations: 2003-2008 Jacquard Systems Research
Copyright © Annotations: 2008-2024 Ed de Moel.
Some specifications are "approved for inclusion in a future standard". Note that the MUMPS Development Committee cannot guarantee that such future standards will indeed be published.
This page most recently updated on 15-Nov-2023, 13:10:43.
For comments, contact Ed de Moel (demoel@jacquardsystems.com)