From: | Tony Rolfe |
Date: | 12 Jan 2000 at 06:59:56 |
Subject: | Re: Strings and things |
On Tue, 11 Jan 2000 16:41:24 +0200 Evan Tuer said:
>
> 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 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.
That's pretty well what I'm working on. What you ahve to do is
define all your strings (in the newtypes) as String1.b followed
immediately by Pad1.b[n] where 'n' is the maximum length of the
string. then you can use
poke.s &thing\String1,Left$(AString$,n)
to copy a string into the newtype and
AnotherString$ = peek$(&thing\String)
to extract it back to a string. You need one more byte than the
string length to hold the terminating $00 byte.
You can compare a real string with a newtype string (or two newtype
strings) using (Guess who...) David's AsmStrCmp routines.
Give me a yell offline if you need more help.
Cheers
---------------------------------------------------------------------
To unsubscribe, e-mail: blitz-list-unsubscribe@netsoc.ucd.ie
For additional commands, e-mail: blitz-list-help@netsoc.ucd.ie