Blitz (148/459)

From:David McMinn
Date:11 Jan 2000 at 15:51:57
Subject:Re: Strings and things

Hi Evan

> Hi Dave, you appear to know an unfeasible amount about blitz
> memory handling, so I have a question for you.

Nah, got that from the online help :)

> My invoice had a massive big NewType with other newtypes,
> strings and arrays inside, to store all the data. No big problem, but
> it takes a lot of code to read in and write out the data to the file,
> and it's all in ascii as well. Is there some way to divine the amount
> of memory a newtype takes, and write it out in one go? Come to think

Well, you can use sizeof.newtype to get the size of the newtype, and
that will include everything inside except for the strings and any
pointers (well, it will include tham, but not the data they point to,
and WriteMem'ing a newtype won't save as ASCII).....

> of it, the bits of data are probably all in different places, so it
> would need a function to follow the pointers back and reclaim them
> all, has anyone done that already? It would be a really cool
> function.

...and so you have a similar problem to Tony. Trouble is, there is no
way of telling, for example, a long from a pointer. So you'd have to
use a routine for loading and saving that was tailored to that
specific newtype. Someone else will probably have a better answer
than that.

> Cheers. By the way, how are the 'borgs?

Good, there's now a hacky 4 legged version of your robot all I need
is the brain for it.



|) /\ \/ ][ |) |\/| � |\/| ][ |\| |\| | dave@satanicdreams.com
http://members.xoom.com/David_McMinn | ICQ=16827694
Some people are only alive because it is illegal to shoot them.

---------------------------------------------------------------------
To unsubscribe, e-mail: blitz-list-unsubscribe@netsoc.ucd.ie
For additional commands, e-mail: blitz-list-help@netsoc.ucd.ie