unit SystemAbs;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    Edit1: TEdit;
    Edit2: TEdit;
    Label1: TLabel;
    Label2: TLabel;
    Edit3: TEdit;
    Edit4: TEdit;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

// BeginExample: SystemAbs
// Routine: System.Abs

// BeginCode
{
This example converts negative floating point numbers and
integers to postive.
}
procedure TForm1.Button1Click(Sender: TObject);
begin
  Edit1.Text := '-2.3';
  Edit3.Text := FloatToStr(Abs(StrToFloat(Edit1.Text)));	{ 2.3 }
  Edit2.Text := '-157';
  Edit4.Text := IntToStr(Abs(StrToInt(Edit2.Text)));	{ 157 }
end;
// EndCode
// EndExample: SystemAbs
end.
