Posted by DelphiLand Team In Reply to: Timer.interval and cardinal value posted by Stefan
Loeners You don't have to convert the integer value to a cardinal, you can directly assign an integer value to Timer.Interval. For example: procedure TForm1.Button1Click(Sender: TObject); var Interv: integer; begin Interv := 2000; Timer1.Interval := Interv; end; In the code above, the integer variable Interv can be anything that results in an integer value, for example: procedure TForm1.Button1Click(Sender: TObject); var Ini: TIniFile; begin Ini := TIniFile.Create(ChangeFileExt(Application.ExeName, '.ini')); Timer1.Interval := Ini.ReadInteger('Sect1', 'V1', 1000); Ini.Free; end;
|