help, why "Post"&N="apple" not working

Discussion in 'C#' started by JJnacy, Dec 30, 2007.

  1. #1
    <%
    "Post"&N="apple"
    response.write "Post"&N
    %>

    it does not work
    what is the right way?
    please help
     
    JJnacy, Dec 30, 2007 IP
  2. JohnZing

    JohnZing Peon

    Messages:
    109
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You cant do this
    "Post"&N="apple"
    use an array like
    <%
    Dim Posts(50) ' 50 as example

    Posts(N)="apple"
    response.write Posts(N)
    %>
     
    JohnZing, Dec 30, 2007 IP
  3. JJnacy

    JJnacy Peon

    Messages:
    448
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Array works for N=number

    But
    Name="someOnesName"
    "Post"&Name="apple"
    response.write "Post"&Name

    any way to write?

    like idX=eval("id"&name) <--this works
    but way eval("Post"&Name)="apple" <--- why does not work?
     
    JJnacy, Dec 30, 2007 IP