One sentence: Use comparemem to compare memory.
{Compare static array} procedure tform1.button1click (Sender: tobject); var arr1: array [0 .. 3] of ansichar; arr2: array [0 .. 3] of byte; begin arr1 [0]: = 'a'; arr1 [1]: = 'B'; arr1 [2]: = 'C '; arr1 [3]: = 'D'; arr2 [0]: = 65; arr2 [1]: = 66; arr2 [2]: = 67; arr2 [3]: = 68; If comparemem (@ arr1, @ arr2, sizeof (arr1) Then showmessage ('data in arr1 and arr2 is the same '); end; {compare dynamic array} procedure tform1.button2click (Sender: tobject); var arr1: array of ansichar; arr2: array of byte; begin setlength (arr1, 4); setlength (arr2, 4); arr1 [0]: = 'a'; arr1 [1]: = 'B'; arr1 [2]: = 'C'; arr1 [3]: = 'D'; arr2 [0]: = 65; arr2 [1]: = 66; arr2 [2]: = 67; arr2 [3]: = 68; if comparemem (arr1, arr2, sizeof (arr1) Then showmessage ('data in arr1 and arr2 is the same '); end; {multi-dimensional array is the same} procedure tform1.button3click (Sender: tobject); var arr1: array [0 .. 1, 0 .. 1] of ansichar; arr2: array [0 .. 1, 0 .. 1] of byte; begin arr1 []: = 'a'; arr1 []: = 'B'; arr1 []: = 'C '; arr1 []: = 'D'; arr2 []: = 65; arr2 []: = 66; arr2 []: = 67; arr2 []: = 68; If comparemem (@ arr1, @ arr2, sizeof (arr1) Then showmessage ('data in arr1 and arr2 is the same '); end;