On 24 Mar 2008, at 14:10, L wrote:
One thing to ponder about:
A class inside a record...
trecord = record
something: TSomeClass;
int: integer;
//... etc
end;
My brain hurts.
A class field is just a pointer. Since classes are not reference
counted, nothing special is done for record fields
One thing to ponder about:
A class inside a record...
trecord = record
something: TSomeClass;
int: integer;
//... etc
end;
My brain hurts.
This will cause issues with a Fillchar for the class, or not?
I wouldn't use this normally (a class inside a record), but it is still
interesting to th
I think confusion was created also because that guys blog post only had
a record with one field in it (a string).. he should have used more
fields with integers, pointers, etc to demonstrate a point more.
___
fpc-pascal maillist - fpc-pascal@lists.
> L wrote:
> Ansistrings are initialized in the record?
> But integers too?
Only automated types are initialized/finalized, the rest not. So the blog
post has a point, it is something to look out for.
___
fpc-pascal maillist - fpc-pascal@lists.freepasc
L wrote:
Florian wrote..
Records and objects containing automated fields are initialized? Or do I
miss something?
Oh...?
This is something I have never been clear about :-(
p.s. see also:
http://community.freepascal.org:1/bboards/message?message_id=223327&forum_id=24082
So. let's cle
On 24 Mar 2008, at 12:53, L wrote:
So a record with an ansistring and an integer.. for example even
local scope..
Will be all zeros?
procedure test;
var somerec: Tsomerec;
begin
// these checks are okay?
if somerec.astring = '' if somerec.someint = 0
end;
i.e. above is not random data?
Florian wrote..
Records and objects containing automated fields are initialized? Or do I
miss something?
Oh...?
This is something I have never been clear about :-(
So a record with an ansistring and an integer.. for example even local scope..
Will be all zeros?
procedure test;
var somerec: