PING
0.9
Statistical data handling and processing in production environment
|
Compare two lists of comma-separated and quote-enhanced items, i.e check whether the items in one list differ from those in another not taking into account any order or repetition(s).
clist1, clist2
: two lists of items comma-separated by a delimiter (e.g., quotes) and in between parentheses;casense
: (option) boolean flag (yes/no
) set to perform cases sensitive search/matching; default: casense=no
, i.e. the upper-case elements in both lists are matched;mark, sep
: (option) characters/strings used respectively as a "quote" and a separator in the input list; default: mark=
str(%"), and" sep=%quote(,)
, i.e. the input clist1
and clist2
are both comma-separated lists of quote-enhanced items; see %clist_unquote for further details.ans
: the boolean result of the comparison test, i.e.:
0
when both lists are equal: list1 = list2
,-1
when clist1
items are all included in clist2
(but the opposite does not stand): say it otherwise: list1 < list2
,1
when clist2
items are all included in clist1
(but the opposite does not stand): say it otherwise: list1 > list2
,ans=
) when they differ. returns ans=0
, while:
returns ans=1
.
Run macro %_example_clist_compare
for more examples.
The macro will not return exactly what you want if the symbol $
appears somewhere in the list. If you need to use $
, you can reset the global macro variable G_PING_UNLIKELY_CHAR
(see _setup_
file) to another dumb (unlikely) character of your own.