Easiest to understand way using a struct-ured variable with functions

A C++ reference '&' means a var parameter in Delphi.