Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Number to binary to number
Message
 
To
14/06/2006 03:34:28
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01128906
Message ID:
01128909
Views:
20
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?
"Navision is evil that needs to be erazed... to the ground"

Jabber: gorila@dione.zcu.cz
Jabber? Jabbim
Previous
Reply
Map
View

Click here to load this message in the networking platform