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

$EXTRACT

1990 Version of ANSI Standard

2.2.7.4 $Extract

$E[XTRACT] ( expr )

See 2.3 for the definition of expr.

This form returns the first (leftmost) character of the value of expr. If the value of expr is the empty string, the empty string is returned.

$E[XTRACT] ( expr , intexpr )

See 2.3 for the definition of expr. See 2.2.4.1 for the definition of intexpr.

Let s be the value of expr, and let m be the integer value of intexpr. $E(s,m) returns the mth character of s. If m is less than 1 or greater than $L(s), the value of $E is the empty string. (1 corresponds to the leftmost character of s; $L(s) corresponds to the rightmost character.)

$E[XTRACT] ( expr , intexpr1 , intexpr2 )

See 2.3 for the definition of expr. See 2.2.4.1 for the definition of intexpr.

Let n be the integer value of intexpr2. $E(s,m,n) returns the string between positions m and n of s. The following cases are defined:

  1. m > n.
    Then the value of $E is the empty string.
  2. m = n.
    $E(s,m,n) = $E(s,m).
  3. m < n '> $L(s).
    $E(s,m,n) = $E(s,m) concatenated with $E(s,m+1,n).
    That is, using the concatenation operator _ of 2.3.5, $E(s,m,n) = $E(s,m)_$E(s,m+1)_..._$E(s,m+(n-m)).
  4. m < n and $L(s) < n.
    $E(s,m,n) = $E(s,m,$L(s)).
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:08:30.

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