lsd25 писал(а):
Исползовать мульти-тред не получается Подключите так:
Add(VBJScript,11093546,427,238)
{
@Hint=#4:Exec|
WorkPoints=#7:doStart|11:##SetScript|
EventPoints=#7:onSleep|6:onText|6:onStop|
DataPoints=#10:FuncResult|
Script=#17:Dim i 'global var|0:|27:function Sleep(TimeToSleep)|27: sys.onSleep(TimeToSleep)|26: Result = sys.FuncResult|12:end function|0:|26:function SetText(InfoText)|23: sys.onText(InfoText)|13: Result = 1|12:end function|0:|46:sub Quit()'можно вызвать в любом месте скрипта|16: sys.onStop(0)|7:end sub|0:|28:function doWork(Data, Index)|15: i = i + 1|16: SetText(i)|17: Sleep(1000)|12:end function|
UseName=0
link(onSleep,1150256:doSleep,[])
link(onText,13288933:doText,[(502,251)(502,342)])
link(onStop,5808541:doWork1,[(476,258)(476,373)(312,373)])
link(FuncResult,5298730:GetData,[])
}
Add(Button,7767791,238,231)
{
Left=10
Top=10
Caption="старт"
link(onClick,4730508:doStart,[])
}
Add(Button,13741447,238,301)
{
Left=10
Top=35
Caption="стоп"
link(onClick,5808541:doWork2,[])
}
Add(EventFromData,5298730,427,189)
{
link(onEvent,5298730:doData,[(469,195)(469,228)(415,228)(415,195)])
link(Data,8656383:Value,[])
}
Add(Memory,8656383,427,147)
{
Point(Data)
}
Add(InlineCode,1150256,511,238)
{
@Hint=#31:Выделяем текс в Edit ComboBox'а|
WorkPoints=#7:doSleep|
EventPoints=#8:onResult|
Code=#15:unit HiAsmUnit;|0:|9:interface|0:|40:uses kol,Share,Debug, Windows, Messages;|0:|4:type|28: THiAsmClass = class(TDebug)|10: private|9: public|23: onResult:THI_Event;|51: procedure doSleep(var _Data:TData; Index:WORD);|5: end;|0:|14:implementation|0:|59:procedure THiAsmClass.doSleep(var _Data:TData; Index:WORD);|5:begin|29: sleep(ToInteger(_Data));|29: _hi_onEvent(onResult,1);|4:end;|0:|4:end.|
link(onResult,8656383:doValue,[(553,244)(553,137)(415,137)(415,153)])
}
Add(Label,13288933,511,336)
{
Left=70
Top=10
Width=105
Height=40
Caption=""
AutoSize=1
}
Add(DoData,3334465,322,301)
{
Data=String()
link(onEventData,11093546:##SetScript,[(401,307)(401,251)])
}
Add(HubEx,5808541,308,301)
{
link(onEvent,3334465:doData,[])
}
Add(Thread,4730508,315,231)
{
Delay=500
link(onSyncExec,11093546:doStart,[])
}