unit BlockProtokoll; interface uses Forms, SysUtils, LocoClientProtokoll; function StrToSlip (const a: String): String; function SlipToStr (const a: String): String; implementation function StrToSlip (const a: String): String; var i, l: Integer; b: String; begin l:= length(a); b:=''; for i:=1 to l do begin case ord(a[i]) of 192: b:= b + #219#220; 219: b:= b + #219#221; else b:= b + a[i]; end; end; result:= b; end; function SlipToStr (const a: String): String; var i, l: Integer; b: String; jump: boolean; begin l:= length(a); b:=''; jump:= false; for i:=1 to l do begin if not jump then begin case ord(a[i]) of 219: begin case ord(a[i+1]) of 220: begin jump:= true; b:= b + #192; end; 221: begin jump:= true; b:= b + #219; end; else b:= b + a[i]; //Protokollverletzung entdeckt, nichts tun. end; end; else b:= b + a[i]; end; end else jump:= false; end; result:= b; end; end.