Create a Simple Variable
(Available from version 7.0 onwards.)
A simple variable is a variable of type Text, Number, Decimal, DateTime, or Boolean. All simple variables in a project, after creation, are listed on the Assets Panel under Variables.
To create a simple variable:
-
On the Assets Panel, hover over Variables, and click .
The Variables and Types panel is displayed.
-
From the Type dropdown, select a Simple variable type.
-
Enter the Variable Name of the new variable. Each variable must have a unique name.
-
[Optional] Specify the Initial Value of the variable when the solution is executed. If you do not specify an initial value, the variable value will be set as follows:
-
Text: (Blank)
-
Number: 0
-
Decimal: 0.0
-
DateTime: The default is set to the time at which the variable was first created in the project.
-
Boolean: False
-
-
[Optional] Enter a Description.
-
The variable is created, and listed under Variables in the Assets Panel.
Best Practices
Note the following best practices:
-
Use simple variables to store frequently used constant values. For example, create a text variable to store the text for a warning message that is used in multiple locations, or a decimal variable to store a frequently used value, such as a tax percentage. Doing so will simplify maintenance of your project, as opposed to hard coding such values into your project in multiple locations.
Naming convention: Recommended practice is to name variables that hold constants with capital letters, for example WARNING MESSAGE or SALES TAX.