Re: [Lazarus] TTimer simple issue

2020-10-27 Thread Bo Berglund via lazarus
On Tue, 27 Oct 2020 14:40:27 +0100, Darius Blaszyk via lazarus wrote: >>> But this is very not a very efficient way. The best is to get the start >>> time, get the end time and subtract. >>> >>> var >>> StartTime,EndTime:TDataTime; >>> i, answer: integer; >>> begin >>> StartTime:=now; >>> f

Re: [Lazarus] TTimer simple issue

2020-10-27 Thread Darius Blaszyk via lazarus
The first multiplication is when i = 0, so it should be ok. I am wondering though, the OP wants to calculate the factorial of 9. That would require a larger data type than an integer to store the result in! ;) On Tue, Oct 27, 2020 at 1:46 PM Евгений Кадисов via lazarus < lazarus@lists.laza

Re: [Lazarus] TTimer simple issue

2020-10-27 Thread Евгений Кадисов via lazarus
The problem of your code is that the variable is not initialized. Regards Evgueny вт, 27 окт. 2020 г. в 15:28, Santiago A. via lazarus < lazarus@lists.lazarus-ide.org>: > El 18/10/2020 a las 19:18, Lars via lazarus escribió: > > When building a simple TTimer demo I cannot seem to get it working

Re: [Lazarus] TTimer simple issue

2020-10-27 Thread Santiago A. via lazarus
El 18/10/2020 a las 19:18, Lars via lazarus escribió: When building a simple TTimer demo I cannot seem to get it working Any idea what the problem could be if you paste this code into your form with a memo? var   TimeSpent: integer; procedure TForm2.Button1Click(Sender: TObject); var   i, an

Re: [Lazarus] TTimer simple issue

2020-10-26 Thread Luca Olivetti via lazarus
El 18/10/20 a les 19:18, Lars via lazarus ha escrit: When building a simple TTimer demo I cannot seem to get it working Any idea what the problem could be if you paste this code into your form with a memo? var   TimeSpent: integer; procedure TForm2.Button1Click(Sender: TObject); var   i, a

[Lazarus] TTimer simple issue

2020-10-26 Thread Lars via lazarus
When building a simple TTimer demo I cannot seem to get it working Any idea what the problem could be if you paste this code into your form with a memo? var TimeSpent: integer; procedure TForm2.Button1Click(Sender: TObject); var i, answer: integer; begin Timer1.enabled := false; TimeS