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

UByte 〔BlitzLLVM〕

UByte(value)
UByte:UInt8(value)

Returns: The UByte.

Description

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

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

Differences

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

Examples

Print UByte(200)
Print UByte(-1)
Print UByte(256)
Print UByte(300.0)
200
255
0
255

Related Commands

Byte 〔BlitzLLVM〕, UInt 〔BlitzLLVM〕, ULong 〔BlitzLLVM〕, UShort 〔BlitzLLVM〕

Home · Command Index



Differences
Language Features
BlitzBasic
Blitz3D
BlitzPlus

Clone this wiki locally