1
votes

I try define a private method i have:

unit FormENP;

interface

uses
  ....

type
  TENPDataEntry = class(TForm)
  ........
  private
    { Private declarations }
    function getLastIdMuestra(): integer;

  public
    { Public declarations }
  end;

var
  ENPDataEntry: TENPDataEntry;

implementation

{$R *.dfm}
{ Devuelve el id de la última muestra insertada en <MUESTRA> }
function getLastIdMuestra(): integer;
var
  query: TIBQuery;
  id: integer;
begin
  query := TIBQuery.Create(nil);
  ....
  id := query.Fields[0].AsInteger;
  query.Destroy;
  getLastIdMuestra := id;
end;
...
End.

But the compiler says:

[DCC Error] FormENP.pas(30): E2065 Unsatisfied forward or external declaration: 'TENPDataEntry.getLastIdMuestra'

The line 30 is the method signature:

function getLastIdMuestra(): integer;

Im newbie in Delphi, any ideas ?. I think that the code is fine...

1
1. Navigate to class declaration. 2. Press Ctrl+Shift+C to invoke code completion. This will generate the correct function signature for you.Gerry Coll
@ramiromd You asked a question and received the answer. Please can you accept it: meta.stackexchange.com/questions/5234David Heffernan

1 Answers

10
votes

You are missed the class name in the method definition, try

function TENPDataEntry.getLastIdMuestra(): integer;