Recurring challenge counter
-
How inside What is the first time that it's caused? I mean, if I want to do something before I call her, I have to write everywhere in the code:
// Пердварительные действия // Вызов функции
I'd like to see "Anthing action" performed automatically when a function was called, and I didn't have to keep them out of the box. You can certainly do another function that will perform these actions and create a function, but can there be a beautiful solution? Is it possible to set up a call clerk and carry initialisation at =0?
-
Do it like that:
function CallMyRecursion(Param: TMyParam): TMyResult begin // предварительные действия Result := MyRecursion(Param); end;
And in the code, instead of:
// Предварительные действия MyResult := MyRecursion(Param); // Вызов функции
Write:
MyResult := CallMyRecursion(Param);