首页 > cat > constdecl 
 en fr de es it nl pl pt pt_BR mk sq ca hu cs tr ar fa id vi ko ja ru zh eo
前一个  下一个  编辑  重命名  撤销  刷新  搜索  管理  
文档
历史
 
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 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.

Example

PUBLIC CONST MAX_FILE AS Integer = 30

PRIVATE CONST DEBUG AS Boolean = TRUE

PRIVATE CONST MAGIC_HEADER AS String = "# Gambas form file"

参见

Variable Declaration, Using reserved keywords as identifiers