Button for 1977 Button for 1984 Button for 1990 Button for 1995 Button for MDC Button for notes Button for examples

$ORDER

1990 Version of ANSI Standard

2.2.7.11 $Order

$O[RDER] ( glvn )

See 2.2.2.2 for the definition of glvn.

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:

Let m and n be strings satisfying the definition of numeric data values (see 2.2.3.1), and u and v be nonempty strings which do not satisfy this definition. The following cases define the ordering sequence:

  1. CO("",s) = s.
  2. CO(m,n) = n if n > m; otherwise, CO(m,n) = m.
  3. CO(m,u) = u.
  4. CO(u,v) = v if v ] u; otherwise, CO(u,v) = u.

In words, all strings follow the empty string, numerics collate in numeric order, numerics precede nonnumeric strings, and nonnumeric strings are ordered by the conventional ASCII collating sequence.

Only subscripted forms of lvn and gvn are permitted. Let lvn or gvn be of the form Name(s1, s2, ..., sn) where sn may be the empty string. Let A be the set of subscripts that follow sn. That is, for all s in A:

  1. CO(sn,s) = s and
  2. $D(Name(s1, s2, ..., sn–1, s)) is not zero.

Then $O(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 which follow sn also follow t.

If no such t exists, $O returns the empty string.

Button for 1977 Button for 1984 Button for 1990 Button for 1995 Button for MDC Button for notes Button for examples

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.

This page most recently updated on 15-Nov-2023, 13:10:43.

For comments, contact Ed de Moel (demoel@jacquardsystems.com)