Setting Variables in the Database

Variables are placeholders named by you that always contain a specific, but variable, value. These have a variety of uses, including consecutive numbers (numbers that count up or down).

Variables can be used in data fields in database tables and reports. The “Variables” tab in “Database” → “Properties” can be used to create and assign starting values as well as to check and edit the current value.

Here you can also set the type of variable, according to the data type in your database.

How to use variables: To use a variable, you can refer to the current value of the variable using the name you have assigned. This can then be used anywhere from calculation formulas to reports.

You can assign a variable a specific value with the command

LET variable_name = specific_value

e.g.

LET counter = 1

here the variable that you have named “counter” will be assigned the start value “1.”

Unlike the mathematical “=” equals sign, the equals sign “=” in programming syntax indicates an assignment, which assigns what is on the right side of the equals sign to the left. To clearly differentiate between an assignment and an equation, “LET” is written in front of the command.

LET with the “=”commands can also be used for calculations:

LET counter= other_variable + 1

will add a “1” to the value of another variable and assign this value to the variable we have named “counter.”

You can also set a variable to count up (which makes a lot of sense for a counter variable):

LET counter= counter + 1

This command means: let the new value of “counter” (left) equal the value of old “counter” (right) plus a “1.”

Under “Storage” you have the option to choose an “Environment variable,” which is then available in your entire system.

Assignments (“LET a = …”), can only be used in the initial formula for a data field, which means they will only become active when a new record is created.

In reports, you can also fill the data for variables with “LET.”

Last updated by on October 30, 2019