dtime - это столбик в таблице "вывод". Я предполагал расчет [vozrast] вести: [текущая дата]-[dtime]
------------ Дoбавленo в 22.39:
Add(MainForm,11607186,182,84)
{
Width=954
Height=598
Caption="график вакцинации"
BorderStyle=4
Position=1
Point(doVisible)
Point(onClose)
link(onCreate,7309284:doEvent1,[])
}
Add(MTStrTbl,15761846,882,644)
{
@Color=5592575
Left=285
Top=45
Width=570
Height=215
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,56,602)
{
Left=420
Top=15
Width=135
TabOrder=-1
Caption="рассчитать"
link(onClick,11771530:doString,[])
}
Add(ComboBox,11406695,126,539)
{
Left=300
Top=15
Width=110
Height=21
Strings=#8:корпус 1|8:корпус 2|8:корпус 3|8:корпус 4|8:корпус 5|
Text="корпус"
Point(EditText)
}
Add(MTStrTbl,5113738,553,371)
{
@Color=43520
Left=20
Top=115
Width=250
Height=155
Name="вакцинация"
Columns=#14:ВАКЦИНАЦИЯ=150|17:ВОЗРАСТ (ДНИ)=100|
Redaction=0
Point(doSetFocus)
Point(onSelect)
Point(doVisible)
}
Add(Edit,16767801,161,308)
{
Left=101
Top=45
Width=110
Text="0"
DataType=2
}
Add(Button,12084787,42,371)
{
Left=15
Top=70
Width=195
Height=30
TabOrder=-1
Caption="добавить"
Point(doSetFocus)
link(onClick,6806148:doEvent2,[])
}
Add(ComboBox,4864849,119,308)
{
Left=95
Top=10
Width=125
Height=21
Strings=#2:БМ|2:БГ|2:БН|3:ИБК|3:ИЛТ|
Text="вакцинацияя"
Point(EditText)
}
Add(DatePicker,9450650,168,455)
{
Left=565
Top=15
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(CurrentDateTime)
link(onChange,13250376:doEvent1,[])
}
Add(DS_SQLite,6991059,364,105)
{
@Color=5636095
Name="11"
FileName="memory.db"
Point(onError)
link(onOpen,13846613:doExec,[(404,111)(404,90)])
link(onError,7054140:doEvent2,[])
}
Add(Message,3808633,497,105)
{
}
Add(DSC_Exec,13846613,406,84)
{
@Color=5636095
SQL="CREATE TABLE IF NOT EXISTS [vakcina] (\r\n[id] INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,\r\n[name] TEXT,\r\n[number] INTEGER);\r\n\r\nCREATE TABLE IF NOT EXISTS [grafikdata] (\r\n[id] INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,\r\n[name] TEXT,\r\n[vozrast] REAL,\r\n[golov] REAL,\r\n[dtime] REAL);\r\n\r\nCREATE TABLE IF NOT EXISTS [grafikname] (\r\n[id] INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,\r\n[name] TEXT,\r\n[golov1] TEXT,\r\n[ups] TEXT);"
DSManager="11"
link(onError,7054140:doEvent1,[(450,97)(450,111)])
}
Add(DSC_Exec,7884957,301,357)
{
@Color=5636095
DSManager="11"
link(onExec,15277953:doEvent1,[])
link(onError,14022728:doWork,[(338,370)(338,377)])
}
Add(FormatStr,8126504,154,364)
{
Mask="INSERT INTO [vakcina] ([name], [number]) VALUES('%1', %2); "
link(onFString,15049159:doEvent2,[])
link(Str1,4864849:String,[(160,359)(132,359)])
link(Str2,16767801:Text,[])
}
Add(MST_DB,953009,511,371)
{
@Color=43520
MSTControl="вакцинация"
Point(doClear)
}
Add(Hub,15277953,364,357)
{
link(onEvent1,13439786:doEvent1,[(472,363)(472,391)])
link(onEvent2,11511635:doQuery,[(385,370)(385,377)])
}
Add(DSC_Query,11511635,392,371)
{
@Color=5636095
SQL="SELECT [name], [number] from [vakcina]"
DSManager="11"
link(onQuery,953009:doAddRow,[])
link(onError,12129855:doWork,[])
}
Add(LineBreakEx,14022728,343,371)
{
}
Add(LineBreakEx,8042414,420,119)
{
Type=1
link(OnEvent,7054140:doEvent3,[])
}
Add(LineBreakEx,12129855,434,385)
{
Caption="1"
}
Add(DSC_Exec,12182020,287,595)
{
@Color=5636095
DSManager="11"
link(onExec,10771421:doEvent1,[])
link(onError,3606489:doWork,[(324,608)(324,615)])
}
Add(FormatStr,11771530,147,602)
{
DataCount=4
Mask="INSERT INTO [grafikdata] ([name], [vozrast], [golov], [dtime]) VALUES('%1', '%2', %3, %4); \r\nINSERT INTO [grafikname] ([name], [golov1], [ups]) VALUES('%1', %2, '%3'); "
link(onFString,14909773:doEvent2,[(190,608)(190,636)])
link(Str1,11406695:String,[(153,593)(139,593)])
link(Str2,269458:Text,[(160,590)(216,590)])
link(Str3,15451964:Text,[(167,586)(265,586)])
link(Str4,16251723:Data1,[])
}
Add(MST_DB,10553212,882,602)
{
@Color=5592575
MSTControl="график"
Point(doClearAll)
Point(doClear)
}
Add(LineBreakEx,3606489,329,609)
{
}
Add(Hub,10771421,350,595)
{
OutCount=5
link(onEvent1,2288361:doEvent2,[(379,601)(379,581)])
link(onEvent2,15451509:doData,[])
link(onEvent3,12922371:doQuery,[(394,615)(394,640)(623,640)(623,622)])
link(onEvent4,4614904:doQuery,[(378,622)(378,664)])
}
Add(DSC_Query,4614904,385,658)
{
@Color=5636095
SQL="SELECT [name], [vozrast], [golov], strftime("%d.%m.%Y", 1721424.5 + [dtime]), [dtime] from [grafikdata]"
DSManager="11"
link(onQuery,13313127:doEvent1,[])
link(onError,3923348:doWork,[])
}
Add(LineBreakEx,3923348,434,672)
{
}
Add(DSC_Query,12922371,630,616)
{
@Color=5636095
SQL="SELECT [name] from [vakcina]"
DSManager="11"
link(onQuery,9772768:doWork2,[(668,622)(668,615)])
link(onError,4829472:doWork,[])
}
Add(LineBreakEx,4829472,679,630)
{
}
Add(DoData,15451509,406,602)
{
Data=String(корпус)
link(onEventData,3754311:doAdd,[])
}
Add(MT_Add,3754311,448,602)
{
Data=String(поголовье)
link(onAdd,10823801:doAdd,[])
}
Add(HubEx,9772768,672,609)
{
link(onEvent,10498153:doEvent1,[])
}
Add(FormatStr,8156537,595,707)
{
DataCount=1
Mask="SELECT strftime("%d.%m.%Y", 1721424.5 + %1 + [number]) from [vakcina]"
link(onFString,11422646:doQuery,[])
link(Str1,15251959:Value5,[])
}
Add(DSC_Query,11422646,637,707)
{
@Color=5636095
DSManager="11"
link(onQuery,10214565:doAdd,[])
link(onError,6059374:doWork,[])
}
Add(LineBreakEx,6059374,679,721)
{
}
Add(MT_MultiMem,15251959,567,658)
{
Count=5
}
Add(Hub,13313127,455,658)
{
OutCount=6
link(onEvent1,15251959:doValue,[])
link(onEvent2,8156537:doString,[(557,671)(557,713)])
link(onEvent3,10341187:doAdd,[(550,678)(550,867)])
link(onEvent4,4303723:doClear,[(644,685)(644,720)])
}
Add(MT_Memory,4303723,756,707)
{
}
Add(MT_Add,10214565,700,707)
{
InputMT=1
link(onAdd,4303723:doValue,[])
link(Data,15937933:Var3,[(706,691)(748,691)])
}
Add(MT_AddData,10341187,567,861)
{
Count=5
link(onAdd,10553212:doAddRow,[(795,867)(795,608)])
link(Data1,15251959:Value1,[])
link(Data2,15251959:Value2,[])
link(Data3,15251959:Value3,[])
link(Data4,15251959:Value4,[])
link(Data5,15937933:Var1,[(601,747)])
}
Add(GetDataEx,15937933,742,742)
{
Angle=1
link(Data,4303723:Value,[(762,747)])
}
Add(Label,2084213,119,266)
{
Left=15
Top=15
Width=64
Height=17
Caption="вакцинация"
}
Add(Label,6975909,161,266)
{
Left=15
Top=45
Width=78
Height=17
Caption="возраст (дней)"
}
Add(Button,8086717,133,42)
{
Left=865
Top=80
Width=65
Height=25
Hint="Сворачивает в трей"
Caption="Свернуть"
link(onClick,3126296:doEvent1,[])
}
Add(TrayIcon,6079368,294,35)
{
Hint="софтинка"
FormHook=0
ShowWORemoveIcon=0
Text="двойной клик - развернуть"
link(onDblClick,11103182:doCase,[])
}
Add(Case,11103182,336,42)
{
Value=Integer(0)
link(onTrue,7275996:doEvent1,[])
}
Add(Hub,3126296,266,42)
{
InCount=2
OutCount=1
link(onEvent1,6079368:doHide,[])
}
Add(ChanelToIndex,12581794,441,49)
{
link(onIndex,11607186:doVisible,[(480,55)(480,21)(109,21)(109,118)])
}
Add(Hub,7275996,378,49)
{
link(onEvent1,6079368:doShow,[(397,55)(397,27)(289,27)(289,41)])
link(onEvent2,12581794:doWork2,[])
}
Add(Hub,7309284,231,98)
{
OutCount=8
link(onEvent1,3126296:doEvent2,[(259,104)(259,55)])
link(onEvent2,6991059:doOpen,[])
link(onEvent3,922736:doMTString,[(271,118)(271,139)])
link(onEvent4,6668430:In,[(266,125)(266,167)])
link(onEvent5,8909681:In,[(259,132)(259,181)])
link(onEvent8,12328708:doMTString,[(263,153)(263,216)])
}
Add(Button,9281433,133,77)
{
Left=865
Top=50
Width=65
Height=25
Caption="Закрыть"
link(onClick,11607186:doClose,[(170,83)(170,111)])
}
Add(MT_String,922736,280,119)
{
link(onResult,2904434:doRowAction,[])
}
Add(MST_RowAction,2904434,322,119)
{
@Color=5592575
MSTControl="график"
}
Add(Hub,7054140,462,105)
{
InCount=3
link(onEvent1,3808633:doMessage,[])
}
Add(Button,4038752,392,462)
{
Left=20
Top=310
Width=195
Height=35
Caption="очистить"
link(onClick,13172925:doEvent1,[])
}
Add(DSC_Exec,16152874,497,469)
{
@Color=5636095
SQL="delete from vakcina;\r\ndelete from grafikdata;\r\ndelete from grafikname;"
DSManager="11"
}
Add(Hub,13172925,455,462)
{
OutCount=3
link(onEvent1,13439786:doEvent2,[(480,468)(480,398)])
link(onEvent2,16152874:doExec,[])
link(onEvent3,2288361:doEvent1,[(476,482)(476,574)])
}
Add(Hub,2288361,490,568)
{
InCount=2
link(onEvent1,10553212:doClearAll,[(693,574)(693,622)])
}
Add(Hub,13439786,483,385)
{
InCount=2
OutCount=1
link(onEvent1,953009:doClear,[])
}
Add(Hub,14909773,259,623)
{
InCount=2
link(onEvent1,12182020:doExec,[(280,629)(280,601)])
}
Add(LineBreak,14019031,203,616)
{
Caption="база1"
link(Out,14909773:doEvent1,[(253,622)(253,629)])
Primary=[6668430,77,-455]
}
Add(LineBreak,432956,210,350)
{
Caption="база 2"
link(Out,15049159:doEvent1,[(265,356)(265,363)])
Primary=[8909681,70,-175]
}
Add(Hub,15049159,273,357)
{
InCount=2
link(onEvent1,7884957:doExec,[])
}
Add(MT_String,12328708,280,196)
{
link(onResult,7998381:doRowAction,[])
}
Add(MST_RowAction,7998381,322,196)
{
@Color=22015
MSTControl="график2"
}
Add(Hub,10498153,763,609)
{
link(onEvent1,10553212:doAddCols,[])
}
Add(InfoTip,7056213,371,441)
{
Info=#13:очистить базу|
Font=[MS Sans Serif,9,1,0,1]
Width=190
Height=102
}
Add(GetData,16251723,168,546)
{
Count=4
link(Data,11168039:Var2,[])
}
Add(Hub,13250376,217,455)
{
OutCount=3
link(onEvent1,15645073:doCalc,[(243,461)(243,657)(191,657)(191,853)])
}
Add(Hub,6806148,91,364)
{
InCount=2
OutCount=1
link(onEvent1,8126504:doString,[])
}
Add(MT_Add,10823801,490,602)
{
Data=String(возраст)
link(onAdd,13615503:doAdd,[(529,608)(529,608)])
}
Add(Edit,269458,210,546)
{
Left=685
Top=15
Text="100"
DataType=2
}
Add(Edit,15451964,259,539)
{
Left=745
Top=16
Text="1"
DataType=2
}
Add(MT_Add,13615503,536,602)
{
Data=String(вывод)
link(onAdd,9772768:doWork1,[(676,608)])
}
Add(DateDiff,15645073,203,847)
{
link(onCalc,1509445:doSeparateMT,[])
link(DateTime1,9450650:CurrentDateTime,[(209,673)(181,673)])
link(DateTime2,11168039:Var3,[(216,523)])
}
Add(Label,7656362,336,854)
{
Left=95
Top=415
Width=400
Height=60
Font=[MS Sans Serif,12,1,0,1]
Caption="0"
}
Add(GetDataEx,11168039,168,518)
{
link(Data,9450650:DateTime,[])
}
Add(MT_MultiData,1509445,266,847)
{
link(onData2,15451964:doText,[(310,860)(310,702)(247,702)(247,545)])
}
Уважаемый, Tad, я прикрутил к своей схеме ваш пример. Все норм, спасибо но одна проблемка. Меняю в системе компа дату, перезапускаю программу, но в таблице данные возраста без изменения. Должно быть динамичными. Можно конечно использовать timer, но я помню, что вы его не признаете