In order to make scripter programs more clear I want to outsource some portions of my code to special units.
For example I have build some helper functions and saved them in "srcWindowFunctions".
In my scripting form I write uses srcWindowFunctions
. Then I can use these procedures and functions.
This is working "reasonably satisfactory".
Now I tried to outsource a Timer. Instead of putting the TTimer on my Scripting Form I defined the Timer inside srcWindowFunctions.
var
WinSizeAndPosTimer : TTimer;
...
if WinSizeAndPosTimer = null then begin
WinSizeAndPosTimer := TTimer.Create(Self);
WinSizeAndPosTimer.OnTimer := WinSizeAndPosTimerTimer(Self, Sender);
WinSizeAndPosTimer.Interval := 1000;
WinSizeAndPosTimer.Enabled := true;
end;
// Manual Call of Timer Event:
WinSizeAndPosTimerTimer(Self, Sender); // Fensterposition nach dem Öffnen sofort wieder herstellen
Unfortunately the Timer gives me every second the message RUNTIME ERROR File library srcWindowFunctions: Subroutine '0' does not exist in script Position: 0, 0.
But the first "manual" call direct after creation works perfect.
How can I solve that problem?