Const Statement
рд╕реНрдЯреНрд░рд┐рдВрдЧ рдХреЛ рд╕реНрдерд┐рд░рд╛рдВрдХ рдХреЗ рд░реБрдк рдореЗрдВ рдкрд╛рд░рд┐рднрд╛рд╖рд┐рдд рдХрд░рддрд╛ рд╣реИ.
Syntax:
Const Text = Expression
рдкреИрд░рд╛рдореАрдЯрд░
Text: Any constant name that follows the standard variable naming conventions.
A constant is a variable that helps to improve the readability of a program. Constants are not defined as a specific type of variable, but rather are used as placeholders in the code. You can only define a constant once and it cannot be modified. Use the following statement to define a constant:
CONST ConstName=Expression
The type of expression is irrelevant. If a program is started, LibreOffice Basic converts the program code internally so that each time a constant is used, the defined expression replaces it.
рдЙрджрд╛рд╣рд░рдг:
Sub ExampleConst
Const iVar = 1964
MsgBox iVar
Const sVar = "Program", dVar As Double = 1.00
MsgBox sVar & " " & dVar
End Sub