Ver Mensaje Individual
  #12 (permalink)  
Antiguo 17/12/2006, 12:17
sqa212
 
Fecha de Ingreso: mayo-2003
Mensajes: 866
Antigüedad: 22 años
Puntos: 0
Re: Ayuda con Do while y crear variable

Yo lo haria de esta forma:

<%Sub ContenidoMatrizHorizontal(ByVal arrvar)
Dim counter1
Dim counter2
Response.Write("<table border=""1"" bordercolor=""green"">" & vbCrLf)
For counter1 = 0 to UBound(arrvar, 1)
Response.Write(" <tr>" & vbCrLf)
For counter2 = 0 to UBound(arrvar, 2)
Response.Write("<td>" & arrvar(counter1,counter2) & "</td>" & vbCrLf)
Next
Response.Write(" </tr>" & vbCrLf)
Next
Response.Write("</table>" & vbCrLf)
End Sub
%>


<%
aux=20
contador=1
j=0
dim matriz()
Do while contador < aux
if contador=1 Then
Redim matriz(aux,2)
end if

if contador<>1 Then
Redim Preserve matriz(aux,2)
end if

'Response.write ("<br>C" & contador & "=" & contador/5)
matriz(j,0) = "C"&contador
matriz(j,1) = cstr(contador/5)
contador= contador + 1
j=j+1
Loop

CALL ContenidoMatrizHorizontal (matriz)
'Response.End()

Response.write "<hr>"

nuevoaux=5
contador=1
p=0
Redim matriz(nuevoaux,2)
Do while contador < nuevoaux
p=contador-1
Redim Preserve matriz(nuevoaux,2)
'Response.write ("<br>C" & contador & "=" & contador/5)
matriz(p,0) = "C"&contador
matriz(p,1) = cstr(contador/5)
contador= contador + 1
p=p+1
Loop
CALL ContenidoMatrizHorizontal (matriz)
%>