Re: StrPas question
From: Skybuck Flying (nospam_at_hotmail.com)
Date: 12/21/04
- Next message: Richard: "Re: Delphi 2005"
- Previous message: Skybuck Flying: "Re: StrPas question"
- Maybe in reply to: Ian Hinson: "StrPas question"
- Next in thread: Rob Kennedy: "Re: StrPas question"
- Reply: Rob Kennedy: "Re: StrPas question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 21 Dec 2004 00:46:55 +0100
Actually now that I think about this, this could be seen as a bug ;)
I told delphi to copy "Hello" into an array and I did not tell delphi to
clean the rest of the array :)
Ouch.
"Skybuck Flying" <nospam@hotmail.com> wrote in message news:...
> Well you made it seem like delphi automatically adds a #0 to a string like
> that...
>
> I don't believe that...
>
> The only reason why the #0 chars are there is because it copies more than
> necessary ;)
>
> "Rob Kennedy" <me3@privacy.net> wrote in message
> news:32p0peF3irf2nU1@individual.net...
> > Skybuck Flying wrote:
> > > "Rob Kennedy" <me3@privacy.net> wrote in message
> > > news:32efhpF3js32sU1@individual.net...
> > >> That array actually gets assigned in three steps. First, it stores
> > >> 'Hell', then it stores 'o'#0, and then it fills the remaining byte
with
> > >> #0, too. In other words, the string literal is #0-extended to fit the
> > >> size of the buffer. The whole #0-padded string is stored in the EXE
> file
> > >> and gets copied into the array at run time.
> > >
> > > I don't think that's true Rob ;) ( I tested it once ;) )
> >
> > Do you think I just make this stuff up, pulling out of thin air?
> >
> > Whatever you tested, it wasn't this, or you didn't really understand
> > what you thought you saw. You have a history of misinterpretting what
> > you see.
> >
> > When I talk about what the compiler does and does not do, it's because
> > I've seen the generated code.
> >
> > > Try setting a[5] := char(66);
> > > Try setting a[6] := char(67);
> >
> > Don't tell me what to try. Try it yourself. Jeez.
> >
> > --
> > Rob
>
>
- Next message: Richard: "Re: Delphi 2005"
- Previous message: Skybuck Flying: "Re: StrPas question"
- Maybe in reply to: Ian Hinson: "StrPas question"
- Next in thread: Rob Kennedy: "Re: StrPas question"
- Reply: Rob Kennedy: "Re: StrPas question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|