Results 1 to 3 of 3

Thread: helllllllllp me

  1. #1
    Guest

    Angry

    why in boolean we use 16 bits not 8 bit????????

  2. #2
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649
    Yes why isn't it just one bit?
    The simple answer is because Microsoft designed it that way.
    Before VB4 there was no Boolean data type but the values True and False existed.
    True is in VB -1 and False is 0.
    Since a VB Integer is still 16 bit and not 32 a value of -1 in binary would be 1111111111111111 and 0 would be 0000000000000000.
    When Microsoft introduced the Boolean data type in VB4 they could not change the values of True and False without breaking the backward compatability with older programs.

    That's why a Boolean must be of the same length as an Integer.

  3. #3
    Lively Member rekcus's Avatar
    Join Date
    Jan 1999
    Location
    Kuala Lumpur
    Posts
    122

    Lightbulb Very enlightening

    Shouldn't the question then be
    why in boolean we use 16 bits not 1 bit????????
    instead of
    why in boolean we use 16 bits not 8 bit????????
    penyou!

    "The code bytes.."

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