Ord function implementation in Delphi
- by Federico Zancan
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?