this slowpoke moves

HEX < > String

String to HEX :
function StrToHex(s: String): String;
Var i: Integer;
begin
  Result:='';
  If Length(s)>0 Then
    for i:=1 To Length(s) Do
      Result:=Result+IntToHex(Ord(s[i]),2);
end;
HEX to String :
function HexToStr(s: String): String;
Var i: Integer;
gegin
  Result:=''; i:=1;
  While i<Length(s) Do Begin
    Result:=Result+Chr(StrToIntDef('$'+Copy(s,i,2),0));
    Inc(i,2);
  end;
end;

Keine Kommentare:

Kommentar veröffentlichen

Beliebte Posts

Translate