by Eduardo B. Castro (1 Submission)
Category: Coding Standards
Compatability: VB Script
Date Added: Wed 3rd February 2021
Rating: (3 Votes)
This procedure prints the binary code of a number on Immediate window.
Num as Long
You can easily change the procedure to a function for returning the binary code.
Public Sub PrintBinary(Num As Long)
Dim j&, i&
j = 128
For i = 8 To 1 Step -1
If (Num And j) = 0 Then
j = j / 2