473,402 Members | 2,061 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

ASP looping

Hi guys,

I have a database with many fields. One of this field is of type memo
which contains some bullet points seperated by # sign (something along
those lines). What I have is this code which gives me a table with one
row and as many columns in the split array.

************************************************** **********************

<table width="200" border="0">
<% MyStringTerm = rs.Fields("bullet")
if MyStringTerm <> "" Then
MyStringArray = Split (MyStringTerm, "#")
Response.Write "<tr>"
For Each Term In MyStringArray
Response.Write "<td><img width='13' height='13'
src='images/check.gif'></td><td>"
Response.Write Term
Response.Write "</td>"
Next
Response.Write "</tr>"
Else
Response.Write rs.Fields.Item("Bullet").Value
End if%>
</table>

************************************************** **********************

What I want is to change the code so that instead of getting
everything in one row the items are split into a table with 6 columns
and as many rows as required by the data being passed. Each row will
look something like this.
Image --- Data --- Image --- Data --- Image --- Data

Is this possible? The images are going to be the same for the most
part. I am not very good with asp but have to get this to work.
Any help would be appreciated
Thanks in advance
Deep
Jul 19 '05 #1
2 1810
I would put a counter in and whenever it hits 6, reset it and start over.
for example:
************************************************** **********************

<table width="200" border="0">
<% Dim iColCount
iColCount = 1 MyStringTerm = rs.Fields("bullet")
if MyStringTerm <> "" Then
MyStringArray = Split (MyStringTerm, "#")
Response.Write "<tr>"
For Each Term In MyStringArray
Response.Write "<td><img width='13' height='13'
src='images/check.gif'></td><td>"
Response.Write Term
Response.Write "</td>" if iColCount = 6 then
response.write "</tr><tr>"
iColCount = 1
end if Next
Response.Write "</tr>"
Else
Response.Write rs.Fields.Item("Bullet").Value
End if%>
</table>

************************************************** **********************
Mike
"Deepiceman" <de********@yahoo.com> wrote in message
news:f0*************************@posting.google.co m... Hi guys,

I have a database with many fields. One of this field is of type memo
which contains some bullet points seperated by # sign (something along
those lines). What I have is this code which gives me a table with one
row and as many columns in the split array.

************************************************** **********************

<table width="200" border="0">
<% MyStringTerm = rs.Fields("bullet")
if MyStringTerm <> "" Then
MyStringArray = Split (MyStringTerm, "#")
Response.Write "<tr>"
For Each Term In MyStringArray
Response.Write "<td><img width='13' height='13'
src='images/check.gif'></td><td>"
Response.Write Term
Response.Write "</td>"
Next
Response.Write "</tr>"
Else
Response.Write rs.Fields.Item("Bullet").Value
End if%>
</table>

************************************************** **********************

What I want is to change the code so that instead of getting
everything in one row the items are split into a table with 6 columns
and as many rows as required by the data being passed. Each row will
look something like this.
Image --- Data --- Image --- Data --- Image --- Data

Is this possible? The images are going to be the same for the most
part. I am not very good with asp but have to get this to work.
Any help would be appreciated
Thanks in advance
Deep

Jul 19 '05 #2
Thanks a lot lord, added a counter and it works like a charm.

"Lord Unspecified" <lo*************@adelphia.net> wrote in message news:<Nv*******************@news1.news.adelphia.ne t>...
I would put a counter in and whenever it hits 6, reset it and start over.
for example:
************************************************** **********************

<table width="200" border="0">
<%

Dim iColCount
iColCount = 1
MyStringTerm = rs.Fields("bullet")
if MyStringTerm <> "" Then
MyStringArray = Split (MyStringTerm, "#")
Response.Write "<tr>"
For Each Term In MyStringArray
Response.Write "<td><img width='13' height='13'
src='images/check.gif'></td><td>"
Response.Write Term
Response.Write "</td>"

if iColCount = 6 then
response.write "</tr><tr>"
iColCount = 1
end if
Next
Response.Write "</tr>"
Else
Response.Write rs.Fields.Item("Bullet").Value
End if%>
</table>

************************************************** **********************


Mike
"Deepiceman" <de********@yahoo.com> wrote in message
news:f0*************************@posting.google.co m...
Hi guys,

I have a database with many fields. One of this field is of type memo
which contains some bullet points seperated by # sign (something along
those lines). What I have is this code which gives me a table with one
row and as many columns in the split array.

************************************************** **********************

<table width="200" border="0">
<% MyStringTerm = rs.Fields("bullet")
if MyStringTerm <> "" Then
MyStringArray = Split (MyStringTerm, "#")
Response.Write "<tr>"
For Each Term In MyStringArray
Response.Write "<td><img width='13' height='13'
src='images/check.gif'></td><td>"
Response.Write Term
Response.Write "</td>"
Next
Response.Write "</tr>"
Else
Response.Write rs.Fields.Item("Bullet").Value
End if%>
</table>

************************************************** **********************

What I want is to change the code so that instead of getting
everything in one row the items are split into a table with 6 columns
and as many rows as required by the data being passed. Each row will
look something like this.
Image --- Data --- Image --- Data --- Image --- Data

Is this possible? The images are going to be the same for the most
part. I am not very good with asp but have to get this to work.
Any help would be appreciated
Thanks in advance
Deep

Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: kaptain kernel | last post by:
i've got a while loop thats iterating through a text file and pumping the contents into a database. the file is quite large (over 150mb). the looping causes my CPU load to race up to 100 per...
2
by: ensnare | last post by:
Hi all, I'm using a database session handler and am looking to loop through data residing in the sessions table to make a 'Users online' array. I've found that using urldecode on the data...
2
by: Ivo | last post by:
Hi, I have an audio file (.mid or .wav or .mp3) in an object element: <object id="snd" classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"...
45
by: Trevor Best | last post by:
I did a test once using a looping variable, first dimmed as Integer, then as Long. I found the Integer was quicker at looping. I knew this to be true back in the 16 bit days where the CPU's (80286)...
5
by: masood.iqbal | last post by:
My simplistic mind tells me that having local variables within looping constructs is a bad idea. The reason is that these variables are created during the beginning of an iteration and deleted at...
1
by: Diva | last post by:
Hi, I have a data grid in my application. It has 20 rows and I have set the page size as 5. I have a Submit button on my form and when I click on Submit, I need to loop through the rows in the...
5
by: johnb41 | last post by:
I need to loop through a bunch of textbox controls on my form. The order of the loop is very important. For example, the top one must be read first, then the one below it, etc. My first...
0
by: anthon | last post by:
Hi all - first post! anywho; I need to create a function for speeding up and down a looping clip. imagine a rotating object, triggered by an action, and slowly decreasing in speed, till it...
20
by: Ifoel | last post by:
Hi all, Sorry im beginer in vb. I want making programm looping character or number. Just say i have numbers from 100 to 10000. just sample: Private Sub Timer1_Timer() if check1.value= 1...
2
by: Davaa | last post by:
Dear all, I am a student making a MS Form application in C++. I would ask a question about "Timer". Sample code which I am developing is below. private: System::Void...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.