If you initialised the records first using FillChar( ) it would work okay, then you
know it's all unused areas are initialised.
Is there a better way than fillChar() these days??.
Myles.
-----Original Message-----
From: Postmaster [SMTP:[EMAIL PROTECTED]]
Sent: Thursday, April 08, 1999 10:48 PM
To: Multiple recipients of list delphi
Subject: Re: [DUG]: Comparison of records
> Try the following function: (Good fast ASM function that has been around
> for a VERY long time).
> function CompareMem(P1, P2: Pointer; Length: Integer): Boolean;
> Eg.
> if CompareMem (@record1, @record2, sizeof (record1)) then
> This will only work provided the records do not have pointers to data or
> strings.
or have any datatypes which are not word aligned... Note that nonpacked
records
have padding bytes that are not initialised (or at least I don't believe you
can
trust them to be initialised)...
Thus byte fields or byte arrays would be out... Comments?
--
Aaron@home
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
application/ms-tnef