Constant Declaration

{ PUBLIC | PRIVATE } CONST Identifier AS Datatype = ConstantValue

This keyword declares a class global constant.

This constant is accessible everywhere in the class it is declared.

If the PUBLIC keyword is specified, it will be also accessible to the other classes having a reference to an object of this class.

Constant datatype can be: Boolean, Integer, Long, Float or String.

Sinds 3.17

Integer constants can also be defined with a constant expression.

Examples

Public Const MAX_FILE As Integer = 30

Private Const Debug AS Boolean = True

Private Const MAGIC_HEADER As String = "# Gambas form file"

See also