convertTextToBinary

JB sundown at pacifier.com
Mon Sep 29 13:35:13 EDT 2014


A few years ago there was a discussion about
converting ascii to binary code and ff I am
correct the code below was the final version.

function convertTextToBinary varText --THE FASTEST
     repeat with n = 1 to the number of chars of varText
           put chartonum(char n of varText) into theNum
           put baseConvert(theNum,10,2) into tBaseConverted
           put char -8 to -1 of ("00000000" & tBaseConverted ) into tBaseConverted
           put tBaseConverted after tConverted
     end repeat
     return tConverted
end convertTextToBinary


Does anyone know how to change this code so it
will put the converted text on more than one line?
It appears there is a limit to how many characters
you can put on one line in a field so if you have a
large text file to read and convert when it is put in
a field you end up losing part of it.

John Balgenorth


More information about the use-livecode mailing list