Results 1 to 12 of 12

Thread: [RESOLVED!] Need an explanation for this (decimal -> binary)

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2007
    Location
    Netherlands
    Posts
    71

    Talking [RESOLVED!] Need an explanation for this (decimal -> binary)

    Hi, i want to convert decimal numbers to binary numbers.
    this code here is working, only I dont understand it really... can sb explain
    what this code does exactally?

    and 2de question, I just can't find a code wich converts binary to decimal
    sb knows a code for it???

    Code:
    Dim Number As Integer
    Dim Binary_String As String 
    Number = Val(Text1.Text)
    Binary_String = ""
    While Number > 0    
    Binary_String = Str(Number Mod 2) & Binary_String    
    Number = Number \ 2
    Wend
    Text2.Text = Binary_String
    Last edited by ///Jeffrey\\\; Mar 18th, 2007 at 12:52 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width