Re: session help

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



sorry for the confustion,
I have several different types of variables that I would like to store in
Session. I was wondering if it would be better to use a struct or an array of
some sort to store these values in Session.

"Patrice" wrote:

Are you asking if you should store values using a bidimensional array or a
unidimensional array that would store structures ?

IMO a struct would give a better lisibility and type safety. An array could
be acceptable if the "property" index uses named constants (for lisibility)
and if all cells are of the same type...

If this is not what you are looking try to be more explicit when asking a
question...

--
Patrice

"rodchar" <rodchar@xxxxxxxxxxxxxxxxxxxxxxxxx> a crit dans le message de
groupe de discussion : 4EB56888-9EB8-408B-A1C1-62514C616996@xxxxxxxxxxxxxxxx
hey al,
i you had a choice between keeping an array or struct which one would you
choose (and is this a valid question)?

thanks,
rodchar


.



Relevant Pages

  • Re: [patch 3/4 -mm] flex_array: poison free elements
    ... character as the poison value. ... If someone ever tried to store strings ... I wasn't aware that storing an array of ASCII characters was a use case ... distinguish when the elements are being stored in struct flex_array vs. ...
    (Linux-Kernel)
  • Re: Converting Bitmap into 2D-Array
    ... and convert it to a 2D array where each element represents one of the ... struct bitmap { ... Thank you for the advices.For my purposes i have to store grayscale ...
    (microsoft.public.vc.language)
  • Re: Perl array and ASP session variable
    ... way to store an array in a scalar. ... Session is an object - maybe it's possible to store the ... $Session is a perl object, but the actual session is an ASP ... However, I tested it, using the following ASP pages on an IIS6 ...
    (comp.lang.perl.misc)
  • Re: Help needed on Arrays
    ... The function I need to write, will i suppose depend on how i store the data, ... The function will need to read through the array ... The language is vb.net 2005. ... a struct may well be a good choice for your three fields. ...
    (microsoft.public.vsnet.general)
  • Re: [PHP] SESSION problem
    ... But, if you came from a background that predated associate arrays, then using numeric indexes would seem more natural. ... looked into the session extension in that level of detail, but I doubt such a limitation would exist if there was not a very good reason for it. ... Given that I can't see into the future, even if I currently only have one set of data to store in the session I wouldn't just chuck the bits of paper from the file into the filing cabinet. ... The root level of the session array should contain descriptive keys, and I've never been in a situation where 5318008 is descriptive and gives context to the data unless you turn it upside down! ...
    (php.general)