
12.02.2013, 20:22
|
Прохожий
|
|
Регистрация: 10.02.2013
Сообщения: 11
Репутация: 10
|
|
Ошибка i/o error 105.
Программа компилируется. И когда выбираешь txt док чтобы открыть выходить ошибка i/o error 105 . Как можно исправить?
Код:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls, Buttons;
type
TForm1 = class(TForm)
Label1: TLabel;
BitBtn1: TBitBtn;
OpenDialog1: TOpenDialog;
Button1: TButton;
Button2: TButton;
Button3: TButton;
Button4: TButton;
Panel1: TPanel;
Button5: TButton;
Button6: TButton;
Button7: TButton;
Button8: TButton;
procedure Button2Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure Button5Click(Sender: TObject);
procedure Button6Click(Sender: TObject);
procedure Button7Click(Sender: TObject);
procedure Button8Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
uses MYUNIT, Unit2, Unit3;
{$R *.dfm}
procedure TForm1.Button2Click(Sender: TObject);
begin
Obr(B,M,N);
Label1.Caption:='Выполнена обработка данных';
Button2.Enabled:=False;
Button3.Enabled:=true;
Button3.SetFocus;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
AssignFile(Output, 'Lr5.txt'); Rewrite(Output);
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
If OpenDialog1.Execute Then
A:=OpenDialog1.FileName Else Begin
ShowMessage('Вы не ввели имя файла. повторите ввод!') ;
Exit;
end;
VVOD(B);
Label1.Caption:='Введены исходные данные';
Button1.Enabled:=False;
Button2.Enabled:=true;
Button2.SetFocus;
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
P(B, M, N);
Button3.Enabled:=False;
CloseFile(Output);
Label1.Caption:='Выведены результаты в текстовый файл';
Button4.Enabled:=True;
Button4.SetFocus;
end;
procedure TForm1.Button4Click(Sender: TObject);
begin
Button4.Enabled:=False;
Form2.Show;
Form3.Show;
Form1.FormStyle:=fsStayOnTop;
Form1.FormStyle:=fsNormal;
Panel1.Visible:=True;
Label1.Caption:='Открыты формы для вывода результатов';
Button5.SetFocus;
end;
procedure TForm1.Button5Click(Sender: TObject);
begin
Form2.ListBox1.Items.LoadFromFile('Lr5.txt');
Label1.Caption:='Выведены результаты в окно ListBox1';
Button5.Enabled:=False;
Button6.SetFocus;
end;
procedure TForm1.Button6Click(Sender: TObject);
begin
Form2.ComboBox1.Items.LoadFromFile('Lr5.txt');
Label1.Caption:='Выведены результаты в окно ComboBox1';
Button6.Enabled:=False;
Button7.SetFocus;
end;
procedure TForm1.Button7Click(Sender: TObject);
begin
Form3.Memo1.Lines.LoadFromFile('Lr5.txt');
Label1.Caption:='Выведены результаты в окно Memo1';
Button7.Enabled:=False;
Button8.SetFocus;
end;
procedure TForm1.Button8Click(Sender: TObject);
Var i, j: Integer; s:string[14];
begin
with Form3.StringGrid1 do
begin ColCount:=N; FixedCols:=0 ;
RowCount:=M+1;FixedRows:=1;
For i:=0 to N-1 do
case j of
0,1,3,4 : Cells[j,0]:=' F';
2,5 :Cells[j,0]:=' E' ;
end;
for i :=1 to M do
for j :=1 to N do
case j of
1,2,4,5 : begin STR(B[i,j]:10:4,s) ; Cells[j-1,i]:=''+s; end;
3,6 : begin STR(B[i,j]:12,s) ; Cells[j-1,i]:=''+s; end;
END; end;
Label1.Caption:='Выведены результаты в окно StringGrid1';
button8.Enabled:=False;
BitBtn1.SetFocus;
end;
end.
|