Tema: GetRows
Ver Mensaje Individual
  #3 (permalink)  
Antiguo 17/07/2002, 11:47
eduvivi
 
Fecha de Ingreso: enero-2002
Mensajes: 349
Antigüedad: 23 años, 4 meses
Puntos: 1
Re: GetRows

Response.Write("Página " & iPag & " de " & iPaginas & " (" & iTotal & " registros)<br>")
'Calculo el índice donde comienzo:
iComienzo = (iPag-1)*iRegsPorPag
'y donde termino:
iFin = iComienzo + (iRegsPorPag-1)
'Si no tengo suficientes registros restantes,
'voy hasta el final
if iFin > UBound(vector, 2) then
iFin = UBound(vector, 2)
end if
'Pinto la tabla
Response.Write("<TABLE BORDER=""1"">")
for I= iComienzo to iFin
Response.Write("<TR>")
for J=0 to UBound(vector,1)
Response.Write("<TD>" & vector(J,I) & "</TD>")

next
next
Response.Write("</TABLE>")

'Imprimo enlaces, si son necesarios
if iPag > 1 then
Response.Write("<A HREF=""vermedicos.asp?P="&iPag-1&""">Anterior</A>  ")
end if
if iPag < iPaginas then
Response.Write("<A HREF=""vermedicos.asp?P="&iPag+ 1&""">Siguiente</A> ")
end if

PaginarGR = 0

End Function
'================================================= ====================================
Function Tabla ( vector )
Response.Write("<TABLE BORDER=""1"">")
for J=0 to Ubound(vector, 2)
Response.Write("<TR>")
for I=0 to UBound(vector, 1)
Response.Write("<TD>"&vector(I ,J)&"</TD>")
next
Response.Write("</TR>")
next
Response.Write("</TABLE>")
Tabla = UBound(vector, 2) + 1
End Function 'Tabla

%>

Gracias de antemano