Type

Type

Type

Function

BT is a dynamically typed language. The variable itself has no fixed type, and the value carries the type at runtime. You can use type(value) to view script-visible type names.

Syntax

Built-in base type

TypeDescription
IntInteger.
FloatFloating point number.
BoolBoolean value.
StringString.
ArrayArray.
ObjectObject.
NullExplicit null or failure value.
EmptyMissing value.
RegexRegular expression.
FnFunction.
ClassClass.
InstanceClass instance.

Standard library object type

TypeDescription
FsFile system object.
DateDate and time object.
MathGlobal math object.
Base64Base64 encoding and decoding object.
MysqlMySQL builder object.
ReqwestHTTP request builder object.
ProcessProcess builder or child process object.
NetNetwork service or connection object.
DeviceDevice communication object.

The undefined extended object type

extended object returns the object type name declared by objects[].name in bindings.json. The internal identity of the extension object is still managed by the host using the module ID, type ID, and object ID, and the scripting layer only sees the readable, comparable type name.

Code Examples

Type conversion

Notes

  • empty represents missing values: the expression has no output, the variable is not initialized, the field or subscript does not exist, and the function parameter is not passed in.
  • null represents an explicit null or failure value: user-written null, JSON null, database NULL, parsing or conversion failure.
- json(empty) or an array or object containing empty will output the standard JSON null when serialized to JSON.
  • The extended object returns the specific object type name, such as Calc, Sqlite, SqliteQuery, and no longer returns the unified ExtObject.