1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
| procedure TForm9.calcul(tps1:tdatetime;s1,s2,s3,s4,s5,s6,s7,s8,s9,s10,s11,s12,s13,s14,s15,s16,s17,s18,s19,s20,s21,s22,s23,s24:integer);
var pat1,pat2,pat3,pat4,pat5,pat6,pat7,pat8,pat9,pat10,pat11,pat12,pat13,pat14,pat15,pat16,pat17,pat18,pat19,pat20,pat21,pat22,pat23,pat24:integer;
begin
pat1:=s1;
pat2:=s2;
pat3:=s3;
pat4:=s4;
pat5:=s5;
pat6:=s6;
pat7:=s7;
pat8:=s8;
pat9:=s9;
pat10:=s10;
pat11:=s11;
pat12:=s12;
pat13:=s13;
pat14:=s14;
pat15:=s15;
pat16:=s16;
pat17:=s17;
pat18:=s18;
pat19:=s19;
pat20:=s20;
pat21:=s21;
pat22:=s22;
pat23:=s23;
pat24:=s24;
if (tps1>=strtotime('06:00:00'))and (tps1<=strtotime('07:00:00')) then
s1:=s1+1;
if (tps1>=strtotime('07:00:00'))and (tps1<=strtotime('08:00:00')) then
s2:=s2+1;
if (tps1>=strtotime('08:00:00'))and (tps1<=strtotime('09:00:00')) then
s3:=s3+1;
if (tps1>=strtotime('09:00:00'))and (tps1<=strtotime('10:00:00')) then
s4:=s4+1;
if (tps1>=strtotime('10:00:00'))and (tps1<=strtotime('11:00:00')) then
s5:=s5+1;
if (tps1>=strtotime('11:00:00'))and (tps1<=strtotime('12:00:00')) then
s6:=s6+1;
if (tps1>=strtotime('12:00:00'))and (tps1<=strtotime('13:00:00')) then
s7:=s7+1;
if (tps1>=strtotime('13:00:00'))and (tps1<=strtotime('14:00:00')) then
s8:=s8+1;
if (tps1>=strtotime('14:00:00'))and (tps1<=strtotime('15:00:00')) then
s9:=s9+1;
if (tps1>=strtotime('15:00:00'))and (tps1<=strtotime('16:00:00')) then
s10:=s10+1;
if (tps1>=strtotime('16:00:00'))and (tps1<=strtotime('17:00:00')) then
s11:=s11+1;
if (tps1>=strtotime('17:00:00'))and (tps1<=strtotime('18:00:00')) then
s12:=s12+1;
if (tps1>=strtotime('18:00:00'))and (tps1<=strtotime('19:00:00')) then
s13:=s13+1;
if (tps1>=strtotime('19:00:00'))and (tps1<=strtotime('20:00:00')) then
s14:=s14+1;
if (tps1>=strtotime('20:00:00'))and (tps1<=strtotime('21:00:00')) then
s15:=s15+1;
if (tps1>=strtotime('21:00:00'))and (tps1<=strtotime('22:00:00')) then
s16:=s16+1;
if (tps1>=strtotime('22:00:00'))and (tps1<=strtotime('23:00:00')) then
s17:=s17+1;
if (tps1>=strtotime('23:00:00'))and (tps1<=strtotime('00:00:00')) then
s18:=s18+1;
if (tps1>=strtotime('00:00:00'))and (tps1<=strtotime('01:00:00')) then
s19:=s19+1;
if (tps1>=strtotime('01:00:00'))and (tps1<=strtotime('02:00:00')) then
s20:=s20+1;
if (tps1>=strtotime('02:00:00'))and (tps1<=strtotime('03:00:00')) then
s21:=s21+1;
if (tps1>=strtotime('03:00:00'))and (tps1<=strtotime('04:00:00')) then
s22:=s22+1;
if (tps1>=strtotime('04:00:00'))and (tps1<=strtotime('05:00:00')) then
s23:=s23+1;
if (tps1>=strtotime('05:00:00'))and (tps1<=strtotime('06:00:00')) then
s24:=s24+1;
end; |
Partager