Hi Agnes,
that's some really nice addition to my code. I just opened up my Blog for anonymous comments, so if you like, you will be able to put your code in now. :-)
However, if you don't mind, I'd like to add it to my blog-function directly, too.
>Hi Thomas,
>
>I found the Text2Bin example in your blog.
>
>I found it very usefull - to convert integers to binarys.
>
>Since I have no idea how to comment your blog, I like to share the code via UT
>
>
>*betweeen
>**?lcBinString
>
>lnI = 0x000109C1
>lcBin = Int2Bin(lnI)
>lcNib = Int2Nibble(lnI)
>lnBin = Bin2Int(lcBin)
>lnNib = Nibble2Int(lcNib)
>
>?lnI,TRANSFORM(lnI,'@0')
>?lcBin,lnBin,TRANSFORM(lnBin,'@0')
>?lcNib,lnNib,TRANSFORM(lnNib,'@0')
>
>FUNCTION Nibble2Int AS INTEGER
> LPARAMETERS;
> tcString
>
> RETURN Bin2Int(CHRTR(tcString,' ',''))
>ENDFUNC
>
>FUNCTION Bin2Int AS INTEGER
> LPARAMETERS;
> tcString
>
> RETURN INT(VAL(STUFF(TRANSFORM(0h+Bin2Char(PADL(tcString,32,'0'))),2,1,'x')))
>ENDFUNC
>
>FUNCTION Int2Nibble AS STRING
> LPARAMETERS;
> tiInt
>
> RETURN STUFF(STUFF(STUFF(STUFF(STUFF(STUFF(STUFF(Int2Bin(tiInt),29,0,' '),25,0,' '),21,0,' '),17,0,' '),13,0,' '),09,0,' '),05,0,' ')
>ENDFUNC
>
>FUNCTION Int2Bin AS STRING
> LPARAMETERS;
> tiInt
>
> RETURN Char2Bin(EVALUATE(STUFF(TRANSFORM(tiInt,'@0'),2,1,'h')))
>ENDFUNC
>
>*and
>**FUNCTION Char2Bin AS STRING
>
>
>
>Agnes
Best Regards
-Tom
Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it.
Oh, and BTW: 010101100100011001010000011110000101001001101111011000110110101101110011