JScript Session array problem - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

JScript Session array problem

How do i modify a Session array using JScript
For e.g., i want the Session("users") to store the names of 0 to 100 users at a given time. So

Session("users")=new Array()
for(i=0;i<n;i++)
Session("users")[i]=....

or

var us=new Array()
for(i=0;i<n;i++)
us[i]=...
Session("users")=us

Both give errors such as a session variable cannot be use with an intrinsic object etc.
Are there any errors here or do we have to include something for these to work properly.
I use PWS on my Win98 system.

I am desperate. Please do reply quickly.
Loads of thanks in advance.

Deepak
deepak-p@eth.net

Comments

  • sharath_khsharath_kh Posts: 4Member
    If the session variable that u are setting as an array is used in the server side then it should be included in delimiters. Like -
    U can use this code. Hope it would work for u.

    arrusers=new Array()
    for(i=0;i=arrusers

  • RadarBobRadarBob Posts: 7Member
    Right. In other words, you must first create the array in JScript (in this case) then assign it to a session variable. Then to use the array you must first assign the session variable back into a JScript array.

    : If the session variable that u are setting as an array is used in the server side then it should be included in delimiters. Like -
    : U can use this code. Hope it would work for u.
    :
    : arrusers=new Array()
    : for(i=0;i=arrusers
    :
    :

Sign In or Register to comment.