Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP General (http://www.velocityreviews.com/forums/f65-asp-general.html)
-   -   What logic? (http://www.velocityreviews.com/forums/t804403-what-logic.html)

 Paulo 08-11-2008 07:48 PM

What logic?

Can you help building it?

Dim Desc(50)
Desc(1) = "Tela1"
Desc(2) = "Tela2"
Desc(3) = "Tela3"
Desc(4) = "Tela4"
....
....
etc

Supose I have a total of 13 records: Desc(13) = "Tela13", how do I list it
below using 4 columns per lines on asp?

<table border="0">
<% Here will be some ForLoop for <tr> %>
<tr>
<% Here will be some ForLoop for <td> %>
<td>Desc(1)</td><td>Desc(2)</td><td>Desc(3)</td><td>Desc(4)</td>
</tr>
<tr>
<td>Desc(5)</td><td>Desc(6)</td><td>Desc(7)</td><td>Desc(8)</td>
</tr>
... ... ...
</table>

Can you help me on logic/math loop ?

Many thanks

 Bob Barrows [MVP] 08-11-2008 08:39 PM

Re: What logic?

Basically, it's

for i = 1 to ubound(desc) step 4
response.write "<tr>"
for j = 0 to 3
response.write "<td>"
if not i+j > ubound(desc) then
response.write desc(i + j)
end if
response.write "</td>"
next
response.write "</tr>"
next

Paulo wrote:
> Can you help building it?
>
> Dim Desc(50)
> Desc(1) = "Tela1"
> Desc(2) = "Tela2"
> Desc(3) = "Tela3"
> Desc(4) = "Tela4"
> ...
> ...
> etc
>
> Supose I have a total of 13 records: Desc(13) = "Tela13", how do I
> list it below using 4 columns per lines on asp?
>
> <table border="0">
> <% Here will be some ForLoop for <tr> %>
> <tr>
> <% Here will be some ForLoop for <td> %>
> <td>Desc(1)</td><td>Desc(2)</td><td>Desc(3)</td><td>Desc(4)</td>
> </tr>
> <tr>
> <td>Desc(5)</td><td>Desc(6)</td><td>Desc(7)</td><td>Desc(8)</td>
> </tr>
> ... ... ...
> </table>
>
> Can you help me on logic/math loop ?
>
> Many thanks

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

 All times are GMT. The time now is 06:30 PM.