| |||||||||
Technical Support On-Line Manuals Ax51 User's Guide | MATCH FunctionThe MATCH MPL function searches a character string for a delimiter character and assigns the substrings on either side of the delimiter to specified identifiers. The syntax for the MATCH function is: %MATCH (id1 delimiter id2) (balanced-text) Where
The MATCH function searches balanced-text for the specified delimiter. When the delimiter is found, all characters to the left are assigned to id1 and all characters to the right are assigned to id2. If the delimiter is not found, the entire balanced-text string is assigned to id1 and the null string is assigned to id2. Source Text
%DEFINE (text) (-1,-2,-3,-4,-5)
%MATCH (next,list) (%text)
%WHILE (%LEN (%next) NE 0)
( MOV A,#%next
MOV @R1,A %MATCH
INC R1
(next,list)(%list)
)
Output Text MOV A,#-1 MOV @R1,A INC R1 MOV A,#-2 MOV @R1,A INC R1 MOV A,#-3 MOV @R1,A INC R1 MOV A,#-4 MOV @R1,A INC R1 MOV A,#-5 MOV @R1,A INC R1 | ||||||||
| |||||||||