PDA

Click to See Complete Forum and Search --> : quick little byte-sized questions


Pickleloaf
Jan 30th, 2001, 12:07 AM
how much memory does a variant use?
and how much memory does a boolean use?

kedaman
Jan 30th, 2001, 01:20 AM
Variant: 16 bytes for any datatype except strings, which need 22 bytes + stringlength * 2
Boolean: 2 bytes

Mad Compie
Jan 30th, 2001, 12:17 PM
Isn't a boolean only 1 byte? I mean, what's the difference between an integer (2 bytes) and a boolean, if it's also 2 bytes.
I know in VB3, the boolean data type did not exist, so I presume that this type only uses 1 byte.
I'm not sure. Please correct me if necessary...

kedaman
Jan 30th, 2001, 12:21 PM
A boolean consumes 2 bytes, i know it sounds stupid but that's what it does, it's like enumerations, they are integers to allow negative numbers and -1 is true for a boolean variable, dunno if that's the connection..

Mad Compie
Jan 30th, 2001, 12:50 PM
So, for using one byte, do I need to declare String * 1 as data type?

kedaman
Jan 30th, 2001, 12:58 PM
byte datatype eats one byte and represents a numeric value from 0 to 255, if thats what you need. String*1 would consume 2 bytes and is represented as a string