Advertisement
7_2009-2012 Coding Standards #235314

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