Page 2 of 2

Posted: Fri Apr 16, 2004 5:03 am
by oldefoxx
I wrote a program that used a header block in the file that defined the
file makeup - number of fields, types of fields, names of fields. The problem was, I could not create a dynamic structure that reflected the
defined file structure - I had to write variations that would "fit" the various layouts, then select the appropriate one that matched a particular file.

In effect, I could have just used a reference number in a small header section that related to a given file. But it was very useful to actually set up the adctual structure in the header, since I could then validate whether a particular program or version of a program was able to properly access and process the contents of a given file. I could even "profile" the file and ensure that the same program could process a given range of files as they are adapted over time.

But what I longed for was the ability to create a dynamic reference structure that could be defined by external information, such as the info I had in the file header.

This is, from my limited understanding, the type of behavour we want from objects, that they understand themselves and can reference their own content in a suitable manner.

I'm just make the point that dynamic structures could be useful in other situations as well.

Posted: Fri Apr 23, 2004 1:27 pm
by dell_jockey
Oldefoxx,

in other languages, these are called 'persistent objects'. Do a Google on that subject and you'll find plenty of references.

Posted: Wed Apr 28, 2004 5:06 pm
by Shannara
tinman:

Tried that code, it didnt do what was needed. Also did a search, the search didnt help at all. As for doing memory allocation myself.. huh?

blueznl:

you have me completely lost in that sample.

delljockey:

Yep, thought of it, and it's already done, however that has no relation to this thread :)

Posted: Wed Apr 28, 2004 8:16 pm
by Shannara
Ok, after talking to blue, it turns out a 3 or 4 dimensional array is best suited for animated tiles (bummer to due to them being slow). But oh well.