Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Buscar Temas de Hoy Marcar Foros Como Leídos

Grupo de Teaming del ClubDelphi

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 16-04-2009
vicoxl16 vicoxl16 is offline
Registrado
 
Registrado: abr 2009
Posts: 4
Poder: 0
vicoxl16 Va por buen camino
Thumbs up Ayuda String to Array of Bytes

Hola Amigos Soy Nuevo en Delphi y me encontre con un problema del como convertir una cadena a Array of byte y

convertir un array of bytes a cadena


REGISTRO:array[0..191] of byte=(
$FC,$1E,$03,$00,$00,$0C,$01,$0E,$00,$42,$75,$66,$66,$65,$72,$4F,$76,$65,$72,
$66,$6C,$6F,$77,$0C,$D4,$00,$7F,$00,$00,$15,$79,$48,$DE,$10,$92,$14,$69,$FE,
$CE,$10,$1A,$0F,$00,$00,$00,$00,$00,$00,$D3,$6D,$59,$0B,$ED,$35,$1B,$0A,$5A,
$0B,$1D,$2E,$91,$44,$DE,$10,$92,$14,$61,$4C,$DE,$10,$92,$14,$0A,$0E,$CF,$10,
$02,$13,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,
$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,
$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,
$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,
$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,
$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,
$00,$00);


Bueno, SI Alguien Me puede ayudar le estare agradecido
Responder Con Cita
  #2  
Antiguo 16-04-2009
hach hach is offline
Miembro
 
Registrado: mar 2007
Ubicación: Bariloche, Argentina
Posts: 44
Poder: 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
  #3  
Antiguo 19-04-2009
vicoxl16 vicoxl16 is offline
Registrado
 
Registrado: abr 2009
Posts: 4
Poder: 0
vicoxl16 Va por buen camino
Thumbs up RE: Tanks

Muchas Grasias Ami la Funcionde HexaToString me va de Lujo


solo una consulta en la funcion StringToHexa como ago para su llamado

Informacion:array[0..191] of byte

Te lo Agradeceria Amigo
Responder Con Cita
  #4  
Antiguo 20-04-2009
hach hach is offline
Miembro
 
Registrado: mar 2007
Ubicación: Bariloche, Argentina
Posts: 44
Poder: 0
hach Va por buen camino
uso StringToHexa

Código Delphi [-]
Informacion:array[0..191] of byte;
strHexa: String;
 
strHexa:=´0102A1FF´;
 
StringToHexa(strHexa, Informacion);
Responder Con Cita
Respuesta


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
array de bytes con ICS 3NK1 Internet 1 15-04-2009 03:20:44
Array Of bytes [Problema] Ðαяισš Varios 3 31-12-2008 10:22:23
Duda con string i array adrall Varios 4 01-07-2008 04:29:17
Localizar un array de bytes en un fichero binario. maro Varios 3 12-02-2008 12:58:12
transformar array of bytes en string aluky Varios 3 04-06-2007 17:35:50


La franja horaria es GMT +2. Ahora son las 00:23:07.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi