Advertisement
4_2005-2006 Coding Standards #167760

A Binary Printing with only 10 lines of code !

This procedure prints the binary code of a number on Immediate window.

AI

ИИ-обзор: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Исходный код
original-source
Public Sub PrintBinary(Num As Long)
 Dim j&, i&
 j = 128
 For i = 8 To 1 Step -1
 If (Num And j) = 0 Then
  Debug.Print "0";
 Else
  Debug.Print "1";
 End If
 j = j / 2
 Next
End Sub
Оригинальные комментарии (3)
Восстановлено из Wayback Machine