Re: Compiler String Efficiency
- From: erewhon@xxxxxxxxxx (J French)
- Date: Fri, 16 Sep 2005 09:19:31 +0000 (UTC)
On 15 Sep 2005 19:03:01 -0700, "dw85745@xxxxxxxxxxxxx"
<dw85745@xxxxxxxxxxxxx> wrote:
>Thanks for responding Mr. Wood.
>My thoughts -- as you expressed -- were 1 and 2 were equal, but that
>the stack would allocate memory = VB default (as I recall 255
>characters) and then store the 10 character string in the allotted
>memory, padding the rest with spaces. The variable (pointer to the
>string) would then just reference the first 10 bytes of this 255
>character memory block.
You can forget that 255 character stuff
- also String /Data/ is not on the Stack
- the pointer to the String Data might or might not be on the stack
depending on where and how the String is Dim-ed
>WhereAs 3
>while initially allocating the VB Default, the memory allocation would
>then be revised down to 10 characters, freeing up the balance of the
>allotted string memory for other use.
>Does this seem reasonable?
It is not how it works
Try the following :
Me.Print VarPtr( S )
Me.Print StrPtr( S )
>BTW have looked for but haven't found a discussion on this -- hence the
>post.
You seem to have picked up some information on how Delphi handles
Strings - VB does not work like that at all
.
- Follow-Ups:
- Re: Compiler String Efficiency
- From: Tony Proctor
- Re: Compiler String Efficiency
- References:
- Compiler String Efficiency
- From: dw85745@xxxxxxxxxxxxx
- Re: Compiler String Efficiency
- From: Jonathan Wood
- Re: Compiler String Efficiency
- From: dw85745@xxxxxxxxxxxxx
- Compiler String Efficiency
- Prev by Date: Re: Access Violation Exception
- Next by Date: Re: Compiler String Efficiency
- Previous by thread: Re: Compiler String Efficiency
- Next by thread: Re: Compiler String Efficiency
- Index(es):
Relevant Pages
|