Add(MainForm,15019180,91,147)
{
Width=665
Point(onClose)
link(onCreate,9729545:doOpen,[])
link(onClose,9729545:doClose,[])
}
Add(MultiElement,3210884,322,161)
{
link(onEvent1,4655935:doExec,[])
link(onEvent2,9443036:doEvent1,[(365,174)(365,202)])
link(Data1,16470552:Value,[])
}
BEGIN_SDK
Add(EditMulti,90280,28,21)
{
EventCount=2
WorkCount=2
DataCount=1
Width=636
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,158)(603,158)(603,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,1516465:Var3,[(167,40)(146,40)(146,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,131368:doString,[])
}
Add(Trim,16600547,357,98)
{
Char=" "
Mode=4
link(onTrim,14266070:doModify,[])
}
Add(FormatStr,131368,469,98)
{
DataCount=3
Mask="INSERT INTO [tabl]\r\n VALUES\r\n (%1\r\n ,'%2'\r\n ,%3);\r\n"
link(onFString,90280:onEvent1,[(508,104)(508,34)])
link(Str1,15286128:Position,[(475,89)(461,89)(461,138)(55,138)])
link(Str3,1516465:Var2,[(489,82)(349,82)(349,124)(111,124)])
}
Add(GetDataEx,1516465,105,84)
{
link(Data,9486001:Random,[])
}
END_SDK
Add(DS_SQLite,9729545,140,161)
{
Name="testdb"
FileName=":memory:"
link(onOpen,876903:doExec,[])
}
Add(Hub,11367232,238,161)
{
link(onEvent1,3210884:doWork1,[])
link(onEvent2,3646847:doStart,[])
}
Add(Memory,16470552,322,98)
{
@Hint=#12:Кол-во строк|
Default=Integer(50000)
AddHint(-201,-26,81,13,@Hint)
AddHint(-189,-2,45,13,Default)
}
Add(DSC_Exec,876903,189,161)
{
SQL="CREATE TABLE IF NOT EXISTS tabl(\r\nid INTEGER PRIMARY KEY,\r\nrandomtext TEXT,\r\nrandomnumber INTEGER); "
DSManager="testdb"
link(onExec,11367232:doEvent1,[])
}
Add(DSC_Exec,4655935,378,161)
{
DSManager="testdb"
}
Add(MST_Virtual,15555683,826,168)
{
SubItemName=0
MSTControl="MTStrTbl"
Point(doSetVirtIdx)
Point(VirtIdx)
Point(doInitPage)
link(VirtualData,10538242:GetData,[])
}
Add(MathParse,4883725,560,259)
{
MathStr="(%2 - sign(%1) * 3) * ((%2 - sign(%1) * 3) >= 0)"
ResultType=0
link(onResult,5531226:doCompare,[])
link(X2,15555683:CurVirtIdx,[(573,250)(832,250)])
}
Add(If_else,5531226,609,259)
{
Type=1
link(onTrue,7810322:doEvent2,[(767,265)(767,202)])
link(Op2,15341198:Result,[])
}
Add(MTStrTbl,7148080,427,126)
{
Width=629
Height=261
Align=5
Name="MTStrTbl"
Columns=#5:id=50|14:randomtext=500|15:randomnumber=50|
VirtualTab=0
Redaction=0
Point(PerPage)
Point(onResize)
Point(onMouseWheel)
link(onResize,11255964:doData,[(487,160)(487,230)])
link(onMouseWheel,2543718:doEvent1,[(480,167)(480,265)])
}
Add(ScrollBar,16623256,728,189)
{
Left=629
Width=20
Height=261
Align=3
Kind=1
Point(doMax)
Point(doPage)
link(onPosition,7810322:doEvent1,[])
}
Add(Hub,7810322,784,189)
{
InCount=2
link(onEvent1,16623256:doPosition,[(809,195)(809,181)(718,181)(718,195)])
link(onEvent2,15555683:doSetVirtIdx,[])
}
Add(ChangeMon,11255964,504,224)
{
link(onData,2080716:doEvent1,[])
link(Data,2178588:Var2,[])
}
Add(Math,3982646,665,196)
{
OpType=1
ResultType=0
link(onResult,16623256:doMax,[])
link(Op2,2178588:Var3,[(678,180)])
}
Add(Hub,2080716,553,224)
{
OutCount=3
link(onEvent1,15022148:doEvent2,[(578,230)(578,209)])
link(onEvent2,16623256:doPage,[(718,237)(718,209)])
link(onEvent3,15555683:doInitPage,[(802,244)(802,209)])
}
Add(EventFromData,10538242,826,119)
{
link(onEvent,2121123:doString,[])
}
Add(FormatStr,2121123,875,119)
{
DataCount=3
Mask="SELECT %3\r\nFROM tabl \r\nWHERE\r\n (id = %1) AND\r\n (id <= (Select Max(id) FROM tabl))\r\nLIMIT 1"
link(onFString,14158325:doQuery,[])
}
Add(DSC_QueryScalar,14158325,924,119)
{
DSManager="testdb"
link(onQuery,10538242:doData,[(963,125)(963,111)(816,111)(816,125)])
}
Add(DSC_QueryScalar,15341198,616,196)
{
SQL="SELECT COUNT(*) FROM tabl"
DSManager="testdb"
link(onQuery,3982646:doOperation,[])
}
Add(Thread,3646847,273,168)
{
Delay=20
FastStop=0
link(onExec,3210884:doWork2,[])
}
Add(Hub,2543718,511,259)
{
InCount=2
OutCount=1
link(onEvent1,4883725:doCalc,[])
}
Add(Hub,9443036,441,196)
{
link(onEvent1,15022148:doEvent1,[])
link(onEvent2,2543718:doEvent2,[(473,209)(473,272)])
}
Add(Hub,15022148,588,196)
{
InCount=2
OutCount=1
link(onEvent1,15341198:doQuery,[])
}
Add(GetDataEx,2178588,504,175)
{
Angle=3
link(Data,7148080:PerPage,[(461,180)])
}
Ответов: 783
Рейтинг: 168
|
|||
И такой вариант тоже возможен.
|
|||
карма: 15 |
|
Редактировалось 5 раз(а), последний 2020-12-17 20:49:25