MUMPS Functions $PIECE
From VistApedia
The $PIECE function returns a substring delimited by a specified string delimiter made up of one or more characters. In M, $PIECE() returns a logical field from a logical record.
$PIECE() provides a tool for efficiently using values that contain multiple elements or fields, each of which may be variable in length.
Example:
GTM> FOR i=0:1:3 WRITE !,$PIECE("1 2"," ",i),"<" < 1< 2< < GTM>
This loop displays the result of $PIECE(), specifying a space as a delimiter, a piece position "before," first and second, and "after" the string.
- From the GT.M Programmers Guide, Functions, $Piece().