I was including the Helpers.SysUtils unit in the uses above the Interface, now I've moved it to the Implementation uses and the "Code Completion" "Find" the helper, however when compiling all the lines of code that use Helper (mostly it is : Variable-Integer.ToString ) is showing the same message:
Only one helper can be active for a type at the same time. So depending on the order of your
uses sections you'll either get the helper from your
Helpers.SysUtils unit or that from unit
SysUtils (the last one will be picked). You can avoid this by inheriting your
HelperInt from
TLongIntHelper like in the following example and then making sure your
Helpers.SysUtils units is used
after the
SysUtils unit:
type
MyHelper = type helper(TIntegerHelper) for Integer
// ...
(Note: In FPC trunk one can also use the modeswitch
MultiHelpers to allow for multpile helpers of the same type without the need to use inheritance, though the released FPC versions do not support that)
Sidenote: Why do you pass the seconds as argument to your helper? You can drop that parameter and simply use
Self which will be the value (or variable) you called the helper method on.