the full thing looks like this
procedure tsrmain.launchprocess(i:integer) ;
var scriptname : string;
scommand,sresult : ansistring;
res : boolean;
scriptprocess : tasyncprocess;
begin
if nextpointer < scriptlist.count then
begin
scriptname := scriptlist.items[nextpointer];
scommand := scriptdirectory.Directory + '/' + scriptname;
try
processarray := tscriptthread.Create(i,scommand,false);
if assigned(processarray.fatalexception) then
raise processarray.fatalexception;
nextpointer := nextpointer + 1;
// testthread := tscriptthread.Create(i,scommand,false);
except
On E: Exception do
srmain.Memo1.lines.Append('Thread Failure');
end;
end;