On 24 Mar 2008, at 12:03, ik wrote:
Since when are you using fillchar on a string in Pascal ? that's a C
approach.
He's using it on a record. Initialising records with fillchar
(regardless of what they contain) is quite common in Pascal as well.
And as Florian mentioned, if you do this fo
Since when are you using fillchar on a string in Pascal ? that's a C approach.
BTW Most Pascal's string functions will stop on the first #0 they
encounter, at least the Delphi's tool that I remember.
I think he misses the entire point in his blog.
Ido
On Mon, Mar 24, 2008 at 1:20 PM, L <[EMAIL
> L schrieb:
> >
> > Many times I find myself initializing stuff tediously and error prone
> > when you do it a human way without automation.
>
> Records and objects containing automated fields are initialized?
Are they? Or only the automated fields?
__
L schrieb:
> http://stanleyxu2005.blogspot.com/2008/01/potential-memory-leak-by-initializing.html
>
>
> Interesting..
>
> So with
>
> procedure InitRecord(out R; SizeOfRecord: Integer);
> begin
> FillChar(R, SizeOfRecord, #0);
> end;
>
> Even if it has dynamic array, ansistrings, shortstrings
http://stanleyxu2005.blogspot.com/2008/01/potential-memory-leak-by-initializing.html
Interesting..
So with
procedure InitRecord(out R; SizeOfRecord: Integer);
begin
FillChar(R, SizeOfRecord, #0);
end;
Even if it has dynamic array, ansistrings, shortstrings, integers,
I assume it is okay to i