any body have a suitable thread timer component for xe5?

  • Автор темы sikancil
  • 749
  • Обновлено
  • 07, Nov 2014
  • #1
for XE5-XE6, check this maybe could help you much..

C:\Users\Public\Documents\Embarcadero\Studio\XX.0\Samples\Object Pascal\RTL\CrossPlatform Utils\AnonThread.pas

And use sample in:

C:\Users\Public\Documents\Embarcadero\Studio\XX.0\Samples\Object Pascal\RTL\CrossPlatform Utils\AnonymousThread\AnonymousThread.dproj

Or you can use std TThread from System.Classes like:

uses System.Classes;

implementation

procedure TForm1.Form1Show(AObject: TObject);

var

tmpProc: TThread;

begin

tmpProc := TThread.CreateAnonymousThread(

procedure

var

i: integer;

begin

for i:=0 to someLength-1 do

Memo1.Lines.Add('Hey, Mr.#' + inttostr(i) + ' how are you?');

//-- dont forget to clear it out after the thread process sure finished the task.

procPrepareHttpData.WaitFor;

procPrepareHttpData.Free;

end

);

//-- start the process task, if it have not started yet..

if (tmpProc.Started = false) then tmpProc.Start;

end;

You can also implement and put TThread process inside a TTimer in specific time to launch it or repeatly.

This good enough for FMX on iOS to use TRestClient or other Async Process. Not sure this help your idea/problem or not.

sikancil


Рег
20 Oct, 2011

Тем
2

Постов
13

Баллов
33
Тем
49554
Комментарии
57426
Опыт
552966

Интересно