If you have a defined delimiter, then you should ratehr use the SPLIT function, e.g.
code:
$exclude='tom,mary,sally,peter'
$exclude=split($exclude,',')
if ascan($exclude,$name)+1
;name is in exclude list
endif
; or
if ascan($exclude,$name)=-1
;name is not in exclude list
endif

_________________________
There are two types of vessels, submarines and targets.