NewPeriodicTask
Lee D Papworth
8-4-18
Seems my original post has been deleted. So I am posting again and would appreciate some technical advice. (Please do not delete my post)

Erik suggested in a Skype chat with a colleague several weeks ago that we look at using NewPeriodicTask2 rather than the Background Hal routine in Timed Operations.

I cannot get NewPeriodTask2 to work but NewPeriodicTask works but I have several questions.

1) What is the difference between NewPeriodicTask and NewPeriodTask2?
2) In standalone mode running Single User Server I can use these commands ChangeTaskTiming, RemoveTask, TaskExists However in normal client server mode these do not work for me. It is as though it cannot find the task. I use the TaskExists command to check if active before issuing ChangeTaskTiming. Any ideas why these command wouldn't be working in server mode?

For reference I include below the hal code I have for application startup.

external updating function SDProcessUserXml(string);
external updating function SDProcessOrderXml(string);


global
updating procedure OnApplicationStartupComplete()
begin


record SDTradeITBlock SDTBr;
blockload(SDTBr);

inner.OnApplicationStartupComplete;
if (ServerMode or SingleUserMode) then begin
if (SDTBr.UserImportSeconds >0) then begin
NewPeriodicTask("SDProcessUserXml","Auto Import Users","SDProcessUserXml","Auto",SDTBr.UserImportSeconds,"");
Logtext(0,"Starting Timed Task - Auto Import Users");
end;
if (SDTBr.OrderImportSeconds >0) then begin
NewPeriodicTask("SDProcessOrderXml","Auto Import Order","SDProcessOrderXml","Auto",SDTBr.OrderImportSeconds,"");
Logtext(0,"Starting Timed Task - Auto Import Orders");
end;
end;

return;
end;
Leave Comment
You can subscribe to notifications for this post by selecting the 'star' icon on the top right corner of the post.
Latest Posts
Piotr Wycichowski
This is not the issue of upgrade SERP. But serverip.dat in this case contains the value: 192.168.88.12:1301, so this is local IP of the server with SERP. Anyway I don't understand what do you me...
15:30 14 Jan 2025
Brittany McGrath
reply ...
05:10 14 Jan 2025