Blitz (2/193)

From:Dave
Date:1 Aug 2000 at 16:12:10
Subject:Re: String Constants

Hey Tony,

The string format in blitz 2.1 seems to be

-8 BufferLen.l - Length of the allocated space for string to grow
-4 StringLen.l - Actual Length of string
0 Data - String Length Bytes
(StringLen) PAD.b - Zero end of string

Note: if BufferLen=StringLen and is even (ie / 2) then pad is .w, as
allocated
memory is always even

On top of that you have the allocmem data (-12 is size of allocated memory
for whole structure, -16 is next item in the mem list) in a normally
allocated string.

You could fix a string into a dc statment, and then do something like

*Something.s=?MyString

But I have a feeling blitz does not let you use pointers with it`s basic
types.

Not sure that helps but you could write a machine code routine to point a
real blitz string at your static one, bit messy but I don`t see why it
wouldn`t work.

Good luck,

Dave

> Partially. It does tell me more about the String format.
>
> What I'm after is to define string constants in my program rather than
> assign string variables. Something like
>
> MyString$ DC.l <<address of here+8>>
> DC.l <<length of string>>
> DC.b "The actual String",0
>
> which I think is the format of a string.
>
> Then I can use this as a source in a move e.g.
>
> Something$ = MyString$
>
> but not as a destination
>
> MyString$ = SomeThing$ ; Invalid
>
> The point is to cut down on initialization time and excutable size.
>

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