Skip to content

Instantly share code, notes, and snippets.

@viniciussanchez
Created March 5, 2021 14:16
Show Gist options
  • Save viniciussanchez/38938187b26bacc572ee1a22b7327aac to your computer and use it in GitHub Desktop.
Save viniciussanchez/38938187b26bacc572ee1a22b7327aac to your computer and use it in GitHub Desktop.
Classes amigas
unit Classes.Amigas;
interface
type
TCarro = class
private
FId: Integer;
FNome: string;
procedure SetId(const Value: Integer);
procedure SetNome(const Value: string);
public
property Id: Integer read FId write SetId;
property Nome: string read FNome write SetNome;
end;
TProduto = class
private
FDescricao: string;
FCodigoBarra: string;
procedure SetCodigoBarra(const Value: string);
procedure SetDescricao(const Value: string);
public
property CodigoBarra: string read FCodigoBarra write SetCodigoBarra;
property Descricao: string read FDescricao write SetDescricao;
end;
implementation
{ TCarro }
procedure TCarro.SetId(const Value: Integer);
begin
FId := Value;
end;
procedure TCarro.SetNome(const Value: string);
begin
FNome := Value;
end;
{ TProduto }
procedure TProduto.SetCodigoBarra(const Value: string);
begin
FCodigoBarra := Value;
end;
procedure TProduto.SetDescricao(const Value: string);
begin
FDescricao := Value;
end;
end.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment