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.
[Implemented] Resize Arrays in Structures
-
- Enthusiast
- Posts: 767
- Joined: Sat Jan 24, 2004 6:56 pm