Home > lang > constdecl 
 fr de es it nl pl pt pt_BR mk sq ca ar fa vi ja ru zh zh_TW eo
Previous  Next  Edit  Rename  Undo  Refresh  Search  Administration  
Documentation
History
 
Constant Declaration
Syntax
{ PUBLIC | PRIVATE } CONST Identifier AS Datatype = Constant value

CONST declares a class global constant.

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

If the PUBLIC keyword is specified, it is 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.

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

Variable Declaration