Einzelnen Beitrag anzeigen

shmia

Registriert seit: 2. Mär 2004
5.508 Beiträge
 
Delphi 5 Professional
 
#7

AW: checksum eines RS232-strings erstellen

  Alt 14. Dez 2010, 14:28
Delphi-Quellcode:
sum := 0;
if i := 1 to length(s) then
  inc(sum, ord(s[i]));

checkchar := char((not sum) and $FF);
s := s + checkchar;
Andreas
  Mit Zitat antworten Zitat