# Programming in Free Pascal language

The most important commands from Free Pascal programming language in one place, a unique comparison and each command-operator is shown using a piece of program. Statements-operators of these sample programs are clickable, so with a simple click we have more information available.## Programming language Free Pascal:

## Lexical elements

Lexical elements are numeric, string constants and comments in the code.

## Types and variables

Types and variables are closely related because variables are the most important elements of our program in which we store data, partial results of our calculations. Types tell us what data can be stored in variables.

## Program structure

## Operators

Operators perform an operation between the operands, this operation can be mathematical, logical, or bitwise.

## Statements

Statements are important elements for writing programs. Generally one statement line corresponds to one line program. The main group of the statements are: cycles, program branching and flow control.

### Free Pascal

```
i := x * 5;
while i>0 do
if i=10 then
break
else
begin
dec(i)
end;
```

### Examples - Free Pascal

### Free Pascal

```
x:= 3.14159265359; // x = 3.14159274
y:= 123456789; // y = 123456792.0
y :=single((x * y)); // z = 387850976.0
```

### Free Pascal

```
x:= true; y:= false;
b:= x; // b = true
b2:= x and y; // b2 = false
b3:= Boolean( 0); // b3 = false
```

### Free Pascal

Other pieces of example codes:if y < 100 then inc(x);

2 shl 2

b3:= Boolean( 0);

y + 3

15 +7.5

x = 6

Programming languages