Ver Mensaje Individual
  #1 (permalink)  
Antiguo 03/10/2003, 04:14
harryLine
 
Fecha de Ingreso: julio-2003
Mensajes: 97
Antigüedad: 21 años, 9 meses
Puntos: 0
If que no comprueba bien

Le llevo dando vueltas mucho tiempo y no lo consigo, a ver alguien sabe porque puede ser esto:

Cuando hago esta comprobación:

Código:
ces = 1
	DO UNTIL va.EOF
		If CInt(va("CCesta")) = ces then
			existe="si"
			EXIT DO
		else
			existe="no"
		end if
		va.MoveNext
	Loop
	If existe = "si" then
		Response.write("<a href='contenido.asp?cesta=28'><img border='0' src='imagenes/rojo.jpg'></a>")
	else
		Response.write("<img src='imagenes/gris.jpg'>")
	end if
Lo hace bien y me da una respusta correcta, pero si uso un bucle FOR para que compruebe del 1 al 100, da en todos que no cuando hay mucho que deberia dar si (la variable existe). lo hago así:

Código:
For ces = 1 to 100
	DO UNTIL va.EOF
		If CInt(va("CCesta")) = ces then
			existe="si"
			EXIT DO
		else
			existe="no"
		end if
		va.MoveNext
	Loop
	If existe = "si" then
		Response.write("<a href='contenido.asp?cesta=28'><img border='0' src='imagenes/rojo.jpg'></a>")
	else
		Response.write("<img src='imagenes/gris.jpg'>")
	end if
next
Es que no entiendo porque no me sale... he probado tb con while y nada, he escrito el resultado de ces en las 100 vueltas y lo hace bien, entonces, yo creo que falla el IF