☜ | $NEXT1990 Version of ANSI Standard | ☞ |
See 2.2.2.2 for the definition of glvn.
This form is included for backward compatibility. The use of the $Order function is strongly encouraged in place of $Next, as the two functions perform the same operation except for the different starting and ending condition of $Next.
$N 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:
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). If sn is –1, let A be the set of all subscripts. If sn is not –1, let A be the set of all subscripts that follow sn; that is, for all s in A:
Then $N(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, –1 is returned.
Note that $N will return ambiguous results for lvn and gvn arrays which have negative numeric subscript values.
1. $Next may not be included in the next version of the X11 MUMPS Standard.
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 13-Sep-2014, 08:49:16.
For comments, contact Ed de Moel (demoel@jacquardsystems.com)