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

$EXTRACT

1977 Version of ANSI Standard

3.2.8 Functions function

$E[XTRACT]( expr1 , intexpr2 )

returns the intexpr2th character of the value of expr1. That is, let m be the value of intexpr2. If m is less than 1 or greater than $L(expr1), the value of $E is the empty string. Otherwise, the value of $E is the mth character of the value of expr1. (1 corresponds to the leftmost character; $L(expr1) corresponds to the rightmost character.)

$E[XTRACT]( expr1 , intexpr2 , intexpr3 )

returns the string between positions intexpr2 and intexpr3 of the value of expr1. Let m be the value of intexpr2 and let n be the value of intexpr3. The following cases are defined:

  1. m > n. Then the value of $E is the empty string.
  2. m = n. $E(expr1,m,n) = $E(expr1,m).
  3. m < n < $L(expr1). $E(expr1,m,n) = $E(expr1,m) concatenated with $E(expr1,m+l,n).
  4. m < n and $L(expr1) < n. $E(expr1,m,n) = $E(expr1,m,$L(expr1)).

See also the transition diagram for $Extract.

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)