{{fbdoc item="title" value="CONST"}}---- Non-modifiable variable declaration. {{fbdoc item="syntax"}}## **Const** //symbolname1// [AS [[DataType|DataType]]] = //value1// [, //symbolname2// [AS [[DataType|DataType]]] = //value2//, ...] //or// **Const** [AS [[DataType|DataType]]] //symbolname1// = //value1// [, //symbolname2// = //value2//, ...] ## {{fbdoc item="desc"}} Declares non-modifiable constant data that can be integer or decimal (floating-point) numbers or strings. The constant type will be inferred if ##[[DataType|DataType]]## isn't explicitly given. Specifying ##[[KeyPgString|String * size]]##, ##[[KeyPgZstring|Zstring * size]]## or ##[[KeyPgWstring|Wstring * size]]## as ##[[DataType|DataType]]## is not allowed. Specifying ##[[KeyPgString|String]]## as ##[[DataType|DataType]]## is tolerated but without effect because the resulting type is always a ##[[KeyPgZstring|Zstring * size]]##. Constants follow visibility rules similar to those of variables for Namespace blocks, Type blocks, and compound block statements. {{fbdoc item="ex"}} {{fbdoc item="filename" value="examples/manual/variable/const.bas"}}%%(freebasic) const Red = RGB(252, 2, 4) const Black as uinteger = RGB(0, 0, 0) const Text = "This is red text on a black bkgnd." locate 1, 1 color Red, Black print Text sleep end %% {{fbdoc item="diff"}} - QB does not support the ##[[KeyPgAs|as]]## ##[[DataType|datatype]]## syntax. {{fbdoc item="see"}} - ##[[KeyPgPpdefine|#Define]]## - ##[[KeyPgConstQualifier|Const (Qualifier)]]## - ##[[KeyPgConstMember|Const (Member)]]## - ##[[KeyPgEnum|Enum]]## - ##[[KeyPgVar|Var]]## {{fbdoc item="back" value="CatPgVariables|Variable Declarations"}}