VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



convert a decimal to a binary , the decimal must be between 0 and 255

by sherif rofael (15 Submissions)
Category: Math/Dates
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Fri 19th July 2002
Date Added: Mon 8th February 2021
Rating: (1 Votes)

convert a decimal to a binary , "the decimal must be between 0 and 255

Rate convert a decimal to a binary , the decimal must be between 0 and 255




'by sherif rofael 

' mailto: [email protected]

' http://vbsherif.memebers.easyspace.com

' visit it and download any of my 25 programs there.


Cls
Open "C:\WINDOWS\DESKTOP\BINARY.TXT" For Append As #1
Print #1, , " "; ; "MSB", "        "; "LSB"
If X = "" Then X = 0
P = X
For K = 1 To 8
A = X / 2
M = Int(A)
I = (A - M) * 2
X = M
Select Case K
Case 1
I1 = I
Case 2
I2 = I
Case 3
I3 = I
Case 4
I4 = I
Case 5
I5 = I
Case 6
I6 = I
Case 7
I7 = I
Case 8
I8 = I
End Select
Next K
X = ""
Print #1, P, ":"; I8; I7; ; I6; I5; I4; I3; I2; I1
Close #1

Download this snippet    Add to My Saved Code

convert a decimal to a binary , the decimal must be between 0 and 255 Comments

No comments have been posted about convert a decimal to a binary , the decimal must be between 0 and 255. Why not be the first to post a comment about convert a decimal to a binary , the decimal must be between 0 and 255.

Post your comment

Subject:
Message:
0/1000 characters