Показать сообщение отдельно
  #10  
Старый 10.04.2010, 00:32
luceu luceu вне форума
Прохожий
 
Регистрация: 09.04.2010
Сообщения: 9
Репутация: 10
По умолчанию

вот так, в принципе всё должно работать, видимо ошибка в переменных...

PHP код:
unit Unit1;

interface

uses
  Windows
MessagesSysUtilsVariantsClassesGraphicsControlsForms,
  
DialogsStdCtrls;

type
  TForm1 
= class(TForm)
    
Label1TLabel;
    
Button1TButton;
    
OpenDialog1TOpenDialog;
    
procedure Button1Click(SenderTObject);
  private
    { Private 
declarations }
  public
    { Public 
declarations }
  
end;

var
  
Form1TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(SenderTObject);
var
  
f:textfile;
  
a: array [1..100000of double;
  
dinteger;
  
n,iinteger;
  
mindouble;
  
sString;
begin
 
If OpenDialog1.Execute           //открыть диалог для поиска файла
         
then begin
 assignfile
(f,'d:\text1.txt');
 
reset(f);
 
readln(fs);
 
:= StrToInt(s);
 
readln(fs);
 
min := StrToFloat(s);
 
a[1] := min;
 for 
:= 2 to n
 
do begin
    readln
(fs);
    
a[i] := StrToFloat(s);
    if 
a[i] < min
    then min 
:= a[i];
    
end;
label1.caption:=(FloatToStr(min));
 
ReadLn;
 
Closefile(f);
 
end
else SHowMessage('ошбка сохранения!');
 exit;
 
end;

end
Ответить с цитированием