dim list, a
list = "100,200,300,1100,400"
a = Array("100","400","300")
Response.Write "OUTPUT: " & GetExcludedValues(a, list)
function GetExcludedValues(ByRef av_array, ByVal as_List)
dim x
dim y
dim lv_arrTmp
dim ls_Exitcode
dim lb_MatchFound
if not isArray(av_array) then
GetExcludedValues = ""
exit function
end if
lv_arrTmp = split(as_List, ",")
for x = 0 to ubound(lv_arrTmp)
lb_MatchFound = false
for y = 0 to ubound(av_array)
if lv_arrTmp(x) = av_array(y) then
'---we have a match...don't capture value
lb_MatchFound = true
end if
next
if not lb_MatchFound then ls_Exitcode = ls_Exitcode & lv_arrTmp(x) & ","
next
'---if we have any elements that qualify, we will
' need to strip the trailing comma
if len(trim(ls_Exitcode)) > 0 then ls_Exitcode = left(ls_Exitcode, len(ls_Exitcode) - 1)
GetExcludedValues = ls_Exitcode
end function