Created
March 5, 2021 14:16
-
-
Save viniciussanchez/38938187b26bacc572ee1a22b7327aac to your computer and use it in GitHub Desktop.
Classes amigas
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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