Splitting multiple values from two different records from a database

Hello, all.
(ASP Classic)

Splitting strings, in my case, I have multiple values coming from the database.

a = 94/95
b = value1/value2

Open in new window


Now, on the page, it will be.

<a href="?Type=Label&LabelID=<%=x%>" title="<%=y%>"><%=y%></a>

Open in new window


I can use a split, to get the values broken up.
However, since we are dealing with 2 different values coming in, I cannot use the split and it duplicates everything.

<%
a = split(LabelID,"/")
b = split(LName,"/")
for each x in a
for each y in b
'response.Write (x & "<br />")
%>
<a href="?Type=Label&LabelID=<%=x%>" title="<%=y%>"><%=y%></a>
<%
next
next
%>

Open in new window


So, my question is this.
How can I split it properly, to where it is only a single code that split both values?

Wayne
LVL 31
Wayne BarronAuthor, Web DeveloperAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ryan ChongSoftware Team Lead, ex-Business Systems Analyst , ex-Senior Application EngineerCommented:
try use the for loop instead? and asumming both variables can split evenly...

something like:

LabelID = "94/95"
LName = "value1/value2"

a = split(LabelID,"/")
b = split(LName,"/")

for i = 0 to ubound(a)
    tmp = "<a href=""?Type=Label&LabelID="& a(i) &""" title="""& b(i) &""">"& b(i) &"</a>"
    response.write tmp
next

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Wayne BarronAuthor, Web DeveloperAuthor Commented:
thank you so much.
that did it.
except I use it like so.
the I
gave an illegal operation. which tendsa to happen from time to time.
<%
a = split(LabelID,"/")
b = split(LName,"/")
for j = 0 to ubound(a)
%>
<a href="?Type=Label&LabelID=<%=a(j)%>" title="<%=b(j)%>"><%=b(j)%></a>
<%
next
%>

Open in new window

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP

From novice to tech pro — start learning today.