Results 1 to 13 of 13

Thread: Decimal to binary error

Threaded View

  1. #1

    Thread Starter
    Member
    Join Date
    Nov 2014
    Posts
    58

    Decimal to binary error

    I've been trying to fix this code for a school project but still can't. Please help I'm newbie. Need to convert max of 10 decimal numbers to binary but this code only limited to 4 dec digits.


    Code:
    Dim number as integer
    Dim binary_string as string
    
    Number = val (text1.text)
    Binary_string = " "
    Do while number > 0
        Binary_string = number mod 2  & binary_string
        Number = number / 2
    Loop
    Text2.text = binary_ string
    
    End sub
    Last edited by dday9; Aug 16th, 2022 at 07:29 AM.

Tags for this Thread

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