From Clomosy Docs

(Created page with "Returns the absolute value of an integer.<br> '''Syntax:'''<br> value := Abs(value); '''Example:'''<br> Let's say you have a variable i. The type of this variable is assigned as integer. The value of this variable can be given an integer value. Here we have given a negative value. Finally, abs function was used to get the absolute value. <br> '''var''' i : Integer;<br> '''begin''' MyForm := TFrmClomosyBasisForm.Create(Self);<br> i := -1235; ShowMessage('Bef...")
 
No edit summary
Line 1: Line 1:
function Abs(Number Numeric type):Numeric type;
Returns the absolute value of an integer.<br>
Returns the absolute value of an integer.<br>



Revision as of 15:28, 28 February 2023

function Abs(Number Numeric type):Numeric type;

Returns the absolute value of an integer.

Syntax:

value := Abs(value);

Example:
Let's say you have a variable i. The type of this variable is assigned as integer. The value of this variable can be given an integer value. Here we have given a negative value. Finally, abs function was used to get the absolute value.

var
 i : Integer;
begin MyForm := TFrmClomosyBasisForm.Create(Self);
i := -1235; ShowMessage('Before: '+ IntToStr(i)); //The absolute value of i is taken and put back to i. i:= Abs(i); ShowMessage('After: '+IntToStr(i));
MyForm.Run;
end;