str2bin not behaving?

Author Message

Joined: 11/12/2012
Location: United Kingdom
Posts: 4799
Posted: 03:52pm 04 Mar 2021      

str2bin and bin2str are used for packing the binary representation of a number into a string. The normal use is for writing binary to and from a file or for converting a string containing binary values such as received from some I2C devices into a MMBasic number. For your usage you need to look at functions like VAL and BIN$