help...listx="text"&i not working

Discussion in 'C#' started by 1why, Sep 29, 2006.

Thread Status:
Not open for further replies.
  1. #1
    <%
    text1="Monday"
    text2="Tuesday"
    text3="Wednesday"
    for i=1 to 3
    listx="text"&i
    response.write listx&"<br>"
    next
    %>
    I want the result like this:

    Monday
    Tuesday
    Wednesday

    why listx="text"&i does not work :confused:
    what shall be

    Please help
     
    1why, Sep 29, 2006 IP
  2. rb3m

    rb3m Peon

    Messages:
    192
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #2
    What you actually want is an array:
    <%
    text(1)="Monday"
    text(2)="Tuesday"
    text(3)="Wednesday"
    for i = 1 to 3
    listx=text(i)
    response.write( listx & "<br />" )
    next i
    %>
    Read up on arrays.
     
    rb3m, Sep 30, 2006 IP
  3. 1why

    1why Peon

    Messages:
    68
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    rb3m,

    Thank you so much

    you are right

    dim array is the right one I need

    now it works

    :)
     
    1why, Sep 30, 2006 IP
Thread Status:
Not open for further replies.