Skip to content
Narta Xaymar Dirks edited this page Nov 1, 2026 · 9 revisions
BlitzLLVM

Byte 〔BlitzLLVM〕

Byte(value)
Byte:Int8(value)

Returns: The Byte.

Description

〔BlitzLLVM〕 This command does not exist in the original Blitz products. BlitzLLVM adds it.

Converts a number or a text to a Byte, an 8-bit integer from -128 to 127. This is a BlitzLLVM extension: the originals only know Int and Float. A whole number that is too large keeps its lowest 8 bits (Byte(128) is -128), a real is rounded to the nearest whole number (halves go to the even one) and stops at -128 or 127 if it is outside. Use SatByte to stop whole numbers at -128 and 127 as well.

The result is a Byte, which turns into an Int when it is calculated with.

Differences

  • Not in the originals, which have no integers of other sizes.

Examples

Print Byte(100)
Print Byte(200)
Print Byte(300.7)
Print Byte(-1000.0)
100
-56
127
-128

Related Commands

Double 〔BlitzLLVM〕, EndType, UByte 〔BlitzLLVM〕

Home · Command Index



Differences
Language Features
BlitzBasic
Blitz3D
BlitzPlus

Clone this wiki locally