Errors ''[Error] Calculadora.pas(58): Declaration of 'Numero' differs from previous declaration"

I have the following:
unit Calculadora;

interface

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

type
  TFrmCalc = class(TForm)
    Uno: TButton;
    Dos: TButton;
    Tres: TButton;
    Cuatro: TButton;
    Cinco: TButton;
    seis: TButton;
    Siete: TButton;
    Ocho: TButton;
    Nueve: TButton;
    Cero: TButton;
    Punto: TButton;
    Igual: TButton;
    Sumar: TButton;
    Restar: TButton;
    Multipicar: TButton;
    Dividir: TButton;
    Ce: TButton;
    Display: TMemo;
    procedure FormCreate(Sender: TObject);
    procedure UnoClick(Sender: TObject);
    procedure Numero(Display: TObject; num:char; var flag:Boolean);
  private
    //Declaraciones Privadas
  public

  end;

var
  FrmCalc: TFrmCalc;
  Nume1: Real;
  Operador: Char;
  EFlagcons: Boolean;
  Resultado: Variant;
  ERes: Real;
  Flagpor: Boolean;
  EFlagpunto: Boolean;
  Flagop: Boolean;

implementation

{$R *.dfm}

procedure TFrmCalc.FormCreate(Sender: TObject);
begin
display.Text:='0'; {Cadena 0 para el display}
end;
*********************************************************
procedure TFrmCalc.Numero (Display: Tmemo; num:char; var flag:Boolean);
*********************************************************
begin
if (display.text = '0') then {verifica el '0'}
  display.text:=num
else
begin
  if flag=true then {flag indica si esta en alguna operacion}
  begin
  display.text:=num;
  flag:=false
end
else
  display.text:=display.text+num;
  end
end;

procedure TFrmCalc.UnoClick(Sender: TObject);
begin
Numero (Display, '1' ,flagop)
end;

end.


The line wich is in '********' gives the following errors:

[Error] Calculadora.pas(58): Declaration of 'Numero' differs from previous declaration
[Error] Calculadora.pas(60): Undeclared identifier: 'text'
[Error] Calculadora.pas(61): Undeclared identifier: 'text'
[Error] Calculadora.pas(66): Undeclared identifier: 'text'
[Error] Calculadora.pas(70): Undeclared identifier: 'text'
[Error] Calculadora.pas(70): Undeclared identifier: 'text'
[Fatal Error] calc.dpr(5): Could not compile used unit 'Calculadora.pas'

...So, what can I do?
diossitoAsked:
Who is Participating?
 
billiousConnect With a Mentor Commented:
In TFrmCalc type-declaration you have

procedure Numero(Display: TObject; num:char; var flag:Boolean);

and you then declare the procedure with
procedure TFrmCalc.Numero (Display: Tmemo; num:char; var flag:Boolean);

Since Tmemo <> Tobject, the compiler doesn't like it.

Change Tobject in the type declaration to Tmemo - should fix up the 'text' problems, too!

...Bill


0
 
diossitoAuthor Commented:
Thanks for help me, there is what it's yours
0
All Courses

From novice to tech pro — start learning today.