Blitz (113/352)

From:Curt Esser
Date:6 Oct 99 at 13:03:27
Subject:Re: Newtypes & MaxLen

Hi Roger

On 05-Oct-99, Roger Light wrote:
> Hi all,
>
> When using strings in newtypes is there any way of, or any point to,
> defining the MaxLen of all of the strings in it?

I don't know if it is possible - but probably pointless, since the actual
strings are NOT stored inside the NewType itself. Only a pointer to the
actual string is stored there.
>
> As in:
>
> newtype.example
> sausage$
> egg.w
> end newtype
>
> dim breakfast.example(100)
>
> Alternatively, how do I make Sizeof.newtype take into account the length
> of strings?

If it helps, the size of strings variables in a NewType is always 8 bytes (a
long, pointing to the actual string's address)

If you are trying to force the strings themselves to be stored inside the
NewType itself, you could try:

NewType.example
sausage.b [21] ;leave space for 20 characters
egg.w
End NewType

Then use your own routines for converting the string you want to store into
asci values, and putting them in the NewType as bytes.

And gettingthem back out into strings again later.

>
> Cheers,
>
> Roger
Later...



A nuclear war can ruin your whole day.

Yours electronically,
Curt Esser
camge@ix.netcom.com
http://members.xoom.com/Curt_Esser/

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