BYTE : Standard data type: 8 bit signed : BYTE , signed integer , value = -128 to +127
UBYTE : Standard data type: 8 bit unsigned. Equivalent to Unsigned Byte. : UBYTE , unsigned integer , value = 0 to +255
nimdays wrote:@Trinity , Thanks
I'm confused because the variable is ubyte and then integer :)
You are very welcome :-)
Honestly , had I not looked it up I would not have known either , but generally it's always a good idea to consult the manual though sometimes it can be hard to find what one wants.
But if you are in doubt about a "keyword" then you can look in Alphabetical Keywords List : https://www.freebasic.net/wiki/wikka.ph ... gFullIndex
and sometimes problem can be of a kind where we may need to look at the categories in the Functional Keyword List : https://www.freebasic.net/wiki/wikka.ph ... FunctIndex
and last but not least then the search feature in the .chm help file is always very useful too :-)
Yes, I confess, my explanation was a bit ambiguous. With "integer" I meant the native meanig of that word, not the keyword.
"BYTE" (respectively "UBYTE") means an 8-bit-wide integer value (in opposite to a decimal value)
"SHORT" means a 16-bit-wide integer value
"LONG" means a 32-bit-wide integer value
"LONGINT" means a 64-bit-wide integer value
"INTEGER" (the keyword) means a 32-bit-wide integer value in a 32bit environment and a 64-bit-wide integer value in a 64bit environment.
BTW: To convert a floating point number to a string I would recommend using the "STR()" - function.