Byte

Category: Keywords

Syntax:

Byte:Type()



Returns

Type



Summary

A whole number from 0 to 255, in one byte

Byte is a whole-number type that takes one byte of memory and holds 0 to 255. A value outside that range wraps round: 256 is stored as 0, 300 as 44 and -1 as 255.

Mostly used for arrays of raw data, where it takes a quarter of the memory of an Int array: file contents read with fileReadBytes, image or level data, anything byte by byte. In sums it acts like an Int. Use ToInt to put an element into an Int variable.

View detailed documentation online



Example
Global buffer:Byte[2048]

Local f:Int = fileReadFile("level.dat")
Local got:Int = fileReadBytes(f, buffer, 2048)
fileCloseFile(f)
Local first:Int = ToInt(buffer[0])
Print "First byte: " & ToString(first)

BambooBasic © 2026 Michael Denathorn