session variable problem

Discussion in 'ASP General' started by Neil Jarman, Jan 19, 2005.

  1. Neil Jarman

    Neil Jarman Guest

    Hi,

    I need to create an array with a session variable.

    According to my book, the following should work,. but if fails

    for each key in request.QueryString
    if left(key,6) = "cboRun" then
    iIndex = cint(mid (key,7))
    response.Write(iIndex & "<br>")
    session.Contents("iRunNo")(iIndex)=iIndex
    end if
    next

    it is the (iIndex) part which fails. If I remove this, then I can create a
    single session variable

    Any suggestions where I'm going wrong.

    Many thansk

    NEIL
     
    Neil Jarman, Jan 19, 2005
    #1
    1. Advertising

  2. Neil Jarman wrote:
    > Hi,
    >
    > I need to create an array with a session variable.
    >
    > According to my book, the following should work,. but if fails
    >
    > for each key in request.QueryString
    > if left(key,6) = "cboRun" then
    > iIndex = cint(mid (key,7))
    > response.Write(iIndex & "<br>")
    > session.Contents("iRunNo")(iIndex)=iIndex
    > end if
    > next
    >
    > it is the (iIndex) part which fails. If I remove this, then I can
    > create a single session variable
    >
    > Any suggestions where I'm going wrong.
    >
    > Many thansk
    >
    > NEIL


    I don't see the code where you initialized the session variable. Does it
    exist?

    Bob Barrows
    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.
     
    Bob Barrows [MVP], Jan 19, 2005
    #2
    1. Advertising

  3. Neil Jarman

    Bullschmidt Guest

    Bullschmidt, Jan 26, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jeff Smythe
    Replies:
    3
    Views:
    1,305
    Jeff Smythe
    Jan 2, 2004
  2. Replies:
    1
    Views:
    1,089
    Bruce Barker
    Nov 14, 2005
  3. =?Utf-8?B?Um9iSEs=?=
    Replies:
    4
    Views:
    5,392
    =?Utf-8?B?Um9iSEs=?=
    Apr 11, 2007
  4. chowchho
    Replies:
    7
    Views:
    659
    Patrice
    Mar 28, 2008
  5. Jazzis
    Replies:
    2
    Views:
    275
    Jazzis
    Sep 23, 2003
Loading...

Share This Page