Initial Checking with all 820 MLMs
This commit is contained in:
75
MLMStripper/bin/Debug/UTIL/UTIL_STRING_PARSE.mlm
Normal file
75
MLMStripper/bin/Debug/UTIL/UTIL_STRING_PARSE.mlm
Normal file
@@ -0,0 +1,75 @@
|
||||
maintenance:
|
||||
|
||||
title: String Parsing MLM ;;
|
||||
mlmname: UTIL_STRING_PARSE;;
|
||||
arden: version 2;;
|
||||
version: 1.00;;
|
||||
institution: Eclipsys Corporation;;
|
||||
author: ;;
|
||||
specialist: ;;
|
||||
date: 2006-04-07;;
|
||||
validation: testing;;
|
||||
|
||||
library:
|
||||
purpose:
|
||||
Takes a string and extract out all substrings delimited by a given character.
|
||||
Returns a list of sub-strings
|
||||
;;
|
||||
explanation:
|
||||
;;
|
||||
keywords:
|
||||
;;
|
||||
knowledge:
|
||||
type: data-driven;;
|
||||
data:
|
||||
( str,
|
||||
delimiter
|
||||
) := ARGUMENT;
|
||||
;;
|
||||
evoke: /* Call MLM */
|
||||
;;
|
||||
logic:
|
||||
|
||||
StringList := ();
|
||||
|
||||
if str IS NOT NULL then
|
||||
|
||||
if delimiter is NULL then
|
||||
delimiter := ","; // comma
|
||||
endif;
|
||||
|
||||
characterList := extract characters str;
|
||||
cnt := count (characterList);
|
||||
|
||||
indexList := 1 SEQTO cnt;
|
||||
|
||||
newList := ();
|
||||
newString := null;
|
||||
|
||||
for X in indexList do
|
||||
ch := characterList[X];
|
||||
|
||||
if ch = delimiter then
|
||||
newString := string( newList );
|
||||
StringList := StringList, newString;
|
||||
newString := null;
|
||||
newList := ();
|
||||
else
|
||||
newList := newList, ch;
|
||||
endif;
|
||||
enddo;
|
||||
|
||||
newString := string( newList );
|
||||
StringList := StringList, newString;
|
||||
|
||||
endif;
|
||||
|
||||
conclude true;
|
||||
;;
|
||||
action:
|
||||
|
||||
return StringList ;
|
||||
|
||||
;;
|
||||
Urgency: 50;;
|
||||
end:
|
||||
Reference in New Issue
Block a user