Files

61 lines
1.0 KiB
ObjectPascal
Raw Permalink Normal View History

unit ProbzUnit;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
StdCtrls, functionslib;
type
{ TProbzForm }
TProbzForm = class(TForm)
ReturnBtn: TButton;
CancelBtn: TButton;
ResetBtn: TButton;
ComputeBtn: TButton;
ProbzEdit: TEdit;
Label2: TLabel;
zEdit: TEdit;
Label1: TLabel;
procedure ComputeBtnClick(Sender: TObject);
procedure ResetBtnClick(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
var
ProbzForm: TProbzForm;
implementation
{ TProbzForm }
procedure TProbzForm.ResetBtnClick(Sender: TObject);
begin
zEdit.Text := '';
ProbzEdit.Text := '';
end;
procedure TProbzForm.ComputeBtnClick(Sender: TObject);
VAR
zprob, z : double;
outvalue : string;
begin
z := StrToFloat(zEdit.Text);
zprob := 1.0 - probz(z);
outvalue := format('%6.4f',[zprob]);
ProbzEdit.Text := outvalue;
end;
initialization
{$I probzunit.lrs}
end.