TEAM ENVI^ ENVIMODE=1| ENVI^ FORCELOCAL=1
CALL WIN1

_SUB WIN1,W289H150,线程个数测试,
    SET st=
    ITEM ITEM2,L40T34W60H30,测试,TEAM SET st=| exec =%MyName% LOAD %CurFile%*X  ""  %&__WinID% ,
    ITEM ITEM1,L149T34W60H30,小线程,TEAM SET st=**st:128K| exec =%MyName% LOAD %CurFile%*X %&st%    %&__WinID%,
    ENVI @this.MSG=#1::wp,lp, MESS 成功创建 %wp%  个线程 \n最后错误:%lp% \n[END  %&st%] @#OK
    ENVI @this.MSG=#2::wp,lp, MESS 成功创建 %wp%  个线程 \n[END  %&st%]  @XXXX #OK
_END


_SUB X1,*
    SET MYTHREAD=thread*  %~1
    @ IFEX X.LOG, @ LOGS * X.LOG 
    SET-def id=#2
    set-def i=0
    @ SET-def  err=0
    LOOP #%i%<6000,
    {   CALC i=%i% +1
        %MYTHREAD% wait 60000 
        @ SET err=%&ERROR% 
        @ IFEX $0=%err%,! TEAM set id=#1|  EXIT  LOOP   
    } 
    ENVI @@POSTMSG=%2:%id%;%i%;%err% 
_END
_SUB X,*
TEAM ENVI^ ENVIMODE=1| ENVI^ FORCELOCAL=1
    CALL X1 %*
    @ IFEX X.LOG, @ LOGS
    EXIT FILE 
_END 

