Created
June 4, 2021 18:16
-
-
Save viniciussanchez/2b443148a2911be27d273a1100e03b4b to your computer and use it in GitHub Desktop.
Class Operator Inc
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
type | |
TVenda = record | |
QuantidadeItensVendidos: Integer; | |
class operator Inc(AVenda: TVenda): TVenda; | |
end; | |
var | |
LVenda: TVenda; | |
begin | |
LVenda.QuantidadeItensVendidos := 10; | |
Inc(LVenda); | |
ShowMessage(IntToStr(LVenda.QuantidadeItensVendidos)); | |
end; | |
{ TVenda } | |
class operator TVenda.Inc(AVenda: TVenda): TVenda; | |
begin | |
Result.QuantidadeItensVendidos := AVenda.QuantidadeItensVendidos + 1; | |
end; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment