The code below, expressed in v3.5 RC form, follows the mLite fairly closely.
#AppType Console function Bin(byval n as integer, byval s as string = "") as string if n > 0 then return Bin(n \ 2, (n mod 2) & s) if s = "" then return "0" return s end function print Bin(5) print Bin(50) print Bin(9000) pauseIt was during the testing of this code that it dawned on me that the mLite wasn't handling the
binary 0;appropriately. Thus those who notice such things will discover a subtle change in the mLite posting.
© Copyright Bruce M. Axtens, 2015