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

UShort 〔BlitzLLVM〕

UShort(value)
UShort:UInt16(value)

Returns: The UShort.

Description

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

Converts a number or a text to a UShort, a 16-bit integer from 0 to 65535. 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 16 bits (UShort(-1) is 65535), a real is rounded to the nearest whole number (halves go to the even one) and stops at 0 or 65535 if it is outside. Use SatUShort to stop whole numbers at the limits as well.

Differences

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

Examples

Print UShort(-1)
Print UShort(65536)
Print UShort(70000.0)
65535
0
65535

Related Commands

Short 〔BlitzLLVM〕, UByte 〔BlitzLLVM〕, UInt 〔BlitzLLVM〕, ULong 〔BlitzLLVM〕

Home · Command Index



Differences
Language Features
BlitzBasic
Blitz3D
BlitzPlus

Clone this wiki locally