unit FProbUnit; {$mode objfpc}{$H+} interface uses Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls, functionslib; type { TFForm } TFForm = class(TForm) CancelBtn: TButton; ComputeBtn: TButton; DF1Edit: TEdit; DF2Edit: TEdit; ProbEdit: TEdit; FEdit: TEdit; Label1: TLabel; Label2: TLabel; Label3: TLabel; Label4: TLabel; ResetBtn: TButton; ReturnBtn: TButton; procedure ComputeBtnClick(Sender: TObject); procedure ResetBtnClick(Sender: TObject); private { private declarations } public { public declarations } end; var FForm: TFForm; implementation { TFForm } procedure TFForm.ResetBtnClick(Sender: TObject); begin FEdit.Text := ''; DF1Edit.Text := ''; DF2Edit.Text := ''; ProbEdit.Text := ''; end; procedure TFForm.ComputeBtnClick(Sender: TObject); VAR F, df1, df2, prob : extended; outvalue : string; begin F := StrToFloat(FEdit.Text); df1 := StrToFloat(DF1Edit.Text); df2 := StrToFloat(DF2Edit.Text); prob := probf(F,df1,df2); outvalue := format('%6.4f',[prob]); ProbEdit.Text := outvalue; end; initialization {$I fprobunit.lrs} end.