Ord function implementation in Delphi
Posted
by
Federico Zancan
on Programmers
See other posts from Programmers
or by Federico Zancan
Published on 2012-03-27T10:04:27Z
Indexed on
2012/03/27
11:38 UTC
Read the original article
Hit count: 409
delphi
Purely as an exercise at home, aimed to better understand some language basics, I tried to reimplement the Ord function, but I came across a problem.
In fact, the existing Ord function can accept arguments of a variety of different types (AnsiChar, Char, WideChar, Enumeration, Integer, Int64) and can return Integer or Int64.
I can't figure out how to declare multiple versions of the same function.
How should this be coded in Delphi?
© Programmers or respective owner