Binário para Decimal - URGENTE

Delphi

04/07/2003

Olá pessoal,

Tou de volta,

Agradeço d+ a quem puder me informar como posso converte um numero binario em decimal.


Thematrix:reloaded

Thematrix:reloaded

Curtidas 0

Respostas

Carnette

Carnette

04/07/2003

function BinToInt(Value: String): LongInt;
{Converte um numero binário em Inteiro}
var
i,Size: Integer;
begin
Result := 0;
Size := Length(Value);
for i:=Size downto 0 do
begin
if Copy(Value,i,1)=´1´ then
begin
Result := Result+(1 shl i);
end;
end;
end;


GOSTEI 0
Thematrix:reloaded

Thematrix:reloaded

04/07/2003

Valeu mesmo!!!!


GOSTEI 0
POSTAR