Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "Начинающим";
Текущий архив: 2006.06.18;
Скачать: [xml.tar.bz2];

Вниз

Помогите разобраться что неправильно   Найти похожие ветки 

 
kashmar   (2006-05-30 08:52) [0]

К этому есть таблица но почемуто нещетается  Раннее начало что неправильно?

unit Unit1;
//unit UGraphic;
interface

uses
 Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
 Dialogs, Grids, Menus, Unit2, StdCtrls, DB, DBTables, XPMan, ComCtrls;

type
 TForm1 = class(TForm)
   StringGrid1: TStringGrid;
   MainMenu1: TMainMenu;
   N11: TMenuItem;
   N21: TMenuItem;
   Button1: TButton;
   N1: TMenuItem;
   N3: TMenuItem;
   N4: TMenuItem;
   N5: TMenuItem;
   OpenDialog1: TOpenDialog;
   SaveDialog1: TSaveDialog;
   procedure FormCreate(Sender: TObject);
   procedure N1Click(Sender: TObject);
   procedure N2Click(Sender: TObject);
   procedure N3Click(Sender: TObject);
   procedure Button1Click(Sender: TObject);
 private
   { Private declarations }
 public
   { Public declarations }
 end;

var
 Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
StringGrid1.ColWidths[9]:=200;
StringGrid1.Cells[0,0]:="Êîëè÷åñòâ& #238; ïðåäøåñòâóþùè&# 245; ðàáîò";
StringGrid1.Cells[1,0]:="Íà÷àëî ðàáîòû";
StringGrid1.Cells[2,0]:="Îêîí÷àíèå ðàáîòû";
StringGrid1.Cells[3,0]:="Ïðîäîëæèò& #229;ëüíîñòü";
StringGrid1.Cells[4,0]:="Ðàííåå íà÷àëî ðàáîòû";
StringGrid1.Cells[5,0]:="Ðàííåå îêîí÷àíèå ðàáîòû";
StringGrid1.Cells[6,0]:="Ïîçäíåå íà÷àëî ðàáîòû";
StringGrid1.Cells[7,0]:="Ïîçäíåå îêîí÷àíèå ðàáîòû";
StringGrid1.Cells[8,0]:="Ïîëíûé ðåçåðâ";
StringGrid1.Cells[9,0]:="Íàçâàíèå ðàáîòû";
StringGrid1.Cells[10,0]:="×àñòíûé ðåçåðâ âðåìåíè";
end;

procedure TForm1.N1Click(Sender: TObject);
begin
form2.Visible:=True;
Form2.Edit1.Clear;
Form2.Edit2.Clear;
Form2.Edit3.Clear;
end;

procedure TForm1.N2Click(Sender: TObject);
begin
form2.Visible:=true;
end;

procedure TForm1.N3Click(Sender: TObject);
begin
j:=j-1;
StringGrid1.Rows[StringGrid1.Row].Clear;
StringGrid1.RowCount:=j+1;
end;

procedure TForm1.Button1Click(Sender: TObject);
var i,j,r,max,min:integer;
begin
//ðàñ÷åò êîëè÷åñòâà ïðåäøåñòâóþùè&# 245; ðàáîò

stringgrid1.RowCount := stringgrid1.RowCount-1;
r:=0;
for i:=1 to stringgrid1.RowCount do
begin
for j:=1 to stringgrid1.RowCount do
       begin
        if stringgrid1.Cells[1,i]=stringgrid1.Cells[2,j]
        then r:=r+1;
       end;
 stringgrid1.Cells[0,i]:=inttostr(r);
 r:=0;
end;
//ðàñ÷åò ðàíííåãî íà÷àëà ðàáîòû
 for i:=1 to StringGrid1.RowCount do
 if StringGrid1.Cells[0,i]=inttostr(0)
 then StringGrid1.Cells[4,i]:=StringGrid1.Cells[0,i];
max:=1000;
for i:=1 to StringGrid1.RowCount do
 begin
 for j:=1 to StringGrid1.RowCount do
 begin
   if StringGrid1.Cells[1,i]=StringGrid1.Cells[2,j]
   then
   if (strtoint(StringGrid1.cells[5,i])>max)=(strtoint(StringGrid1.cells[4,i])>max)
   then
   begin
     max:=strtoint(StringGrid1.cells[5,i]);
     StringGrid1.Cells[4,i]:=inttostr(max);
     end;
