It is a simple class with get and set methods, but it generates an error when invoking any of the functions or procedures (from the beginning I found that only on line 43).
unit uPais;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, Dialogs;
type
Pais = class
private
codigo:integer;
descricao:string;
public
constructor Create; // construtor
destructor Destroy; // destrutor
// Setters
procedure setCodigo(pCodigo:integer);
procedure setDescricao(pDescricao:string);
// Getters
function getCodigo():integer;
function getDescricao():string;
end;// fim da classe
implementation
constructor Pais.Create();
begin
codigo := 0;
descricao := '';
end;
destructor Pais.Destroy();
begin
//Freemem(@codigo);
//Freemem(@descricao);
end;
// Setters
procedure Pais.setCodigo(pCodigo:integer);
begin
codigo := pCodigo;
end;
procedure Pais.setDescricao(pDescricao:string);
begin
descricao := pDescricao;
end;
// Getters
function Pais.getCodigo():integer;
begin
Result := codigo;
end;
function Pais.getDescricao():string;
begin
Result := descricao;
end;
end.