New prob with array & session variable

Results 1 to 7 of 7

Thread: New prob with array & session variable

  1. #1
    SimpleSimon Guest

    Default New prob with array & session variable

    I&#039;ve managed to store a dynamic array in a session variable:<BR>session("tablename") = tablename<BR>displayed the contents:<BR>for i = lbound(tablename) to ubound(tablename)<BR> test = tablename(i)<BR> response.write test<BR>next<BR>But...<BR>on the corrisponding asp page after dumping out the session, I get a type mismatch with the lbound function. Any ideas?<BR>thanks in adv.<BR><BR>

  2. #2
    Bill H. Guest

    Default Show code

    Show the code where you dump out the array from the session variable to the server side variable...the problem is probably there

  3. #3
    SimpleSimon Guest

    Default RE: Show code

    I&#039;m doing it the same as before except:<BR>tableName= session("tableName")<BR>for i = Lbound(tableName) to Ubound(tableName)<BR> test= tableName(i)<BR> response.write test<BR>next<BR>

  4. #4
    Bill H. Guest

    Default well...

    Since a new array gets indexed from 0, why not just go For i = 0 to Ubound(tablename) ?

  5. #5
    SimpleSimon Guest

    Default One Works, One doesn't!!!!

    I&#039;ve created a simple test array:<BR>Mytable(2)<BR>myTable(0)="A"<BR>myTable( 1)="B"<BR>session("myTable")=myTable<BR><BR> then on the folowing asp:<BR>mytable= session("mytable")<BR>for i = Lbound(myTable) to Ubound(myTable)<BR> test= myTable(i)<BR> response.write test<BR>next<BR><BR>it works fine, diplays AB<BR>but my other array is a dynamic array that loads up in a for loop.I use the same code to test it on the page that it was created on(works fine) and the same code on the other asp to spit it out and that&#039;s when I get the Lbound mismatch.<BR><BR>code for loading the Dynamic array:<BR>for num = 1 to 4<BR> if request.form("chkQuestion" & num) = "Y" then<BR> redim preserve tableName(num)<BR> tablename(num) = a_array(num) &#039;&#060;&#060;other array<BR> end if<BR>next<BR>

  6. #6
    SimpleSimon Guest

    Default RE: well...

    hmmmmm<BR>yes, I will try that<BR>thanks, I&#039;ll let you know

  7. #7
    SimpleSimon Guest

    Default Ubound mismatch now

    tried it and now it a ubound mismatch.<BR>It must not know that an array is going on .

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts