O ideal seria voce igualar as virgulas (por uma no final) para que a busca atingisse até o ultimo valor
If InStr(1, variavel & ",", "2,") > 0 Then
*Ops, melhor ainda.
sem querer ser chato ....
mas e no caso de
variavel = 1,12,9?
isto é:
"2," existe em "12," porem é <> de 2
he..he..he..
Bem, analise á minha lógica (se é que pode se chamar assim....rs)
variavel = 0
for each valor in request.form("menu")
if len(valor) = 1 then
if InStr(1, valor&",","2,") > 0 then
variavel = variavel+1
end if
end if
next
if variavel > 0 then response.write "sim ele existe"
opa, diminuindo o codigo!
variavel = 0
for each valor in request.form("menu")
if len(valor) = 1 and InStr(1, valor&",","2,") > 0 then
variavel = variavel+1
end if
next
if variavel > 0 then response.write "sim ele existe"
Pois bem, resolví meu problema, mas esta é a melhor forma na sua opinião?
[]´s!