Last active
June 4, 2021 18:03
-
-
Save viniciussanchez/d6dc142056512c7e36a7b30c726e17df to your computer and use it in GitHub Desktop.
Class Operator Add
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 | |
Valor: Currency; | |
class operator Add(AVenda1, AVenda2: TVenda): Currency; | |
end; | |
var | |
LVenda1, LVenda2: TVenda; | |
begin | |
LVenda1.Valor := 100; | |
LVenda2.Valor := 50; | |
ShowMessage(CurrToStr(LVenda1 + LVenda2)); | |
end; | |
{ TVenda } | |
class operator TVenda.Add(AVenda1, AVenda2: TVenda): Currency; | |
begin | |
Result := AVenda1.Valor + AVenda2.Valor; | |
end; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment