replace comma with text, then loop
Posted on 2007-10-19
I have an ASP page that is pulling data from a SQL Server. The SQL server field is a list of codes separated by a comma.
str = AB, BC, DE
this string is of variable length
Dim i, str, end_str,
i = 1
str.value = "AB, BC, CD"
temp = mid(str.value, instr(str.value,",") + i, len(str.value))
end_str.value = end_str.value & replace(str.value, ",", "<a href='mypage.asp?code=" & temp & '</a>")
i = i + 1
Loop While i < len(str.value) + 1
What I would like to do is convert the list of codes to a link. I tried the code above but i don't seem to get what i need.