Binário para Decimal - URGENTE
Olá pessoal,
Tou de volta,
Agradeço d+ a quem puder me informar como posso converte um numero binario em decimal.
Tou de volta,
Agradeço d+ a quem puder me informar como posso converte um numero binario em decimal.
Thematrix:reloaded
Curtidas 0
Respostas
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;
{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
04/07/2003
Valeu mesmo!!!!
GOSTEI 0