- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 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
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
- 88
- 89
- 90
- 91
- 92
- 93
- 94
- 95
- 96
procedure TForm1.Timer1Timer(Sender: TObject);
function UpTime(sf:string):boolean;
var time:string;
 t:textfile;
begin
 if form1.MaskEdit5.Text<>'' then
 if Findmas_u(255,0,sf)<0 then
 begin UpTime:=false;exit;end;
 if not FileExists(sf) then
 begin UpTime:=false;exit;end;
 time:=DateUpdating_u(sf);
 if time<>'' then
 begin
 try
 assignfile(t,ExtractFilePath(form1.MaskEdit1.Text)+ChangeFileExt(ExtractFileName(sf),'.tim'));
 rewrite(t);
 writeln(t,time);
 closefile(t);
 except UpTime:=false;exit;end;
 end;
 UpTime:=true;
end;
var x,y,i1,i2,i3,xf,yf:integer;
 sf,id,ff:string;
 b:boolean;
begin
 form1.Timer1.Enabled:=not form1.Timer1.Enabled;
 try
 form1.ProgressBar1.Position:=0;
 application.ProcessMessages;
 masopt_u(254,x,y);
 if form1.MaskEdit1.Text='' then
 form1.BitBtn3.Click else
 if (DateUpdating_u(form1.MaskEdit1.Text)<>DateUpdatingMas_u(254))or(y>0) then
 begin
 if form1.MaskEdit3.Text<>'' then
 if form1.CheckBox1.Checked then
 sf:=TJ7PassAutentikR_u(form1.MaskEdit3.Text,form1.MaskEdit2.Text) else
 sf:=TJ7PassAutentik_u(form1.MaskEdit3.Text,form1.MaskEdit2.Text) else
 sf:=form1.MaskEdit2.Text;
 if not OpenOneNu_u(form1.MaskEdit1.Text,'read:PSQL-Srv'+booltostr(form1.RadioButton2.Checked),3) then
 begin
 DeleteFile(ChangeFileExt(form1.MaskEdit1.Text,'.tmp'));
 form1.RichEdit1.Lines.Add('('+datetostr(date)+' '+timetostr(time)+') Превышен интервал времени доступа.');
 OpenOneNu_u(form1.MaskEdit1.Text,'read:PSQL-Srv'+booltostr(form1.RadioButton2.Checked),3);
 end;
 i1:=TJ7ReadMas_u(254,form1.MaskEdit1.Text,sf);
 CloseOneNu_u(form1.MaskEdit1.Text,'read:PSQL-Srv'+booltostr(form1.RadioButton2.Checked));
 if (i1<>0)and(i1<>11) then
 begin
 form1.RichEdit1.Lines.Add('('+datetostr(date)+' '+timetostr(time)+') Ошибка чтения команд, код: '+inttostr(i1)+'.');
 closemas_u(254);
 initmas_u(254,2,0);
 TJ7CreateMas_u(254,form1.MaskEdit1.Text,sf,false,false,false,false,false);
 closemas_u(254);
 form1.Timer1.Enabled:=not form1.Timer1.Enabled;
 exit;
 end;
 masopt_u(254,x,y);id:='';
 if not form1.RadioButton1.Checked then
 begin
 for i1:=0 to y-1 do
 if (masr_u(254,1,i1)<>'') then
 if ((form1.RadioButton2.Checked)and(ord(masr_u(254,1,i1)[1])mod 2=0))or
 ((form1.RadioButton3.Checked)and(ord(masr_u(254,1,i1)[1])mod 2<>0))then
 begin id:=masr_u(254,1,i1);break;end;
 end else id:=masr_u(254,1,0);
 if (id='')or(y=0) then
 begin
 if RTime_u(strtodatetime(DateUpdatingMas_u(254)),date+time)<1200 then
 closemas_u(254);
 form1.Timer1.Enabled:=not form1.Timer1.Enabled;
 exit;
 end;
 if y>0 then form1.StaticText13.Caption:='в обработке';
 application.ProcessMessages;
 form1.RichEdit1.Lines.Add('('+datetostr(date)+' '+timetostr(time)+'/Старт):'+id);
 if form1.CheckBox3.Checked then
 begin
 masopt_u(255,xf,yf);
 ff:=ExtractFilePath(form1.MaskEdit1.Text)+id+'.tj7';
 masw_u(255,0,yf,ff);
 end;
 application.ProcessMessages;
 if form1.MaskEdit6.Text<>'' then
 PsevdoSQL_u(form1.MaskEdit6.Text);
 for i1:=0 to y-1 do
 if masr_u(254,1,i1)=id then
 begin
 if form1.CheckBox3.Checked then
 begin
 i2:=pos('TId',masr_u(254,0,i1));
 if i2>0 then
 masw_u(254,0,i1,copy(masr_u(254,0,i1),1,i2-1)+id+copy(masr_u(254,0,i1),i2+3,255));
 end;
// *** И дальше в том же духе
                                     
        
            Автор сего поделия, кусок которого приведён выше (привёл бы полностью, но там 160 строк), называет ЭТО "сервером распределённых вычислений" и "самой прогрессивной СУБД в мире, которая лучше всех этих ваших ораклов. При этом автор вроде как и не школьник...