http://forum.pcsoft.fr/en-US/pcsoft.br.windev/372-converter-decimal-binario-convert-decimal-binary/read.awp
// by Jose Elielson
// converter dec -> bin
x is int = edit_decimal
r is int = 0
y is int = 0
b is string = ""
IF x > 1
LOOP
y = IntegerPart(x/2)
r = x - (y*2)
b = NumToString(r) + b
IF y = 1 THEN
b = "1" + b
BREAK
END
x = y
END
ELSE
b = NumToString(x)
END
Info(b)
Nenhum comentário:
Postar um comentário