Fórum Binário para Decimal - URGENTE #167875
04/07/2003
0
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
Curtir tópico
+ 0
Responder
Posts
04/07/2003
Carnette
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;
Responder
Gostei + 0
04/07/2003
Thematrix:reloaded
Valeu mesmo!!!!
Responder
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)