Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

ASP/VBS Repeat Region with a split

LEGEND ,
Jul 28, 2006 Jul 28, 2006
Hi,

Not sure if this is possible, I have a memofield that contains a data string
(e.g. name1, name2, name3, name4 .... name 30) I would like to represent the
data in a table so that each name is on a different row eg

Name1
Name2
Name3
Name4

etc

Name30

Is this possible ?

Thanks,



TOPICS
Server side applications
233
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 31, 2006 Jul 31, 2006
LATEST
Sure. The usual method would be to split the string into an array and loop.
<%
myValues = Split(myMemoField,",")
%>
<table>
<%
For Each Value In myValues
%>
<tr>
<td><%=Value%></td>
</tr>
<%
Next
%>
</table>

You can accomplish the same without looping, though.
<%
MyTable = Replace(myMemoField,",","</td></tr><tr><td>")
%>
<table>
<tr>
<td><%=MyTable</td>
</tr>
</table>

Obviously, the second method has better performance. Either way.

"Sanj" <webuser@mm.com> wrote in message
news:eaeh10$nod$1@forums.macromedia.com...
> Hi,
>
> Not sure if this is possible, I have a memofield that contains a data
> string (e.g. name1, name2, name3, name4 .... name 30) I would like to
> represent the data in a table so that each name is on a different row eg
>
> Name1
> Name2
> Name3
> Name4
>
> etc
>
> Name30
>
> Is this possible ?
>
> Thanks,
>
>
>


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines