Am 2015-03-10 um 22:23 schrieb aradeonas:
> How can I compare two record?
> Like this :
>     type
>     TRec=record
>     na:string;
>     end;
>
>     var
>     R1,R2:TRec;
>     Begin
>     R1.na:='A';
>     R2.na:='B';
>
>     if R1<>R2 then
>     Showmessage('Error')

In your example you would not need the record
if it consists of only one string component.
But you can write:

if R1.na<>R2.na then
   Showmessage('Error')

In general there cannot be a standard
compare function for records because
you can have a lot of different types
within a record. So you need to write
your own compare function.

--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to