SysexecNewpipe(); //创建管道
path:="D:\\TinySoftNG\\AnalyseNG.NET\\TSL.exe";
doS1:=array('C:\\TinySoftNG\\AnalyseNG.NET\\tsl.exe','C:\\DoTSL\\otherTest\\TestEnv.tsl');
doS2:=array('C:\\TinySoftNG\\AnalyseNG.NET\\tsl.exe','C:\\DoTSL\\otherTest\\TestEcho.tsf');
//创建一个被挂起的进程,两个会返回的进程
hand1:= SysExec(path,'TSL',nil,array('wait':false,'in':'c:="333"\r\n'),code);
hand2:= SysExec(path,doS1,nil,false,code);
hand3:= SysExec(path,doS2,nil,false,code);
r:=SysWaitForMultipleObjects(array(hand1,hand2,hand3),0,10*1000);// 仅需任意一个对象等待成功
t:=SysexecReadpipe();//读取管道内容
SysTerminate(code,hand1);//终止进程
SysTerminate(code,hand2);//终止进程
SysTerminate(code,hand3);//终止进程
return array(r,t);
返回:返回为1,说明hand1没有等待成功,而至少hand2是有等待成功了。

注:其中的TestEnv.tsl与TestEcho.tsf实现分别如下:TestEnv.tsl:
sleep(500);t:=Sysgetenvs();echo "sys: ",tostn(t),'\r\n';return 1;
TestEcho.tsf:
sleep(2*1000);//停2秒echo 'TestEchoIN\r\n';return 1;
SysExec、SysWaitForSingleObject