Compare two TGUID (Views: 707)
Problem/Question/Abstract: How to compare two TGUID Answer: This function compares two GUIDs for sorting purposes. function CompareGUIDs(const A: TGUID; const B: TGUID): Integer; type TGUIDParts = array[0..3] of LongWord; var AA: TGUIDParts absolute A; BB: TGUIDParts absolute B; I: Integer; begin Result := 0; for I := 0 to 3 do if (AA[I] < BB[I]) then begin Result := -1; Break; end else if (AA[I] > BB[I]) then begin Result := 1; Break; end; end; |