Gambas Documentation
Application Repository
Code Snippets
Compilation & Installation
Components
Controls pictures
Deprecated components
Developer Documentation
Development Environment Documentation
Documents
Error Messages
Gambas Playground
How To's
Language Index
Language Overviews
Arithmetical Functions
Arithmetic Operators
Array Declaration
Assignment Operators
Assignments
Binary Data Representation
Bits Manipulation Functions
Character Test Functions
Comparison methods
Complex numbers
Constant Declaration
Constant Expression
Conversion Functions
Datatype Functions
Datatypes
Date & Time Functions
Enumeration declaration
Error Management
Event Loop
Event Management
Events declaration
Expressions
External Function Management
File & Directory Functions
File & Directory Paths
File mode syntax
Floating Point Numbers
Formatting functions
Gambas Object Model
Global Special Event Handlers
Integer numbers
Intrinsic Functions
Language Constants
Localization and Translation Functions
Local Variable Declaration
Logarithms & Exponentials Functions
Logical Operators
Loop Control Structures
Method Declaration
Miscellaneous Control Structures
Miscellaneous Functions
Native Arrays
Native Container Classes
Object & Class Management
Operator Evaluation Order
Predefined Constants
Process Management
Property Declaration
Random Numbers Functions
Special Methods
Stream & Input/Output functions
String Functions
String Operators
Structure declaration
Test Control Structures & Functions
Trigonometric Functions
User-defined formats
Using reserved keywords as identifiers
Variable Declaration
Last Changes
Lexicon
README
Search the wiki
To Do
Topics
Tutorials
Wiki License
Wiki Manual

Datatypes

Native datatypes

Datatype Description Default value Size in memory
Boolean True or false. FALSE 1 byte
Byte 0...255 0 1 byte
Short -32.768...+32.767 0 2 bytes
Integer -2.147.483.648...+2.147.483.647 0 4 bytes
Long -9.223.372.036.854.775.808...+9.223.372.036.854.775.807 0 8 bytes
Single Like the float datatype in C. 0.0 4 bytes
Float Like the double datatype in C. 0.0 8 bytes
Date Date and time, each stored in an integer. NULL 8 bytes
String A variable length string of characters. NULL 4 bytes on 32 bits systems,
8 bytes on 64 bits systems.
Variant Any datatype. NULL 12 bytes on 32 bits systems,
16 bytes on 64 bits systems.
Object Anonymous reference to any object. NULL 4 bytes on 32 bits systems,
8 bytes on 64 bits systems.
Pointer A memory address. 0 4 bytes on 32 bits systems,
8 bytes on 64 bits systems.

Arrays

Each native datatype has an associated array datatype whose name is the name of the native datatype followed by square brackets: Boolean[], Byte[], Short[], Integer[], Single[], Float[], String[], Date[], Variant[], Pointer[], and Object[].

Moreover, any datatype can have an array equivalent. For example: String[][], for an array of string arrays ; Collection[] for an array of collections ; and so on.

The class of non-native datatype arrays is created on the fly by the interpreter.

See also