proc main string sData ;String containing the data to search string sSearch ;String containing the possible strings we are looking for sData = "Tom" sSearch = "Tom,Dick,Harry" if mstrfind(sData, sSearch, ",", 3) usermsg "Match found!" else usermsg "No matches!" endif endproc func mstrfind : integer param string sData ;Passed string containing the data to search param string sSearch ;Passed string containing the list of strings we are looking for param string sTok ;Passed string containing the delimiter of sSearch param integer iNum ;Passed integer containing number of elements in sSearch string sTemp ;String for temporary processing integer iLoop ;Loop variable integer iResult = 0 ;Result to return, 1 indicates one of the possible strings was found ;0 indicates that none of the strings we were looking for were present for iLoop = 1 upto iNum strtok sTemp sSearch sTok ;Get first element to search for in sSearch if strfind sData sTemp ;If the substring was found... iResult = 1 ;Set iResult to one to indicate a match was found exitfor ;Exit the for loop endif endfor return iResult ;Return result to caller endfunc