{"id":20,"date":"2004-12-26T19:38:22","date_gmt":"2004-12-26T11:38:22","guid":{"rendered":"http:\/\/192.168.0.1\/blog_4.4.2\/?p=20"},"modified":"2006-03-31T14:34:03","modified_gmt":"2006-03-31T06:34:03","slug":"vb-function-decimal-to-binary","status":"publish","type":"post","link":"https:\/\/blog.worren.net\/?p=20","title":{"rendered":"VB Function &#8212; decimal to binary"},"content":{"rendered":"<div class='drop-case'> <p> Edited by Worren<\/div>\n <p>  <!--more--> \n<pre><code>\r\n\r\nFunction Bin(strINT As String)\r\n\r\n    Dim strBIN As String\r\n    Dim i As Long, j As Long, L As Long\r\n\r\n    L = Val(strINT)\r\n\r\n    If L &lt; 1 Then Exit Function\r\n\r\n    strBIN = \\\"\\\"\r\n    For i = (Log(L) \/ Log(2)) To 0 Step (-1)\r\n        If L And (2 ^ i) Then\r\n            strBIN = strBIN &amp; \\\"1\\\"\r\n        Else\r\n            strBIN = strBIN &amp; \\\"0\\\"\r\n        End If\r\n    Next\r\n    \r\n    If Left(strBIN, 1) = \\\"0\\\" Then strBIN = Right(strBIN, Len(strBIN) - 1)\r\n    \r\n    Bin = strBIN\r\n\r\nEnd Function\r\n\r\n\r\n\r\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":" <p> Edited by Worren <\/p> \n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[4],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.worren.net\/index.php?rest_route=\/wp\/v2\/posts\/20"}],"collection":[{"href":"https:\/\/blog.worren.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.worren.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.worren.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.worren.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=20"}],"version-history":[{"count":0,"href":"https:\/\/blog.worren.net\/index.php?rest_route=\/wp\/v2\/posts\/20\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.worren.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=20"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.worren.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=20"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.worren.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=20"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}