Pascal Viandier wrote:
When I say "compatible types", I say records with the same fields in the same order so I presume the padding bits and bytes would be done the same way.
Yes, but the pad bits and bytes can have random values ...
In fact, my exact need is to be able to compare records of the same type but if something can be done about that, it must be seen in a more generic way.
Now, for the memcmp() call, can I do it directly in my Pascal code? I used to call C code from Pascal through Pascal declarations and a C module to make the implementation, all with careful Pascal/C type mappings on prameters. If it is possible to call memcmp() directly, it would be a nice solution for my problem.
function memcmp( var b1, b2; len: Integer): CInteger; external; attribute ( name = 'memcmp');
function SameBytes( var b1, b2; size: Integer): boolean; begin SameBytes:= memcmp( b1, b2, size) = 0 end;
But you have been warned.
Regards,
Adriaan van Os