max:=0;
end;
end;
//ðàñ÷åò ðàííåãî îêîí÷àíèÿ ðàáîòû
for i:=1 to StringGrid1.RowCount do
StringGrid1.Cells[5,i]:=inttostr(strtoint(StringGrid1.Cells[4,i])+strtoint(StringGrid1.Cells[3,i]));
//ðàñ÷åò ïîçäíåãî îêîí÷àíèÿ ðàáîòû
for i:=1 to StringGrid1.RowCount do
 if StringGrid1.Cells[7,i]=inttostr(0)
 then StringGrid1.Cells[4,i]:=StringGrid1.Cells[0,i];
min:=1000;
for i:=1 to StringGrid1.RowCount do
 begin
 for j:=1 to StringGrid1.RowCount do
 begin
   if StringGrid1.Cells[2,i]=StringGrid1.Cells[1,j]
   then
     if strtoint(StringGrid1.cells[6,i])<min
     then
     begin
     min:=strtoint(StringGrid1.cells[6,i]);
     StringGrid1.Cells[7,i]:=inttostr(min);
     end;
   if StringGrid1.Cells[2,i]<>StringGrid1.Cells[1,j]
   then StringGrid1.Cells[7,i]:=StringGrid1.Cells[5,i];
min:=1000;
end;
end;
//&#240;&#224;&#241;&#247;&#229;&#242; &#239;&#238;&#231;&#228;&#237;&#229;&#227;&#238; &#237;&#224;&#247;&#224;&#235;&#224; &#240;&#224;&#225;&#238;&#242;&#251;
for i:=1 to StringGrid1.RowCount do
StringGrid1.Cells[6,i]:=inttostr(strtoint(StringGrid1.Cells[7,i])-strtoint(StringGrid1.Cells[3,i]));
//end;
//&#240;&#224;&#241;&#247;&#229;&#242; &#239;&#238;&#235;&#237;&#238;&#227;&#238; &#240;&#229;&#231;&#229;&#240;&#226;&#224;
 for i:=1 to StringGrid1.RowCount do
  if strtoint(StringGrid1.Cells[7,i])
 -strtoint(StringGrid1.Cells[5,i])=strtoint(StringGrid1.Cells[6,i])-strtoint(StringGrid1.Cells[4,i])
 then StringGrid1.Cells[8,i]:=inttostr(strtoint(StringGrid1.Cells[7,i])-strtoint(StringGrid1.Cells[5,i]))
 else ShowMessage("&#207;&#240;&#238;&#226;&#229;&#240;&#252;&#242;&#229; &#239;&#240;&#224;&#226;&#232;&#235;&#252;&#237;&#238;&#241;&#242;&#252; &#226;&#226;&#238;&#228;&#232;&#236;&#251;&#245; &#228;&#224;&#237;&#237;&#251;&#245;");
end;

// fGraphic: TfGraphic;
// fGraphic = new TfGraphic(NULL);
//fGraphic->DrawGraphic(massiv);
// fGraphic->ShowModal();
//delete fGraphic;

end.

К этому есть таблица но почемуто нещетается  Раннее начало что неправильно?


 
ЮЮ ©   (2006-05-30 08:55) [1]

for i:=1 to StringGrid1.RowCount do
 StringGrid1.Cells[6,i]


for i:=0 to StringGrid1.RowCount - 1 do
 StringGrid1.Cells[6,i]


 
syte_ser78 ©   (2006-05-30 08:57) [2]

а что ты сумировать собрался?
"?aiiaa ia?aei ?aaiou" - "Iicaiaa ieii?aiea ?aaiou";


 
evvcom ©   (2006-05-30 09:30) [3]

Кошмар, ты над нами издеваешься? Твои кракозябры даже Mail Reader, пытаясь разобрать, отнес к схеме "Кошмар". Совпадение? Сомневаюсь.



Страницы: 1 вся ветка

Форум: "Начинающим";
Текущий архив: 2006.06.18;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.47 MB
Время: 0.013 c
15-1148402721
vrem
2006-05-23 20:45
2006.06.18
Программирование не как ремесло.


15-1148284383
Юрий Зотов
2006-05-22 11:53
2006.06.18
Простенький вопросец по HTML


2-1149008846
Лыган
2006-05-30 21:07
2006.06.18
Подскажите


3-1145635197
DevilDevil
2006-04-21 19:59
2006.06.18
Удаление нескольких записей


4-1142933233
StudentVNN
2006-03-21 12:27
2006.06.18
Неработает завершение сеанса ExitWindowsEx(EWX_LOGOFF, 0)





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский