[Implemented] Resize Arrays in Structures

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
oldefoxx
Enthusiast
Enthusiast
Posts: 532
Joined: Fri Jul 25, 2003 11:24 pm

Post 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.
has-been wanna-be (You may not agree with what I say, but it will make you think).
dell_jockey
Enthusiast
Enthusiast
Posts: 767
Joined: Sat Jan 24, 2004 6:56 pm

Post 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.
cheers,
dell_jockey
________
http://blog.forex-trading-ideas.com
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

Post 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 :)
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

Post 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.
Post Reply