unit PEDIRBASE;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Buttons;

type
  TFPEDIRBASE = class(TForm)
    Edit1: TEdit;
    Label1: TLabel;
    bok: TBitBtn;
    bcancelar: TBitBtn;
    procedure bokClick(Sender: TObject);
    procedure Edit1KeyPress(Sender: TObject; var Key: Char);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  FPEDIRBASE: TFPEDIRBASE;

implementation

{$R *.dfm}

procedure TFPEDIRBASE.bokClick(Sender: TObject);
 VAR AUX:DOUBLE;
begin
  TRY
    AUX := STRTOFLOAT(EDIT1.Text);
    SELF.ModalResult  := MROK;
  EXCEPT
    SHOWMESSAGE('EL NUMERO INTRODUCIDO NO ES CORRECTO. VUELVA A INTRODUCIRLO');
    EDIT1.SETFOCUS;
    EXIT;
  END;
end;

procedure TFPEDIRBASE.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
   if (key = #46) then // 46 -> .
          key := #44 ;  //44->  ,
end;

end.
