# <H1 align="center">Module «Calculation»</h1>

<p> The «Calculation» module is a connecting module or a module for pre- and post-processing data from other modules. This module is necessary for creating, calculating and changing values of variables.</p> 

## Module interface
<p> The module window is really simple and consists only of an entry field and the «Save» and «Cancel» buttons.
<H1 align="center">![Screenshot](img/calculation_1.png)</h1> 
<p> The «Expression» field. The operations that need to be done with variables are entered into this field. This can be addition, subtraction, multiplication or function calculation. 
<p> Supported operations
<p> ●	+ (addition);
<p> ●	- (subtraction);
<p> ●	* (multiplication);
<p> ●	/ (devision);
<p> ●	% (remainder of the division);
<p> ●	\ (integer from division);
<p> ●	^ (exponentiation).
<p> All lines should look like this «Variable = Operation;», operation can consist of a single number or a line, as well as several operands connected by the operators specified above, or it can be a function.
<p> Each line should be separated by the «;» symbol.
## Example of working with the module
<p> Suppose you want to get the last day of the previous month. You can do this by entering the following code: 
<H1 align="center">![Screenshot](img/calculation_2.png)</h1> 
<H1 align="center">![Screenshot](img/calculation_3.png)</h1> 
<p> What are we doing here? Here, we're getting today's date, for example, today is 25th of march, subtract one day more from today’s date than it actually is, meaning that, 26 days and end up in the last day of the previous month - February 29 (if the year is a leap year). In more details:
<p> 1st line – Using  GetDate function which returns today's date and saves its result in a variable @now (@now = 25.03.2020);
<p> 2nd line - the use of the GetDay function, which takes one parameter - the date, and returns only the day from the date supplied to it. Let's set today's parameter as the parameter, which lies in the @now variable. We enter the result of the function to the variable @day (@day = 25);
<p> 3rd line – increasing the @day variable by one (@day = 26);
<p> 4th line – using the DateAdd function, which takes three parameters: the first parameter - «day», «month» or «year» - is the component of the date that we are working with, the second parameter is the amount that is added to the selected component of the date, and the third parameter is the date with which the manipulation is performeed. Subtract 26 days from today's date - use DateAdd with parameters:
<p> 1.	day – subtracting date ;
<p> 2.	–@day – we add the minus because the function adds by default
<p> 3.	@now – today's date.
<p> In result, we subtract 26 days from 25.03.2020 and end up on 29.02.2020.



