A byte is a block of 8 bits (binary digits). They can have a value between 0 and 255. The following are bytes:
01111001 - 121
00000011 - 3
10000000 - 128
In DarkBASIC, you don't have to worry about the binary value, just the number. It behaves exactly like an integer, except it must be non-negative and has a much smaller range.
The advantage of bytes over integers is that they are 4 times smaller. A long line of bytes (known as a memblock) can be made in DBPro. The following is a memblock:
100,8,56,78,93,42,201,99,67,43
To access the values out of this use the memblock byte command:
a = memblock byte(1,0)
b = memblock byte(1,1)
c = memblock byte(1,2)
etc.
To put values into a memblock use the write memblock byte command:
write memblock byte 1,0,a
write memblock byte 1,1,b
write memblock byte 1,2,c
The optomist's right, The pessimist's right.