Re: [fpc-pascal] Re: Initializing Records Automatically

2008-03-24 Thread Jonas Maebe
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

[fpc-pascal] Re: Initializing Records Automatically

2008-03-24 Thread L
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

[fpc-pascal] Re: Initializing Records Automatically

2008-03-24 Thread L
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.

Re: [fpc-pascal] Re: Initializing Records Automatically

2008-03-24 Thread Marco van de Voort
> 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

[fpc-pascal] Re: Initializing Records Automatically

2008-03-24 Thread L
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

Re: [fpc-pascal] Re: Initializing Records Automatically

2008-03-24 Thread Jonas Maebe
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?

[fpc-pascal] Re: Initializing Records Automatically

2008-03-24 Thread L
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: