☜ | $DEXTRACTDraft MDC Standard | ☞ |
$DE[XTRACT] ( [ initialrecordvalue ] , extracttemplate , L [ recordfieldvalue ] )
initialrecordvalue | ::= | expr |
extracttemplate | ::= | expr | V | extractfields |
extractfields | ::= | L | │ | [ - ] | fieldwidth | : [ fieldindex ] | │ |
fieldwidth | ::= | intlit |
fieldindex | ::= | intlit |
recordfieldvalue | ::= | expr | [ " fieldindex ] |
This function assembles the exprs of the recordfieldvalue into a single value. The value of the initialrecordvalue is used as the starting value to which the recordfieldvalues are applied. If initialrecordvalue is omitted, the empty string is used.
The extracttemplate specifies the $Extract partitioning (fieldwidths and alignments) of initialrecordvalue into consecutive fields. Unsigned values specify width for left-justified fields. Negative values specify width (absolute value of fieldwidth) for right-justified fields. The fieldindex specifies the relative field number. If omitted, it defaults to the next successive value. For omitted recordfieldvalues the corresponding field is obtained from the initialrecordvalue. Although all elements of the list of recordfieldvalues are optional, at least one recordfieldvalue (not necessarily the first) in the list must be non-empty.
Left-justified fields are padded on the right with $Char(32) or truncated on the right as needed. Right-justified fields are padded on the left with $Char(32) or truncated on the left as needed.
Assignment to fields proceeds in a left-to-right fashion. If a field is referenced multiple times, the rightmost value is the final value of the field.
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.
Some specifications are "approved for inclusion in a future standard". Note that the MUMPS Development Committee cannot guarantee that such future standards will indeed be published.
This page most recently updated on 15-Nov-2023, 10:46:50.
For comments, contact Ed de Moel (demoel@jacquardsystems.com)