Tad, ну а как тогда сделать, чтобы проставлялось конкретно в текущей ячейке, а не во всех?
------------ Дoбавленo в 21.48:
все, решил проблему
------------ Дoбавленo в 21.49:
Tad, вы гений!!! Add(MainForm,11607186,119,77) { Width=690 Height=341 Caption="график вакцинации" BorderStyle=4 Position=1 Point(doVisible) Point(onClose) link(onCreate,7309284:doEvent1,[]) } Add(MTStrTbl,15761846,868,455) { @Color=5592575 Left=200 Top=20 Width=455 Height=285 Name="график" Columns=#6:корпус|4:дата|9:поголовье|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:| TextAlign=2 Point(doVisible) } Add(Button,949453,77,413) { Left=35 Top=130 Width=135 TabOrder=-1 Caption="рассчитать" link(onClick,11771530:doString,[]) } Add(ComboBox,11406695,112,350) { Left=40 Top=20 Width=110 Height=21 Strings=#8:корпус 1|8:корпус 2|8:корпус 3|8:корпус 4|8:корпус 5| Text="корпус" Point(EditText) } Add(DatePicker,9450650,147,210) { Left=35 Top=55 Width=110 Height=21 Font=[MS Sans Serif,6,0,0,1] Point(doLeft) Point(doTop) Point(doSetFocus) Point(doBringToFront) Point(DateTime) Point(doSendToBack) Point(DateInt) link(onChange,11647900:doConvert,[(191,216)(191,248)(135,248)(135,279)]) } Add(DS_SQLite,6991059,301,98) { @Color=5636095 Name="11" FileName="7.db" Point(onError) link(onOpen,13846613:doExec,[(341,104)(341,83)]) link(onError,7054140:doEvent2,[]) } Add(Message,3808633,434,98) { } Add(DSC_Exec,13846613,343,77) { @Color=5636095 SQL="CREATE TABLE IF NOT EXISTS [grafikdata] (\r\n[id] INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,\r\n[name] TEXT,\r\n[date1] REAL,\r\n[date2] REAL,\r\n[result] REAL,\r\n[result2] REAL);" DSManager="11" link(onError,7054140:doEvent1,[(387,90)(387,104)]) } Add(LineBreakEx,8042414,357,112) { Type=1 link(OnEvent,7054140:doEvent3,[]) } Add(DSC_Exec,12182020,273,406) { @Color=5636095 DSManager="11" link(onExec,10771421:doEvent1,[]) link(onError,3606489:doWork,[(310,419)(310,426)]) } Add(FormatStr,11771530,133,413) { DataCount=4 Mask="INSERT INTO [grafikdata] ([name], [date1], [date2]) VALUES('%1', '%2', '%3'); " link(onFString,14909773:doEvent2,[(176,419)(176,447)]) link(Str1,11406695:String,[(139,404)(125,404)]) link(Str2,13542443:Value,[(146,359)(195,359)]) link(Str3,9526050:Value,[(153,352)(307,352)]) } Add(MST_DB,10553212,868,413) { @Color=5592575 MSTControl="график" Point(doClearAll) Point(doClear) } Add(LineBreakEx,3606489,315,420) { } Add(Hub,10771421,336,406) { OutCount=5 link(onEvent1,10553212:doClearAll,[(365,412)(365,392)(679,385)(679,433)]) link(onEvent2,15451509:doData,[]) link(onEvent4,4614904:doQuery,[(364,433)(364,475)]) } Add(DSC_Query,4614904,371,469) { @Color=5636095 SQL="SELECT [name], [date1], [date2], [result], strftime('%J',date(date2)) - strftime('%J',date(date1)) from [grafikdata]" DSManager="11" link(onQuery,13313127:doEvent1,[]) link(onError,3923348:doWork,[]) } Add(LineBreakEx,3923348,420,483) { } Add(DoData,15451509,392,413) { Data=String(корпус) link(onEventData,3754311:doAdd,[]) } Add(MT_Add,3754311,434,413) { Data=String(поголовье) link(onAdd,14482110:doAdd,[]) } Add(HubEx,9772768,658,420) { link(onEvent,10553212:doAddCols,[(706,426)(706,405)(815,405)(815,426)]) } Add(MT_MultiMem,15251959,560,441) { Count=5 } Add(Hub,13313127,441,469) { OutCount=4 link(onEvent1,15251959:doValue,[(507,475)(507,447)]) link(onEvent2,8156537:doString,[(525,482)(525,531)]) link(onEvent3,10341187:doAdd,[(536,489)(536,678)]) } Add(MT_AddData,10341187,553,672) { Count=5 link(onAdd,10553212:doAddRow,[(781,678)(781,419)]) link(Data1,15251959:Value1,[(559,572)(566,572)]) link(Data2,15251959:Value2,[(566,572)(573,572)]) link(Data3,15251959:Value3,[(573,572)(580,572)]) link(Data4,4303723:Value,[(580,614)(762,614)]) link(Data5,15251959:Value5,[(587,572)(594,572)]) } Add(Hub,7309284,168,91) { OutCount=3 link(onEvent1,6991059:doOpen,[(242,97)(242,104)(290,101)]) link(onEvent2,922736:doMTString,[(200,104)(200,132)]) link(onEvent3,6668430:In,[(200,111)(200,160)]) } Add(MT_String,922736,217,112) { link(onResult,2904434:doRowAction,[]) } Add(MST_RowAction,2904434,259,112) { @Color=5592575 MSTControl="график" } Add(Hub,7054140,399,98) { InCount=3 link(onEvent1,3808633:doMessage,[]) } Add(Hub,14909773,245,434) { InCount=2 link(onEvent1,12182020:doExec,[(266,440)(266,412)]) } Add(LineBreak,5187788,189,427) { Caption="база1" link(Out,14909773:doEvent1,[(239,433)(239,440)]) Primary=[6668430,28,-273] } Add(MT_Add,13615503,522,413) { Data=String(вывод) link(onAdd,6589868:doAdd,[(562,419)(562,412)]) } Add(GetDataEx,8895160,777,641) { Angle=1 } Add(GetDataEx,10574426,595,504) { } Add(FormatStr,8156537,595,525) { DataCount=1 Mask="SELECT strftime('%d', 'now',"+1 days") from [grafikdata];\r\n" link(onFString,11422646:doQuery,[]) link(Str1,15251959:Value4,[(601,499)(587,499)]) } Add(DSC_Query,11422646,637,525) { @Color=5636095 DSManager="11" link(onQuery,4303723:doValue,[]) link(onError,6059374:doWork,[]) } Add(LineBreakEx,6059374,679,539) { } Add(MT_Memory,4303723,756,525) { } Add(DateConvertor,11647900,147,273) { Mode=9 Format="yyyy-MM-dd" Point(Data) link(onResult,13542443:doValue,[]) link(Data,9450650:DateInt,[(153,264)(160,264)]) } Add(Memory,13542443,189,273) { } Add(Button,13092170,63,280) { Left=45 Top=270 link(onClick,10553212:doClear,[(481,286)(481,440)]) } Add(FormatStr,4407252,595,602) { DataCount=1 Mask="SELECT strftime('%J',date(date2)) - strftime('%J',date(date1)) from [grafikdata];\r\n\r\n\r\n" link(onFString,13712482:doQuery,[]) } Add(DSC_Query,13712482,637,602) { @Color=5636095 DSManager="11" link(onQuery,15304954:doValue,[]) link(onError,2500762:doWork,[]) } Add(LineBreakEx,2500762,679,616) { } Add(MT_Memory,15304954,805,602) { } Add(MT_Add,14482110,480,413) { Data=String(вывод) link(onAdd,13615503:doAdd,[]) } Add(DatePicker,9834281,259,196) { Left=35 Top=90 Width=110 Height=21 Font=[MS Sans Serif,6,0,0,1] Point(doLeft) Point(doTop) Point(doSetFocus) Point(doBringToFront) Point(DateTime) Point(doSendToBack) Point(DateInt) link(onChange,14156535:doConvert,[(303,202)(303,234)(247,234)(247,265)]) } Add(DateConvertor,14156535,259,259) { Mode=9 Format="yyyy-MM-dd" Point(Data) link(onResult,9526050:doValue,[]) link(Data,9834281:DateInt,[(265,250)(272,250)]) } Add(Memory,9526050,301,259) { } Add(MT_Add,6589868,571,406) { Data=String(вывод) link(onAdd,9772768:doWork1,[(662,412)]) }
теперь работает
------------ Дoбавленo в 21.51:
но теперь не обновляется результат расчетов при изменении текущей даты
------------ Дoбавленo в 22.01:
все работает как всегда моя не внимательность - все работает прекрасно вот работающий код Add(MainForm,11607186,182,161) { Width=690 Height=341 Caption="график вакцинации" BorderStyle=4 Position=1 Point(doVisible) Point(onClose) link(onCreate,7309284:doEvent1,[]) } Add(MTStrTbl,15761846,931,539) { @Color=5592575 Left=200 Top=20 Width=455 Height=285 Name="график" Columns=#6:корпус|4:дата|9:поголовье|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:|0:| TextAlign=2 Point(doVisible) } Add(Button,949453,140,497) { Left=35 Top=130 Width=135 TabOrder=-1 Caption="рассчитать" link(onClick,11771530:doString,[]) } Add(ComboBox,11406695,175,434) { Left=40 Top=20 Width=110 Height=21 Strings=#8:корпус 1|8:корпус 2|8:корпус 3|8:корпус 4|8:корпус 5| Text="корпус" Point(EditText) } Add(DatePicker,9450650,210,294) { Left=35 Top=55 Width=110 Height=21 Font=[MS Sans Serif,6,0,0,1] Point(doLeft) Point(doTop) Point(doSetFocus) Point(doBringToFront) Point(DateTime) Point(doSendToBack) Point(DateInt) link(onChange,11647900:doConvert,[(254,300)(254,332)(198,332)(198,363)]) } Add(DS_SQLite,6991059,364,182) { @Color=5636095 Name="11" FileName="77.db" Point(onError) link(onOpen,13846613:doExec,[(404,188)(404,167)]) link(onError,7054140:doEvent2,[]) } Add(Message,3808633,497,182) { } Add(DSC_Exec,13846613,406,161) { @Color=5636095 SQL="CREATE TABLE IF NOT EXISTS [grafikdata] (\r\n[id] INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,\r\n[name] TEXT,\r\n[date1] REAL,\r\n[date2] REAL,\r\n[result] REAL,\r\n[result2] REAL);" DSManager="11" link(onError,7054140:doEvent1,[(450,174)(450,188)]) } Add(LineBreakEx,8042414,420,196) { Type=1 link(OnEvent,7054140:doEvent3,[]) } Add(DSC_Exec,12182020,336,490) { @Color=5636095 DSManager="11" link(onExec,10771421:doEvent1,[]) link(onError,3606489:doWork,[(373,503)(373,510)]) } Add(FormatStr,11771530,196,497) { DataCount=4 Mask="INSERT INTO [grafikdata] ([name], [date1], [date2]) VALUES('%1', '%2', '%3'); " link(onFString,14909773:doEvent2,[(239,503)(239,531)]) link(Str1,11406695:String,[(202,488)(188,488)]) link(Str2,13542443:Value,[(209,443)(258,443)]) link(Str3,9526050:Value,[(216,436)(370,436)]) } Add(MST_DB,10553212,931,497) { @Color=5592575 MSTControl="график" Point(doClearAll) Point(doClear) } Add(LineBreakEx,3606489,378,504) { } Add(Hub,10771421,399,490) { OutCount=5 link(onEvent1,10553212:doClearAll,[(428,496)(428,476)(742,469)(742,517)]) link(onEvent2,15451509:doData,[]) link(onEvent4,4614904:doQuery,[(427,517)(427,559)]) } Add(DSC_Query,4614904,434,553) { @Color=5636095 SQL="SELECT [name], [date1], [date2], [result], strftime('%J',date('now','localtime')) - strftime('%J',date(date1)) from [grafikdata]" DSManager="11" link(onQuery,13313127:doEvent1,[]) link(onError,3923348:doWork,[]) } Add(LineBreakEx,3923348,483,567) { } Add(DoData,15451509,455,497) { Data=String(корпус) link(onEventData,3754311:doAdd,[]) } Add(MT_Add,3754311,497,497) { Data=String(поголовье) link(onAdd,14482110:doAdd,[]) } Add(HubEx,9772768,721,504) { link(onEvent,10553212:doAddCols,[(769,510)(769,489)(878,489)(878,510)]) } Add(MT_MultiMem,15251959,623,525) { Count=5 } Add(Hub,13313127,504,553) { OutCount=4 link(onEvent1,15251959:doValue,[(570,559)(570,531)]) link(onEvent2,8156537:doString,[(588,566)(588,615)]) link(onEvent3,10341187:doAdd,[(599,573)(599,762)]) } Add(MT_AddData,10341187,616,756) { Count=5 link(onAdd,10553212:doAddRow,[(844,762)(844,503)]) link(Data1,15251959:Value1,[(622,656)(629,656)]) link(Data2,15251959:Value2,[(629,656)(636,656)]) link(Data3,15251959:Value3,[(636,656)(643,656)]) link(Data4,4303723:Value,[(643,698)(825,698)]) link(Data5,15251959:Value5,[(650,656)(657,656)]) } Add(Hub,7309284,231,175) { OutCount=3 link(onEvent1,6991059:doOpen,[(305,181)(305,188)(353,185)]) link(onEvent2,922736:doMTString,[(263,188)(263,216)]) link(onEvent3,6668430:In,[(263,195)(263,244)]) } Add(MT_String,922736,280,196) { link(onResult,2904434:doRowAction,[]) } Add(MST_RowAction,2904434,322,196) { @Color=5592575 MSTControl="график" } Add(Hub,7054140,462,182) { InCount=3 link(onEvent1,3808633:doMessage,[]) } Add(Hub,14909773,308,518) { InCount=2 link(onEvent1,12182020:doExec,[(329,524)(329,496)]) } Add(LineBreak,8365797,252,511) { Caption="база1" link(Out,14909773:doEvent1,[(302,517)(302,524)]) Primary=[6668430,28,-273] } Add(MT_Add,13615503,585,497) { Data=String(вывод) link(onAdd,6589868:doAdd,[(625,503)(625,496)]) } Add(GetDataEx,8895160,840,725) { Angle=1 } Add(GetDataEx,10574426,658,588) { } Add(FormatStr,8156537,658,609) { DataCount=1 Mask="SELECT strftime('%d', 'now',"+1 days") from [grafikdata];\r\n" link(onFString,11422646:doQuery,[]) link(Str1,15251959:Value4,[(664,583)(650,583)]) } Add(DSC_Query,11422646,700,609) { @Color=5636095 DSManager="11" link(onQuery,4303723:doValue,[]) link(onError,6059374:doWork,[]) } Add(LineBreakEx,6059374,742,623) { } Add(MT_Memory,4303723,819,609) { } Add(DateConvertor,11647900,210,357) { Mode=9 Format="yyyy-MM-dd" Point(Data) link(onResult,13542443:doValue,[]) link(Data,9450650:DateInt,[(216,348)(223,348)]) } Add(Memory,13542443,252,357) { } Add(Button,13092170,126,364) { Left=45 Top=270 link(onClick,10553212:doClear,[(544,370)(544,524)]) } Add(FormatStr,4407252,658,686) { DataCount=1 Mask="SELECT strftime('%J',date('now','localtime')) - strftime('%J',date(date1)) from [grafikdata];\r\n\r\n\r\n" link(onFString,13712482:doQuery,[]) } Add(DSC_Query,13712482,700,686) { @Color=5636095 DSManager="11" link(onQuery,15304954:doValue,[]) link(onError,2500762:doWork,[]) } Add(LineBreakEx,2500762,742,700) { } Add(MT_Memory,15304954,868,686) { } Add(MT_Add,14482110,543,497) { Data=String(вывод) link(onAdd,13615503:doAdd,[]) } Add(DatePicker,9834281,322,280) { Left=35 Top=90 Width=110 Height=21 Font=[MS Sans Serif,6,0,0,1] Point(doLeft) Point(doTop) Point(doSetFocus) Point(doBringToFront) Point(DateTime) Point(doSendToBack) Point(DateInt) link(onChange,14156535:doConvert,[(366,286)(366,318)(310,318)(310,349)]) } Add(DateConvertor,14156535,322,343) { Mode=9 Format="yyyy-MM-dd" Point(Data) link(onResult,9526050:doValue,[]) link(Data,9834281:DateInt,[(328,334)(335,334)]) } Add(Memory,9526050,364,343) { } Add(MT_Add,6589868,634,490) { Data=String(вывод) link(onAdd,9772768:doWork1,[(725,496)]) }
------------ Дoбавленo в 22.02:
Tad, подскажите пожалуйста, как работать с dll можно например вынести часть кода во внешнюю библиотеку и оттуда через базу вытаскивать данные?
------------ Дoбавленo в 22.04:
Ребята, спасибо Вам огромное! Благодаря Вам я начал понимать sqlite
|