08-19-2008, 08:09 AM
Function DecToBin
Function DecFromBin
-------------
I don't know how parallel port works more than i can read in http://logix4u.net/Legacy_Ports/Paralle ... acing.html
;/
function i str&sBin
;Converts from decimal (base-10) number to binary (base-2) number, eg 5 to "101".
;Although there are 32 bits, leading 0 bits are trimmed.
;EXAMPLE
;str s
;DecToBin 5 s
;out s
sBin.all(32)
itoa i sBin 2
sBin.fix
Function DecFromBin
;/
function# $sBin
;Converts from binary (base-2) number to decimal (base-10) number, eg "101" to 5.
;EXAMPLE
;int i=DecFromBin("101")
;out i
if(!sBin) ret
ret strtoul(sBin 0 2)
-------------
I don't know how parallel port works more than i can read in http://logix4u.net/Legacy_Ports/Paralle ... acing.html