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

String Relations

1977 Version of ANSI Standard

3.3.2.2 String Relations

The relations = ] [ do not imply any numeric interpretation of either of their operands.

The relation = tests string identity. If the operands are not known to be numeric and numeric equality is to be tested, the programmer may apply an appropriate unary operator to the nonnumeric operands. If both arguments are known to be in numeric form (as would be the case, for example, if they resulted from the application of any operator except _), application of a unary operator is not necessary. The uniqueness of the numeric representation guarantees the equivalence of string and numeric equality when both operands are numeric. Note, however, that the division operator / may produce inexact results, with the usual problems attendant to inexact arithmetic.

The relation [ is called "contains". A [ B is true if and only if B is a substring of A; that is, A [ B has the same value as ''$F(A,B). Note that the empty string is a substring of every string.

The relation ] is called "follows". A ] B is true if and only if A follows B in the conventional ASCII collating sequence, defined here. A follows B if and only if any of the following is true.

  1. B is empty and A is not.
  2. Neither A nor B is empty, and the leftmost character of A follows (i.e., has a numerically greater ASCII code than) the leftmost character of B.
  3. There exists a positive integer n such that A and B have identical heads of length n, (i.e., $E(A,l,n) = $E(B,l,n)) and the remainder of A follows the remainder of B (i.e., $E(A,n+l,$L(A)) follows $E(B,n+l,$L(B))).
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:18:01.

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