☜ | $%PRODUCE^STRINGDraft MDC Standard | ☞ |
PRODUCE^STRING : STRING ( IN : STRING , .SPEC , MAX : INTEGER : O )
$%PRODUCE^STRING returns a copy of IN transformed by repeated prioritized substring replacement. For each element e in order by e’s collation sequence, let find be the value of SPEC(e,1) and let out be the value of SPEC(e,2). The function will scan IN for occurrences of the substring find. For each occurrence of find found in IN, whether or not any of the characters in the substring have already been replaced, the matching substring in IN is replaced with out. Processing of each substring is complete when no more occurrences of that substring can be found in IN; when all of the substrings in SPEC have been processed in order, the scanning and replacement begins again with the first e in SPEC; only when none of the substrings can be found is the resulting string is returned. The optional parameter MAX sets a maximum number of replacements $%PRODUCE^STRING will make before ending processing and returning the result.
Click here for $%PRODUCE^STRING sample code.
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, 13:16:25.
For comments, contact Ed de Moel (demoel@jacquardsystems.com)