/

 

The manual

Self-training

Experimentation

Contact

 

Language

Variables and types

Local variables

The syntax for defining a variable is' var type variable_name', for example:

var Int i

The available types are:

Bool

a boolean (two possible values: 'false' or 'true')

Int

an integer (range of possible values?)

Float

a floating point number

Str

a character string

Dated

a date

Time

one hour

DateTime

a timestamp

Global variables

A global variable, for example to implement a record numbering counter, is declared as follows:

global Int counter "xxx/xxx/xxx"

where the value in quotes is the address of the Storga field block which stores the value of the variable, which is obtained by displaying the properties of the block.

Column variables

In a report, for the calculation of a calculated field, we sometimes want to be able to use a value that precedes a calculation carried out on the previous line. For this, we use the notation '\u003c-'

var Int somme <- 0
...
somme := somme + ...

Which reads: at the start of the processing of the first line of the report, the variable 'sum' is equal to zero, then it keeps its value from one line to another.