PDA

View Full Version : Persistent Struct Definitions


galagast
11-23-2005, 09:18 AM
struct person (name,age)
j1 = person "joe" 20
j2 = person "jill" 19
jj = #(j1,j2)
persistent global jj
persistent global person


Hi, im trying to make this work.
I would want my struct definitions to stay persistent for specific max files.
It seems that if I was to reopen the file, the definitions would become undefined, thus giving me: jj = #(undefined, undefined)

Although right now im leaning towards using direct access through arrays by index, it would have been a lot much easier (and readable) to access those array items by property..

j-man
11-23-2005, 12:48 PM
Galagast,

Yes, The way I have gotten around this before is to translate my structs into multi-dimentional arrays and store them as persistents and then back to structs again. Not pretty. Which is what you're saying no

< =

J.

galagast
11-23-2005, 01:16 PM
thanks j_man, multi-dimensional arrays are working fine for me as of now :D

CGTalk Moderation
11-23-2005, 01:16 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.