Ver Mensaje Individual
  #2  
Antiguo 20-08-2004
Avatar de roman
roman roman is offline
Moderador
 
Registrado: may 2003
Ubicación: Ciudad de México
Posts: 20.269
Reputación: 10
roman Es un diamante en brutoroman Es un diamante en brutoroman Es un diamante en bruto
¿Algo como esto?

Código Delphi [-]
function BinaryStr(B: Byte): String;
const
  BinChars: array[Boolean] of Char = ('0', '1');

var
  Pot2, I: Integer;

begin
  Pot2 := 1;
  for I := 0 to 7 do
  begin
    Result := BinChars[B and Pot2 <> 0] + Result;
    Pot2 := 2*Pot2;
  end;
end;

// Saludos
Responder Con Cita