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

Language Constants

Constant Example
The true value. TRUE
The false value. FALSE
Integer or Long numbers. 0, 123, -32769, 10000000000
Hexadecimal short signed integers. &H1F5, &HFFFF, &H0000FFFF, &FFFF
Hexadecimal signed integers. &H10BF332E, &10BF332E
Hexadecimal unsigned integers. &H8000&, &HFFFF&
Binary integers. &X1010010101, %101001011
Floating point numbers. 1.0, -5.345219E+45
Positive infinity +INF
Negative infinity -INF
String constants. "Hello World !"
String constants to be translated. ("This software is cool")
Null constant / void string. NULL

String escape characters

The string constants can contain the following escape characters:

Escape character ASCII equivalent
\n Chr$(13)
\r Chr$(10)
\t Chr$(9)
\b Chr$(8)
\v Chr$(11)
\f Chr$(12)
\e Chr$(27)
\0 Chr$(0)
\" Double quote
\\ Backslash
\xNN Chr$(&HNN)

Multi-line string constants

You can write a string constant in several successive parts, even on several different lines.

For example,

"Gambas" " is " "great"

or

"Gambas"
" is "
"great"

are absolutely the same constants as

"Gambas is great"

See also