Ver Mensaje Individual
  #1  
Antiguo 05-04-2006
fmtidona fmtidona is offline
Miembro
 
Registrado: sep 2005
Posts: 17
Reputación: 0
fmtidona Va por buen camino
Funciones en delphi

Este codigo me da error al compilarlo en la parte de la declaracion de la funcion, que estoy haciendo mal? gracias
Código Delphi [-]
unit aprendiendo;

interface

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

type
  TForm1 = class(TForm)
    Button1: TButton;
    Label1: TLabel;
    procedure Button1Click(Sender: TObject);
    function mul(x:integer):integer;
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

function mul(x:integer):integer;
begin
  mul:=(x*x);
end;

procedure TForm1.Button1Click(Sender: TObject);
var
  a:integer;
begin

   a:=mul(3);
   label1.Caption:=inttostr(a);

end;

end.
Responder Con Cita