Articles   Members Online:
-Article/Tip Search
-News Group Search over 21 Million news group articles.
-Delphi/Pascal
-CBuilder/C++
-C#Builder/C#
-JBuilder/Java
-Kylix
Member Area
-Home
-Account Center
-Top 10 NEW!!
-Submit Article/Tip
-Forums Upgraded!!
-My Articles
-Edit Information
-Login/Logout
-Become a Member
-Why sign up!
-Newsletter
-Chat Online!
-Indexes NEW!!
Employment
-Build your resume
-Find a job
-Post a job
-Resume Search
Contacts
-Contacts
-Feedbacks
-Link to us
-Privacy/Disclaimer
Embarcadero
Visit Embarcadero
Embarcadero Community
JEDI
Links
How to compare two TGUID Turn on/off line numbers in source code. Switch to Orginial background IDE or DSP color Comment or reply to this aritlce/tip for discussion. Bookmark this article to my favorite article(s). Print this article
19-May-03
Category
Algorithm
Language
Delphi 2.x
Views
90
User Rating
No Votes
# Votes
0
Replies
0
Publisher:
DSP, Administrator
Reference URL:
DKB
			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;


			
Vote: How useful do you find this Article/Tip?
Bad Excellent
1 2 3 4 5 6 7 8 9 10

 

Advertisement
Share this page
Advertisement
Download from Google

Copyright © Mendozi Enterprises LLC