Re: Initialize not resetting other fields !
From: Skybuck Flying (nospam_at_hotmail.com)
Date: 02/25/04
- Next message: Skybuck Flying: "Conditionals in DFM's ?"
- Previous message: Rob Kennedy: "Re: Initialize not resetting other fields !"
- In reply to: Rob Kennedy: "Re: Initialize not resetting other fields !"
- Next in thread: Maarten Wiltink: "Re: Freeing a record which contains a string field leads to a memory/string leak ?!"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 25 Feb 2004 18:15:57 +0100
"Rob Kennedy" <me@privacy.net> wrote in message
news:c1iipv$1jbp1i$1@ID-220940.news.uni-berlin.de...
> Skybuck Flying wrote:
> > It only initializes dynamic types like strings etc...
>
> Duh. Did you read the help? "Initialize simply zeros out the memory
> occupied by long strings, Variants, and interfaces, causing long strings
> to be empty and Variants and interfaces to be Unassigned."
>
> The help neglects to mention dynamic arrays; they're initialized, too.
>
> If you want your entire memory block to be all-bits-zero, then stop
> using GetMem. Use AllocMem instead.
Note: If the memory does not need to be zero-initialized, it is more
efficient to use GetMem instead.
:)
Sometimes I don't need all bits zero or just dont want it ;) for maximum
flexibility/speed...
Thx for the tip though,
I know use:
GetMem
FillChar
AND
Initialize
Just to be on the safe side ! :D
Skybuck.
- Next message: Skybuck Flying: "Conditionals in DFM's ?"
- Previous message: Rob Kennedy: "Re: Initialize not resetting other fields !"
- In reply to: Rob Kennedy: "Re: Initialize not resetting other fields !"
- Next in thread: Maarten Wiltink: "Re: Freeing a record which contains a string field leads to a memory/string leak ?!"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|