Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

persistant multi-dimensional arrays

Status
Not open for further replies.

mitsiguri

Programmer
Nov 3, 2001
12
GB
Hi All,

I understand that its not possible to store multi-dimensional arrays in the application/session/cookies object.

Can someone suggest a similar method/workaround for this problem?

cheers
mitSiguRi
 
Well, it isn't exactly the prettiest way to do it, but why not write two little functions that take the number of dimensions and the array as arguments and then join them into comma-delimited strings? One function would perform a series of joins one would perform a series of splits. Now that I think about it, you wouldn't be able to make it dynamic (sorry, to much .Net lately), but as long as you know the number of dimensions will always be x (3, 4, whatever) just write a set of for loops to join everything together one dimension at a time with differant delimiters for each dimension, then split it apart in reverse of how you joined it. It's messy but it should work.
-Tarwn
And for my next trick I'll see if I can go through yet another foreign country on my way between Maryland and Oregon :p
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top