Joiner, сделал схему с MST_Virtual и генератором от Леонида , вроде очень шустро работает. Add(MainForm,3063237,105,140) { Width=545 Height=349 link(onCreate,11085202:doWork1,[]) } Add(StrList,4383086,287,140) { Point(EndIdx) } Add(ChildPanel,11085202,161,154) { link(onEvent2,9222564:doEvent1,[]) } BEGIN_SDK Add(EditMulti,7878121,21,21) { EventCount=2 WorkCount=1 Width=440 Height=270 link(doWork1,12297484:doEvent1,[(46,27)(46,97)]) } Add(Panel,13137533,56,35) { Width=529 Height=30 Align=2 } Add(Button,294400,42,126) { Left=15 Top=5 Caption="New" link(onClick,12836985:doEvent1,[]) } Add(Button,16443704,42,189) { Left=460 Top=5 Enabled=1 Caption="Save" link(onClick,15140639:doEvent1,[]) } Add(Edit,10340021,217,35) { Left=185 Top=5 Width=90 Text="20000" DataType=2 } Add(Label,13731098,168,35) { Left=125 Top=7 Width=61 Height=17 Caption="Кол. строк" } Add(Button,11871194,238,175) { Left=370 Top=5 Caption="View" link(onClick,1896552:doData,[]) } Add(LED,11063149,301,49) { Left=80 Top=5 Width=20 Height=20 ColorOff=65280 } Add(Hub,12297484,91,91) { OutCount=4 link(onEvent1,3301899:doWork2,[(116,97)(116,83)]) link(onEvent2,3210884:doWork1,[]) link(onEvent3,3789266:doWork1,[(116,111)]) link(onEvent4,14611930:doWork2,[]) } Add(MultiElement,3210884,217,98) { link(onEvent1,2339098:doAdd,[]) link(onEvent2,343437:doEvent1,[]) link(Data1,13711752:Var2,[]) } BEGIN_SDK Add(EditMulti,90280,28,21) { EventCount=2 WorkCount=2 DataCount=1 Width=440 Height=158 VOffset=7 HOffset=28 link(doWork1,15240120:doEvent1,[]) link(doWork2,15286128:doFor,[(39,41)(39,55)]) } Add(For,15286128,49,49) { @Hint=#18:Количество абзацев| IncludeEnd=1 link(onEvent,9486001:doRandom,[]) link(onStop,90280:onEvent2,[(88,62)(88,140)(455,140)(455,41)]) link(End,90280:Data1,[]) } Add(For,11842154,154,49) { @Hint=#29:Количество слов в предложении| link(onEvent,5410569:doText,[]) link(onStop,15892992:doEvent1,[(193,62)(193,97)]) link(End,9486001:Random,[(167,40)(146,40)(146,89)(111,89)]) } Add(Random,9486001,105,49) { Min=7 Max=15 link(onRandom,11842154:doFor,[]) } Add(InlineCode,5410569,203,42) { WorkPoints=#7:doStart|6:doText| EventPoints=#5:onRes| Code=#15:unit HiAsmUnit;|0:|9:interface|0:|21:uses kol,Share,Debug;|0:|4:type|28: THiAsmClass = class(TDebug)|10: private|0:|9: public|23: onRes : THI_Event;|5: |52: procedure doStart(var _Data:TData; Index:Word); |50: procedure doText(var _Data:TData; Index:Word);|5: end;|0:|14:implementation|0:|30:procedure THiAsmClass.doStart;|6: begin|12: Randomize;|5: end;|0:|29:procedure THiAsmClass.doText;|15:var sss:string;|16: i,j:integer;|16: _Rnd:double;|5:BEGIN|11: sss:=' ';|24: j:=round(Random*12)+2;|19: for i:=0 to j do|9: begin|18: _Rnd:=Random;|42: if _Rnd<0.0003 then sss:=sss+'ё' else|42: if _Rnd<0.0007 then sss:=sss+'ъ' else|42: if _Rnd<0.0033 then sss:=sss+'ф' else|42: if _Rnd<0.0065 then sss:=sss+'э' else|42: if _Rnd<0.0101 then sss:=sss+'щ' else|42: if _Rnd<0.0149 then sss:=sss+'ц' else|42: if _Rnd<0.0213 then sss:=sss+'ю' else|42: if _Rnd<0.0286 then sss:=sss+'ш' else|41: if _Rnd<0.038 then sss:=sss+'ж' else|42: if _Rnd<0.0477 then sss:=sss+'х' else|42: if _Rnd<0.0598 then sss:=sss+'й' else|42: if _Rnd<0.0742 then sss:=sss+'ч' else|42: if _Rnd<0.0901 then sss:=sss+'б' else|42: if _Rnd<0.1066 then sss:=sss+'з' else|42: if _Rnd<0.1236 then sss:=sss+'г' else|41: if _Rnd<0.141 then sss:=sss+'ь' else|40: if _Rnd<0.16 then sss:=sss+'ы' else|42: if _Rnd<0.1801 then sss:=sss+'я' else|42: if _Rnd<0.2063 then sss:=sss+'у' else|42: if _Rnd<0.2344 then sss:=sss+'п' else|42: if _Rnd<0.2642 then sss:=sss+'д' else|42: if _Rnd<0.2963 then sss:=sss+'м' else|42: if _Rnd<0.3312 then sss:=sss+'к' else|42: if _Rnd<0.3752 then sss:=sss+'л' else|42: if _Rnd<0.4206 then sss:=sss+'в' else|42: if _Rnd<0.4679 then sss:=sss+'р' else|42: if _Rnd<0.5226 then sss:=sss+'с' else|42: if _Rnd<0.5852 then sss:=sss+'т' else|42: if _Rnd<0.6522 then sss:=sss+'н' else|42: if _Rnd<0.7257 then sss:=sss+'и' else|42: if _Rnd<0.8058 then sss:=sss+'а' else|42: if _Rnd<0.8903 then sss:=sss+'е' else|34: if _Rnd<1 then sss:=sss+'о'; |9: end;|25: _hi_onEvent(onRes,sss);|4:END;|0:|0:|4:end.| link(onRes,15879034:doWork2,[]) } Add(StrCat,13455235,308,42) { Point(doClear) link(Str1,7063167:Var3,[(314,33)(328,33)(328,82)]) } Add(Hub,15240120,70,28) { link(onEvent1,5410569:doStart,[(193,34)(193,48)]) link(onEvent2,9486001:doRandomize,[(95,41)(95,62)]) } Add(DoData,7170534,308,98) { link(onEventData,16600547:doTrim,[]) link(Data,7063167:Var2,[]) } Add(GetDataEx,7063167,308,77) { link(Data,13455235:Result,[]) } Add(Hub,15892992,203,91) { OutCount=3 link(onEvent1,7526937:doData,[(242,97)(242,62)]) link(onEvent2,7170534:doData,[]) link(onEvent3,13455235:doClear,[(298,111)(298,55)]) } Add(DoData,7526937,252,56) { Data=String(. ) link(onEventData,15879034:doWork3,[(291,62)]) } Add(HubEx,15879034,287,42) { link(onEvent,13455235:doStrCat,[]) } Add(StrCase,14266070,406,98) { Type=3 link(onModify,90280:onEvent1,[(445,104)(445,34)]) } Add(Trim,16600547,357,98) { Char=" " Mode=4 link(onTrim,14266070:doModify,[]) } END_SDK Add(Hub,12836985,91,126) { OutCount=3 link(onEvent1,3301899:doWork3,[(123,132)]) link(onEvent2,3789266:doWork2,[]) link(onEvent3,14611930:doWork3,[(130,146)]) } Add(HubEx,3301899,119,77) { link(onEvent,16463242:doEvent1,[]) } Add(StrList,2339098,301,98) { Point(doSave) } Add(DoData,1896552,301,175) { link(onEventData,7878121:onEvent2,[(360,181)(360,34)]) link(Data,633127:Var2,[]) } Add(SDialog,3850500,217,133) { Filter="TXT|*.txt" Point(doFileName) link(onExecute,2339098:doSave,[]) } Add(TimeCounter,526452,350,217) { link(onStop,10660108:doString,[]) } Add(Length,4653976,294,224) { link(onLength,526452:doStop,[]) link(Str,633127:Var1,[(300,166)]) } Add(FormatStr,10660108,399,224) { DataCount=3 Mask="Сгенерировано %1 символов в %3 строках за %2 мсек" link(onFString,7878121:onEvent1,[(443,230)(443,27)]) link(Str1,4653976:Result,[(405,215)(391,215)(391,264)(300,264)]) link(Str3,2339098:Count,[(419,159)(314,159)]) } Add(GetDataEx,633127,301,161) { link(Data,2339098:Text,[]) } Add(HubEx,3789266,112,133) { Angle=1 link(onEvent,526452:doStart,[(116,223)]) } Add(HubEx,14611930,126,112) { Angle=3 link(onEvent,3646847:doStart,[(130,111)]) } Add(Hub,16463242,238,77) { link(onEvent1,11063149:doOn,[(291,83)(291,69)]) link(onEvent2,2339098:doClear,[(291,90)(291,111)]) } Add(Hub,343437,259,105) { link(onEvent1,11063149:doOff,[(284,111)(284,62)]) link(onEvent2,4653976:doLength,[(284,118)(284,230)]) } Add(Thread,3646847,161,105) { Delay=20 FastStop=0 link(onExec,3210884:doWork2,[]) } Add(Hub,15140639,91,189) { link(onEvent1,7492483:doOperation,[]) link(onEvent2,3850500:doExecute,[(123,202)(123,181)(200,181)(200,139)]) } Add(Math,7492483,133,189) { OpType=3 Op2=1000 ResultType=0 link(onResult,3543045:doStrCat,[]) link(Op1,13711752:Var1,[(139,75)]) } Add(GetDataEx,13711752,217,70) { link(Data,10340021:Text,[]) } Add(StrCat,3543045,175,189) { Str2="Кстр.txt" link(onStrCat,3850500:doFileName,[(214,195)(214,181)(207,181)(207,146)]) } END_SDK Add(MST_Virtual,15555683,420,210) { MSTControl="MTStrTbl" Point(doSetVirtIdx) link(onChangeVirtIdx,4071568:doEvent1,[]) link(VirtualData,8915826:GetData,[(426,201)(461,201)(461,397)(657,397)]) } Add(MathParse,4883725,252,238) { MathStr="(%2 - sign(%1) * 3) * ((%2 - sign(%1) * 3) >= 0)" ResultType=0 link(onResult,5531226:doCompare,[]) link(X2,15555683:CurVirtIdx,[(265,229)(293,229)(293,257)(426,257)]) } Add(If_else,5531226,301,238) { Type=1 link(onTrue,15555683:doSetVirtIdx,[]) link(Op2,4383086:EndIdx,[]) } Add(EventFromData,8915826,651,350) { link(onEvent,83609:doSeparateMT,[]) } Add(For,8901862,609,266) { link(onEvent,91022:doRead,[]) link(Start,10721694:Value,[(615,257)(559,257)]) link(End,7765738:Result,[]) } Add(Hub,4071568,490,210) { link(onEvent1,10721694:doValue,[]) link(onEvent2,8901862:doFor,[(522,223)(522,272)]) } Add(Math,7765738,616,210) { ResultType=0 link(onResult,53467:doClear,[(729,216)(729,279)]) link(Op2,15555683:PerPage,[(629,201)(482,201)(482,257)(440,257)]) } Add(StrList,53467,756,266) { } Add(Hub,9222564,210,161) { link(onEvent1,4383086:doText,[]) link(onEvent2,8932995:In,[]) } Add(MTStrTbl,7148080,189,210) { Top=30 Width=529 Height=280 Name="MTStrTbl" Columns=#1:1| FlatScroll=1 ColumnWidth=500 VirtualTab=0 Style=4 Point(onMouseWheel) link(onMouseWheel,4883725:doCalc,[]) } Add(MT_MultiData,83609,700,350) { From=1 link(onData1,15065628:doRead,[]) } Add(ArrayRW,15065628,770,350) { link(onRead,8915826:doData,[(809,356)(809,342)(641,342)(641,356)]) link(Array,53467:Array,[]) } Add(Memory,10721694,553,210) { link(onData,7765738:doOperation,[]) } Add(ArrayRW,91022,672,266) { link(onRead,53467:doAdd,[]) link(Array,4383086:Array,[(678,180)(307,180)]) link(Index,8901862:Position,[(685,257)(664,257)(664,306)(615,306)]) } Add(LineBreak,6020064,378,231) { link(Out,15555683:doResetPage,[]) Primary=[8932995,-140,-63] }
По поводу Excel, у него много достоинств но, быстродействие это не его сильная черта. Если передавать данные в excel построчно то... успеваю чай себе налить. Add(MainForm,4598991,119,147) { Width=545 Height=284 Point(onClose) link(onCreate,13264365:doWork1,[]) } Add(StrList,2583656,259,147) { } Add(ArrayEnum,1976442,273,210) { link(onItem,5432892:doWrite,[]) link(onEndEnum,5432892:doClose,[]) link(Array,2583656:Array,[]) } Add(TimeCounter,484440,399,203) { link(onStart,9655644:In,[(438,209)(438,195)]) link(onStop,9742849:In,[]) } Add(ChildPanel,13264365,175,161) { link(onEvent2,9162188:doEvent1,[]) } BEGIN_SDK Add(EditMulti,14423383,21,21) { EventCount=2 WorkCount=1 Width=440 Height=270 link(doWork1,16501226:doEvent1,[(46,27)(46,97)]) } Add(Panel,3764623,56,35) { Width=529 Height=30 Align=2 } Add(Button,2085515,42,126) { Left=15 Top=5 Caption="New" link(onClick,3154751:doEvent1,[]) } Add(Button,6499047,42,189) { Left=460 Top=5 Enabled=1 Caption="Save" link(onClick,7567131:doEvent1,[]) } Add(Edit,11335160,217,35) { Left=185 Top=5 Width=90 Text="20000" DataType=2 } Add(Label,152480,168,35) { Left=125 Top=7 Width=61 Height=17 Caption="Кол. строк" } Add(Button,8812432,238,175) { Left=370 Top=5 Caption="to Excel" link(onClick,246572:doData,[]) } Add(LED,9062772,301,49) { Left=80 Top=5 Width=20 Height=20 ColorOff=65280 } Add(Hub,16501226,91,91) { OutCount=4 link(onEvent1,5123609:doWork2,[(116,97)(116,83)]) link(onEvent2,4808525:doWork1,[]) link(onEvent3,4110144:doWork1,[(116,111)]) link(onEvent4,10119668:doWork2,[]) } Add(MultiElement,4808525,217,98) { link(onEvent1,3662929:doAdd,[]) link(onEvent2,553711:doEvent1,[]) link(Data1,12180389:Var2,[]) } BEGIN_SDK Add(EditMulti,12843563,28,21) { EventCount=2 WorkCount=2 DataCount=1 Width=440 Height=158 VOffset=7 HOffset=28 link(doWork1,4723815:doEvent1,[]) link(doWork2,5160363:doFor,[(39,41)(39,55)]) } Add(For,5160363,49,49) { @Hint=#18:Количество абзацев| IncludeEnd=1 link(onEvent,10227921:doRandom,[]) link(onStop,12843563:onEvent2,[(88,62)(88,140)(455,140)(455,41)]) link(End,12843563:Data1,[]) } Add(For,8217345,154,49) { @Hint=#29:Количество слов в предложении| link(onEvent,12535190:doText,[]) link(onStop,7363015:doEvent1,[(193,62)(193,97)]) link(End,10227921:Random,[(167,40)(146,40)(146,89)(111,89)]) } Add(Random,10227921,105,49) { Min=7 Max=15 link(onRandom,8217345:doFor,[]) } Add(InlineCode,12535190,203,42) { WorkPoints=#7:doStart|6:doText| EventPoints=#5:onRes| Code=#15:unit HiAsmUnit;|0:|9:interface|0:|21:uses kol,Share,Debug;|0:|4:type|28: THiAsmClass = class(TDebug)|10: private|0:|9: public|23: onRes : THI_Event;|5: |52: procedure doStart(var _Data:TData; Index:Word); |50: procedure doText(var _Data:TData; Index:Word);|5: end;|0:|14:implementation|0:|30:procedure THiAsmClass.doStart;|6: begin|12: Randomize;|5: end;|0:|29:procedure THiAsmClass.doText;|15:var sss:string;|16: i,j:integer;|16: _Rnd:double;|5:BEGIN|11: sss:=' ';|24: j:=round(Random*12)+2;|19: for i:=0 to j do|9: begin|18: _Rnd:=Random;|42: if _Rnd<0.0003 then sss:=sss+'ё' else|42: if _Rnd<0.0007 then sss:=sss+'ъ' else|42: if _Rnd<0.0033 then sss:=sss+'ф' else|42: if _Rnd<0.0065 then sss:=sss+'э' else|42: if _Rnd<0.0101 then sss:=sss+'щ' else|42: if _Rnd<0.0149 then sss:=sss+'ц' else|42: if _Rnd<0.0213 then sss:=sss+'ю' else|42: if _Rnd<0.0286 then sss:=sss+'ш' else|41: if _Rnd<0.038 then sss:=sss+'ж' else|42: if _Rnd<0.0477 then sss:=sss+'х' else|42: if _Rnd<0.0598 then sss:=sss+'й' else|42: if _Rnd<0.0742 then sss:=sss+'ч' else|42: if _Rnd<0.0901 then sss:=sss+'б' else|42: if _Rnd<0.1066 then sss:=sss+'з' else|42: if _Rnd<0.1236 then sss:=sss+'г' else|41: if _Rnd<0.141 then sss:=sss+'ь' else|40: if _Rnd<0.16 then sss:=sss+'ы' else|42: if _Rnd<0.1801 then sss:=sss+'я' else|42: if _Rnd<0.2063 then sss:=sss+'у' else|42: if _Rnd<0.2344 then sss:=sss+'п' else|42: if _Rnd<0.2642 then sss:=sss+'д' else|42: if _Rnd<0.2963 then sss:=sss+'м' else|42: if _Rnd<0.3312 then sss:=sss+'к' else|42: if _Rnd<0.3752 then sss:=sss+'л' else|42: if _Rnd<0.4206 then sss:=sss+'в' else|42: if _Rnd<0.4679 then sss:=sss+'р' else|42: if _Rnd<0.5226 then sss:=sss+'с' else|42: if _Rnd<0.5852 then sss:=sss+'т' else|42: if _Rnd<0.6522 then sss:=sss+'н' else|42: if _Rnd<0.7257 then sss:=sss+'и' else|42: if _Rnd<0.8058 then sss:=sss+'а' else|42: if _Rnd<0.8903 then sss:=sss+'е' else|34: if _Rnd<1 then sss:=sss+'о'; |9: end;|25: _hi_onEvent(onRes,sss);|4:END;|0:|0:|4:end.| link(onRes,13291602:doWork2,[]) } Add(StrCat,14232566,308,42) { Point(doClear) link(Str1,5097859:Var3,[(314,33)(328,33)(328,82)]) } Add(Hub,4723815,70,28) { link(onEvent1,12535190:doStart,[(193,34)(193,48)]) link(onEvent2,10227921:doRandomize,[(95,41)(95,62)]) } Add(DoData,10615171,308,98) { link(onEventData,13267547:doTrim,[]) link(Data,5097859:Var2,[]) } Add(GetDataEx,5097859,308,77) { link(Data,14232566:Result,[]) } Add(Hub,7363015,203,91) { OutCount=3 link(onEvent1,4570222:doData,[(242,97)(242,62)]) link(onEvent2,10615171:doData,[]) link(onEvent3,14232566:doClear,[(298,111)(298,55)]) } Add(DoData,4570222,252,56) { Data=String(. ) link(onEventData,13291602:doWork3,[(291,62)]) } Add(HubEx,13291602,287,42) { link(onEvent,14232566:doStrCat,[]) } Add(StrCase,3376382,406,98) { Type=3 link(onModify,12843563:onEvent1,[(445,104)(445,34)]) } Add(Trim,13267547,357,98) { Char=" " Mode=4 link(onTrim,3376382:doModify,[]) } END_SDK Add(Hub,3154751,91,126) { OutCount=3 link(onEvent1,5123609:doWork3,[(123,132)]) link(onEvent2,4110144:doWork2,[]) link(onEvent3,10119668:doWork3,[(130,146)]) } Add(HubEx,5123609,119,77) { link(onEvent,11474619:doEvent1,[]) } Add(StrList,3662929,301,98) { Point(doSave) } Add(DoData,246572,301,175) { link(onEventData,14423383:onEvent2,[(360,181)(360,34)]) link(Data,922164:Var2,[]) } Add(SDialog,6863944,217,133) { Filter="TXT|*.txt" Point(doFileName) link(onExecute,3662929:doSave,[]) } Add(TimeCounter,16188405,350,217) { link(onStop,10893304:doString,[]) } Add(Length,8654090,294,224) { link(onLength,16188405:doStop,[]) link(Str,922164:Var1,[(300,166)]) } Add(FormatStr,10893304,399,224) { DataCount=3 Mask="Сгенерировано %1 символов в %3 строках за %2 мсек" link(onFString,14423383:onEvent1,[(443,230)(443,27)]) link(Str1,8654090:Result,[(405,215)(391,215)(391,264)(300,264)]) link(Str3,3662929:Count,[(419,159)(314,159)]) } Add(GetDataEx,922164,301,161) { link(Data,3662929:Text,[]) } Add(HubEx,4110144,112,133) { Angle=1 link(onEvent,16188405:doStart,[(116,223)]) } Add(HubEx,10119668,126,112) { Angle=3 link(onEvent,3964312:doStart,[(130,111)]) } Add(Hub,11474619,238,77) { link(onEvent1,9062772:doOn,[(291,83)(291,69)]) link(onEvent2,3662929:doClear,[(291,90)(291,111)]) } Add(Hub,553711,259,105) { link(onEvent1,9062772:doOff,[(284,111)(284,62)]) link(onEvent2,8654090:doLength,[(284,118)(284,230)]) } Add(Thread,3964312,161,105) { Delay=20 FastStop=0 link(onExec,4808525:doWork2,[]) } Add(Hub,7567131,91,189) { link(onEvent1,5176239:doOperation,[]) link(onEvent2,6863944:doExecute,[(123,202)(123,181)(200,181)(200,139)]) } Add(Math,5176239,133,189) { OpType=3 Op2=1000 ResultType=0 link(onResult,12908760:doStrCat,[]) link(Op1,12180389:Var1,[(139,75)]) } Add(GetDataEx,12180389,217,70) { link(Data,11335160:Text,[]) } Add(StrCat,12908760,175,189) { Str2="Кстр.txt" link(onStrCat,6863944:doFileName,[(214,195)(214,181)(207,181)(207,146)]) } END_SDK Add(Hub,9162188,224,168) { link(onEvent1,2583656:doText,[]) link(onEvent2,5432892:doOpen,[(314,181)(314,209)]) } Add(VBJScript,5432892,343,203) { @Hint=#16:Query SQL Server| WorkPoints=#6:doOpen|7:doWrite|7:doClose|0:| EventPoints=#12:onStartTimer|13:onFinishTimer| DataPoints=#8:inputStr| Script=#33:Dim objExcel, objWorkbook, NumRow|22:Sub doWork(Data,Index)|0:|17:Select Case Index|16: Case "doOpen" |52: Set objExcel = CreateObject("Excel.Application")|46: Set objWorkbook = objExcel.Workbooks.Add()|24: objExcel.Visible = True|36: 'objExcel.ScreenUpdating = False|47: 'objExcel.Calculation = xlCalculationManual|34: 'objExcel.EnableEvents = False|38: 'objExcel.DisplayStatusBar = False|35: 'objExcel.DisplayAlerts = False|21: sys.onStartTimer nil|20: Case "doWrite" |23: NumRow = NumRow + 1|52: objExcel.ActiveSheet.Cells(NumRow, 1).Value=Data|16: Case "doClose"|25: sys.onFinishTimer nil|17: objExcel.Quit|27: Set objExcel = Nothing |10:End Select|3: |8:End Sub |1: | UseName=0 link(onStartTimer,484440:doStart,[]) link(onFinishTimer,484440:doStop,[]) } Add(LineBreak,7229618,63,147) { link(Out,4598991:doCaption,[]) Primary=[9742849,399,63] } Add(LineBreak,724145,217,210) { link(Out,1976442:doEnum,[]) Primary=[9655644,245,-21] }
Редактировалось 1 раз(а), последний 2020-11-28 18:25:32
|