Author: Tomas Rutkauskas How to compare two TGUID Answer: This function compares two GUIDs for sorting purposes. 1 2 function CompareGUIDs(const A: TGUID; const B: TGUID): Integer; 3 4 type 5 TGUIDParts = array[0..3] of LongWord; 6 7 var 8 AA: TGUIDParts absolute A; 9 BB: TGUIDParts absolute B; 10 I: Integer; 11 begin 12 Result := 0; 13 for I := 0 to 3 do 14 if (AA[I] < BB[I]) then 15 begin 16 Result := -1; 17 Break; 18 end 19 else if (AA[I] > BB[I]) then 20 begin 21 Result := 1; 22 Break; 23 end; 24 end;