Skip to content

Language Features Types

Narta Xaymar Dirks edited this page Nov 2, 2026 · 4 revisions

Language Features: Types

Integers, floats and strings, the short and long notation, and converting between them.

Every variable, parameter, function result and field has a type. The originals have three: integers (Int), floats (Float) and strings (String), plus the custom types you declare with Type. BlitzLLVM adds more sizes, see Numbers-of-Other-Sizes, Number-Suffixes and Types.

A type is written in one of two ways. The short notation puts a character right behind the name: count% is an Int, speed# a Float, name$ a String, big%% a Long, exact## a Double and p.Point an object of the custom type Point. The long notation puts the type behind a colon: count:Int, speed:Float, name:String, big:Long, exact:Double. Both work for variables (Local, Global, Const), parameters, function results (Function Area:Float()) and Fields. A name without a type is an Int. The long notation is preferred, and the short-type-notation warning (level 3) can point out the short one; the long notation and the types beyond Int, Float and String are not in the originals.

Long notation Short Size and range
Int / Int32 % 32-bit integer, -2147483648 to 2147483647
Float / Float32 / Single / Real / Real32 # 32-bit real
String $ Text
Byte / Int8, UByte / UInt8 8-bit integer, with and without a sign
Short / Int16, UShort / UInt16 16-bit integer, with and without a sign
UInt / UInt32 32-bit integer without a sign
Long / Int64, ULong / UInt64 %% for Long 64-bit integer, with and without a sign
Half / Float16 16-bit real
Double / Float64 ## 64-bit real

Converting to a type is done with a function of the same name: Int, Float, Str, Handle and Object below, and Byte, UByte, Short, UShort, UInt, Long, ULong, Half, Double and Single (the same as Float) for the types BlitzLLVM adds. An Int assigned to a Float, and the other way around, is converted for you.

Back to Language Features or the Command Index.

Home · Command Index



Differences
Language Features
BlitzBasic
Blitz3D
BlitzPlus

Clone this wiki locally