REDIM Preserve problem

K

keyser soze

hi
REDIM Preserve reports an "out of range"

i first create an array, store it into a session var
then, in other page, i load restore the session var into a local array
but, after this, i can't REDIM Preserve

thanks
ks
 
B

Bob Barrows [MVP]

keyser said:
hi
REDIM Preserve reports an "out of range"

i first create an array, store it into a session var
then, in other page, i load restore the session var into a local array
but, after this, i can't REDIM Preserve

thanks
ks
Please provide a simple repro page:

<%
your code to create simple array and store it in session
%>
<%
your code to retrieve array from session and resize it
%>

One thing: verify that you can resize it successfully before storing it
in session.
 
K

keyser soze

thanks Bob
i found the answer to the problem...

using : MyArray[ rows, cols ]
then : "PRESERVE" don't work

swaping the "dimensions" (the logic of my page)
i have: MyArray[ COLS , ROWS ]
and now : the "preserve" keyword works

either there is a problem with "preserve"
and the order of dimensions
or the problem begin when store and restore the array

thanks for your fast help, Bob


"Bob Barrows [MVP]" <[email protected]> escribió en el mensaje
| keyser soze wrote:
| > hi
| > REDIM Preserve reports an "out of range"
| >
| > i first create an array, store it into a session var
| > then, in other page, i load restore the session var into a local array
| > but, after this, i can't REDIM Preserve
| >
| > thanks
| > ks
| Please provide a simple repro page:
|
| <%
| your code to create simple array and store it in session
| %>
| <%
| your code to retrieve array from session and resize it
| %>
|
| One thing: verify that you can resize it successfully before storing it
| in session.
|
|
| --
| 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.
|
|
 
B

Bob Barrows [MVP]

keyser said:
thanks Bob
i found the answer to the problem...

using : MyArray[ rows, cols ]
then : "PRESERVE" don't work

swaping the "dimensions" (the logic of my page)
i have: MyArray[ COLS , ROWS ]
and now : the "preserve" keyword works

either there is a problem with "preserve"
and the order of dimensions
or the problem begin when store and restore the array
No, the problem is the failure to read the documentation :)
Preserve only works for the last dimension of the array.
http://msdn.microsoft.com/en-us/library/c850dt17(VS.85).aspx
 
K

keyser soze

what? ohhhh... i see... OK
i understand, now, the words : "the last dimension"
( i missunderstood it as the "last row" )

thanks, Bob


"Bob Barrows [MVP]" <[email protected]> escribió en el mensaje
| keyser soze wrote:
| > thanks Bob
| > i found the answer to the problem...
| >
| > using : MyArray[ rows, cols ]
| > then : "PRESERVE" don't work
| >
| > swaping the "dimensions" (the logic of my page)
| > i have: MyArray[ COLS , ROWS ]
| > and now : the "preserve" keyword works
| >
| > either there is a problem with "preserve"
| > and the order of dimensions
| > or the problem begin when store and restore the array
| >
| No, the problem is the failure to read the documentation :)
| Preserve only works for the last dimension of the array.
| http://msdn.microsoft.com/en-us/library/c850dt17(VS.85).aspx
|
| --
| 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.
|
|
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top