Hi Jos,
lcPom="00000000000000011110001001000000"
liLen=LEN(lcPom)-1
liy=0
FOR lii=liLen TO 0 STEP -1
IF SUBSTR(lcPom,lii+1,1)="1"
liy=BITSET(liy,liLen-lii)
ENDIF
next
?liy
MartinJ
>Hi All
>
>I have written my own number to binary to number function but I thought I would ask if there was an easier method. I am looking to take number eg 123456 and convert that into a binary string like "00000000000000011110001001000000". Is there a fast way to do this num to char-bin and back to number?