Concept

Constants


Description

A constant is a fixed value.

Notes

Constants can have a type of Number (see below), String, Boolean, Color or Text.

There are three main type of Constants:

  • Local Constants that you define in your code using Const. When defining a constant this way the data types is inferred if it is omitted.

  • Project Item Constants that you define on the project item using the Constant Editor.

  • Localized Strings that you define on the project item using the Constant Editor.

Sample code

This is how you can declare Constants in code using the Const command:

Const kAnswerToLife As Integer = 42
Const kPi = 3.14156
Const kAppName As String = "MyApp"

Compatibility

All project types on all supported operating systems.