p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

proasp_howto thread: sorting session variable array


Message #1 by "Bryan Cotter" <bryan@s...> on Fri, 23 Mar 2001 20:12:39
Hi there,

I don't think you'll be able to sort them while the arrays are session 
variables.
You'll need to "materialize" them in your local page, sort them and then 
store them back in the session object.

Are you sure you're just talking about arrays and sessions?? Where dies 
Project.ID and Project.Name come from? What object type is Project?

Imar


At 10:43 PM 3/26/2001 +0000, you wrote:
>Thanks for trying to help but it doesn't work. The array is part of a
>session variable. The only way to access it right now is to do:
>
>for each Project in Session("LoggedOnUser").Projects
>     Response.Write Project.ID & " - " & Project.Name (& any other fields)
>next
>
>Do I need to use a multiple array sort? Thanks for any help
>
> > >Example: I have Session("User").Projects that holds a list of the users
> > >projects. I need to resort this array. Should I create a new Session
> > >variable or can the one I already have be sorted? It's originally sorted
> > >by a COMponent but I don't want to get into that right now...
>
>
> > Hi there,
> >
> > The following code (taken from www.4guysfromrolla.com) performs a quick
> > sort on an array.
> >
> > You can use it like this:
> >
> > Dim arrLocal
> > arrLocal = Session("MySessionArray")
> > If IsArray(arrLocal) then
> >          QuickSort arrLocal, lBound(arrLocal), uBound(arrLocal)
> > end if
> > Session("MySessionArray") = arrLocal
> >
> > Check out the following articles for more help on sorting (like
> > two-dimensional arrays for example)
> >
> > http://www.4guysfromrolla.com/webtech/012799-1.shtml
> > http://www.4guysfromrolla.com/webtech/012799-3.shtml
> >
> > Hope this helps,
> >
> > Imar
> >
> >


  Return to Index