DATA Section

As stated in Structure of LDPL Source Code, LDPL programs are divided in two sections, one of them being the DATA section. The DATA section is where global variables are declared (you can use them anywhere in your program). If no variables are declared, the DATA section can be skipped altogether.

All variables in LDPL have a defined data type.

Available data types are NUMBER, TEXT, NUMBER LIST, TEXT LIST, NUMBER MAP and TEXT MAP.

The DATA section is defined and preceded by the DATA: keyword. An empty data section looks like this:

DATA:

On every line within the DATA section (that is, on every line after the DATA: keyword and before the PROCEDURE: keyword) one and only one variable can be declared.

The syntax for declaring a variable in LDPL is:

variable name IS data type

Variable names should follow the rules stated here.

A DATA section cannot contain anything but variable declarations, comments and empty lines. En example DATA section may end up looking like this:

DATA: #This is the DATA section
myNumber IS NUMBER
#Next I'm going to declare a text map
niceTextMap IS TEXT MAP
myAwesomeList IS NUMBER LIST # I've declared a number list!
PROCEDURE:
#This is a comment within the PROCEDURE section!