<HTML><BODY>
<DIV>Agh...dont you hate that !</DIV>
<DIV>Someone shows you a bit of code and you go "oh yeah....DUH !!!"</DIV>
<DIV> </DIV>
<DIV>thanks Phil.</DIV>
<DIV> </DIV>
<DIV>Jeremy<BR></DIV>
<BLOCKQUOTE style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px;
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">-----Original
Message-----<BR>From: "Phil Middlemiss" <phil@tumonz.co.nz><BR>To: "NZ
Borland Developers Group - Delphi List" <delphi@ns3.123.co.nz><BR>
Date: Thu, 11 Nov 2004 16:43:50 +1300<BR>Subject: Re: [DUG] 'exclusive
or'<BR><BR>
<DIV><FONT face=Arial size=2>here is a simple function I use:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><B><FONT size=2>
<DIV>function</B> CalcCheckSum(<B>const</B> S: <B>String</B>): Word;<BR><B>
var</B><BR> i: Integer;<BR><B>begin</B><BR> result := 0;<BR><B>
for</B> i := 1 <B>to</B> Length(S) <B>do</B><BR>
result := result <B>xor</B> Word(S[i]);<BR><B>end</B><BR></DIV>
<DIV><FONT face=Arial>probably not the fastest, but it's adequate.</FONT>
</DIV>
<DIV><FONT face=Arial>Cheers,</FONT></DIV>
<DIV><FONT face=Arial>Phil.</FONT></DIV></FONT></DIV>
<BLOCKQUOTE style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px;
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>
From:</B> <A title=vss@vss.co.nz
href="javascript:openWin('/WorldClient.dll?Session=EGZZBPG&View=Compose&To=vss@vss.co.nz&New=Yes','Compose',800,600,'yes');">
Jeremy Coulter</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=delphi@delphi.org.nz
href="javascript:openWin('/WorldClient.dll?Session=EGZZBPG&View=Compose&To=delphi@delphi.org.nz&New=Yes','Compose',800,600,'yes');">
delphi@delphi.org.nz</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Thursday, November 11, 2004 4:12
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> [DUG] ’exclusive or’</DIV>
<DIV><BR></DIV>
<DIV style="FONT-SIZE: 10pt; FONT-FAMILY: tahoma; BACKGROUND-COLOR: white">
<FONT face=Arial size=2>
<P align=left>Hi all.</DIV></DIV>
<P align=left>I am not too good a this stuff, but I have to pass a checksum
at the end of a bit of data, and the documentation says "the checksum Is
calculated by ’exclusive or’ among all sent characters"
<DIV></DIV>
<P align=left>How would I do this?
<DIV></DIV>
<P align=left>
<DIV></DIV>
<P align=left>Jeremy
<DIV></DIV></FONT>
<DIV></DIV>
<DIV>
<HR>
<DIV></DIV>_______________________________________________<BR>Delphi mailing
list<BR><A
href="javascript:openWin('/WorldClient.dll?Session=EGZZBPG&View=Compose&To=Delphi@ns3.123.co.nz&New=Yes','Compose',800,600,'yes');">
Delphi@ns3.123.co.nz</A><BR>http://ns3.123.co.nz/mailman/listinfo/delphi<BR>
</BLOCKQUOTE></BLOCKQUOTE>
</BODY></HTML>