PDA

Click to See Complete Forum and Search --> : Boolean = 16 bit in VB... Is this true ??


Inhumanoid
Nov 25th, 1999, 03:11 PM
Is a boolean 2 byte in vb ??

Crazy D
Nov 25th, 1999, 04:16 PM
Yes, a boolean is 2 bit..
You can check it with the LenB function.

c@lle
Nov 25th, 1999, 06:27 PM
I think there IS a little difference between bits and bytes! ;)

Inhumanoid
Nov 25th, 1999, 06:57 PM
If only it where 2 bit ;)

But seriously... I was almost sure it was 16 bit.... I just needed somebody's confirmation... So Crazy D's reply was clear enough to me.... :)

[This message has been edited by Inhumanoid (edited 11-26-1999).]

Joacim Andersson
Nov 25th, 1999, 07:20 PM
Yes, it's true! A boolean is actually an integer, so you will not save any memory on using it. It's just as fast as an integer though, and most important it's safe to use.

By safe I mean that you can't give it any other values than those intended (true or false). Actually the boolean data type didn't exist in VB before version 4. The reason it was included was to be used in classes where you wanted to have properties with only boolean values.

------------------
Joacim Andersson
joacim@programmer.net
joacim@yellowblazer.com
www.YellowBlazer.com (http://www.YellowBlazer.com)