Foros del Web » Programando para Internet » ASP Clásico »

Como terminar el do while

Estas en el tema de Como terminar el do while en el foro de ASP Clásico en Foros del Web. Como termino el do while si se cumple una condicion, por ej: n = 0 x = 0 do while not (rs.eof)%> <td VALIGN="top"><b><%=rs("Nombre")%></b><br> <%=rs("apellido")%> ...
  #1 (permalink)  
Antiguo 10/04/2003, 17:08
 
Fecha de Ingreso: marzo-2003
Ubicación: Santiago, Chile
Mensajes: 17
Antigüedad: 21 años, 2 meses
Puntos: 0
Como terminar el do while

Como termino el do while si se cumple una condicion, por ej:

n = 0
x = 0
do while not (rs.eof)%>
<td VALIGN="top"><b><%=rs("Nombre")%></b><br>
<%=rs("apellido")%>
</td>
<%n = n + 1
x = x + 1
if n = 2 then%>
<tr>
<%n = 0
end if
if x >= 4 then
while end
end if
rs.movenext
loop%>

Quiero que cuando X sea mayor igual a 4 se salga del Do While, probe con el while end, pero no me resulta, me podrian decir por favor, muchas graciassss!!!



__________________
mefisto nom diegme!!
  #2 (permalink)  
Antiguo 10/04/2003, 17:13
Avatar de Fr@Nc3$c0  
Fecha de Ingreso: abril-2002
Ubicación: Barcelona (Spain)
Mensajes: 710
Antigüedad: 22 años, 2 meses
Puntos: 1
Hola, prueba con éste código que te he modificado compañer@:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<%
n = 0
x = 0
do while not RS.eof
%>
<td VALIGN="top"><b><%=rs("Nombre")%></b><br>
<%=RS("apellido")%>
</td>
<%
n = n + 1
x = x + 1
if n = 2 then
%>
<tr>
<%n = 0
end if
if x >= 4 then
EXIT DO
end if
RS.movenext
loop%>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Para cortar un "DO WHILE" o "WHILE" por lo sano como quieres es:

EXIT DO


Dime que tal!

Suerte y Salu2!
  #3 (permalink)  
Antiguo 10/04/2003, 17:20
 
Fecha de Ingreso: marzo-2003
Ubicación: Santiago, Chile
Mensajes: 17
Antigüedad: 21 años, 2 meses
Puntos: 0
A la perfeccion!!!!

me funciona muy bien, muchas gracias Fr@Nc3c0.






__________________
mefisto nom diegme!!
  #4 (permalink)  
Antiguo 10/04/2003, 17:23
Avatar de Fr@Nc3$c0  
Fecha de Ingreso: abril-2002
Ubicación: Barcelona (Spain)
Mensajes: 710
Antigüedad: 22 años, 2 meses
Puntos: 1
De nada Ogre .

Para eso estamos...

¡¡Salu2!!
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 01:12.