08-25-2022, 04:17 PM
I don't like those negative numbers!
Code: (Select All)
Do
Input "What ever number "; whatevernumber
bn$ = _Bin$(whatevernumber) 'the binary string returned by _BIN$
dw = 8 'desired field width
If Len(bn$) >= dw Then
Print bn$ 'number already in desired width or even longer
Else
Print Right$(String$(dw, "0") + bn$, dw) 'left padded with zeros
End If
Print "Back to decimal? "; Val("&B" + bn$)
Loop Until whatevernumber = 0
b = b + ...