Skip to content

Userlib Declarations

Narta Xaymar Dirks edited this page Oct 28, 2026 · 3 revisions

Userlib declarations

A .decls file takes the same two ways to write a type as the language, for the parameters and the return type of a function, and they can be mixed in one file: Scale#(value#, factor#) is the same as Scale:Float(value:Float, factor:Float). The long form is available for every type: Byte, UByte, Short, UShort, Int, UInt, Long, ULong, Half, Float, Double and String (the names of the language, not case sensitive), plus Pointer for a bank or object parameter (memory* is the short form) and Void for a function that returns nothing (the default). Pointers can not be returned. The short form has %, %%, #, ##, $ and *, and a name without a type is still an Int. A decorated name after the closing bracket (:"_Name@8") still works, and the : there is not confused with the one of a type, because a type comes before the bracket.

The original only had Int, Float and String. Numbers are passed as C types of the same size (int8_t, uint16_t, int64_t, double, ...); numbers smaller than 32 bits are sign extended or zero extended by the caller, like C compilers do. Half is passed as a half precision float (_Float16), which no test covers. blitzcc +k lists them like Blitz3D does: % for every integer type, # for every float type and $ for strings (Scale# ( value#,factor# ), Big% ( value% )), so the exact size is not shown. blitzcc --dump-keywords lists them with the exact types (Scale:Float32 value:Float32, factor:Float32, Big:Int64 value:Int64) and Pointer for banks and objects.

Home · Command Index



Differences
Language Features
BlitzBasic
Blitz3D
BlitzPlus

Clone this wiki locally