Ver Mensaje Individual
  #2  
Antiguo 16-04-2009
hach hach is offline
Miembro
 
Registrado: mar 2007
Ubicación: Bariloche, Argentina
Posts: 44
Reputación: 0
hach Va por buen camino
String to array of bytes y vi cerveza

Hola,
si te entendi bien estas funciones te van a servir:

Código Delphi [-]
function StringToHexa(texto:String; var dato:array of byte):Boolean;
var i : longint;
begin
  Result := FALSE;
  if trim(texto) = '' then exit;
  if Length(texto) = 1 then texto := '0' +  texto;

  For i := 1 To Length(texto) div 2 do
    dato[i - 1] := strtoint('$' + MidStr(texto, (i * 2) - 1, 2));
  Result := True;
end;

 
function HexaToString(dato: array of byte): string;
var i: longint;
begin
 Result := '';
 for i := 0 To high(dato) do
  Result := Result  + IntToHex(dato[i], 2);
end;


Saludos

Pablo
Responder Con Cita