function power en delphi
Publicado por pablo (25 intervenciones) el 04/12/2009 20:49:30
hola a todos tengo problemas con la compilacion cuando uso functions y procedures,
aqui les mando un ejemplo para que me digan que esta mal y que debo hacer.
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Edit1: TEdit;
Button1: TButton;
Edit2: TEdit;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
function Power(const Base, Exponent: Extended): Extended;
begin
Edit2.Text := FloatToStr(
Power(StrToFloat(Edit1.Text),(1/2)));
end;
end.
aqui les mando un ejemplo para que me digan que esta mal y que debo hacer.
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Edit1: TEdit;
Button1: TButton;
Edit2: TEdit;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
function Power(const Base, Exponent: Extended): Extended;
begin
Edit2.Text := FloatToStr(
Power(StrToFloat(Edit1.Text),(1/2)));
end;
end.
Valora esta pregunta
0