Link to home
Start Free TrialLog in
Avatar of Wayne Barron
Wayne BarronFlag for United States of America

asked on

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
ASKER CERTIFIED SOLUTION
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Wayne Barron

ASKER

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