![]() |
|
|
Регистрация Восстановить пароль |
Регистрация | Задать вопрос |
Заплачу за решение |
Новые сообщения |
Сообщения за день |
Расширенный поиск |
Правила |
Всё прочитано |
![]() |
|
|
Опции темы | Поиск в этой теме |
![]() |
#1 |
Пользователь
Регистрация: 15.02.2007
Сообщений: 12
|
![]()
...
begin IniFile := TIniFile.Create('c:\boot.INI'); //Открываем INI файл IniFile.ReadInteger('boot loader','timeout', timeout); label4.Caption:=IntToStr(timeout) + ' сек'; end; end; ... Почему значение Таймаута у меня получается равное нулю? Пробовал так еще так: ... begin IniFile := TIniFile.Create('c:\boot.INI'); //Открываем INI файл IniFile.ReadЫекштп('boot loader','timeout', timeout); label4.Caption:=timeout + ' сек'; end; end; ... Но так, вообще ничего не пишет. |
![]() |
![]() |
![]() |
#2 |
Форумчанин
Регистрация: 22.05.2007
Сообщений: 511
|
![]()
Вот так попробуй
IniFile := TIniFile.Create('c:\boot.INI'); //Открываем INI файл IniFile.ReadInteger('boot loader','timeout', 0); label4.Caption:=IntToStr(timeout) + ' сек'; end; |
![]() |
![]() |
![]() |
#3 |
Пользователь
Регистрация: 15.02.2007
Сообщений: 12
|
![]()
Не, так тоже не пашет...
Может вы не правильно меня поняли, смысл в том, что эта часть программы должна считывать из boot.ini таймаут загрузки и выводить его в лейбл4 |
![]() |
![]() |
![]() |
#4 |
Форумчанин
Регистрация: 22.05.2007
Сообщений: 511
|
![]()
У меня выводит число. У тебя что за переменные?
|
![]() |
![]() |
![]() |
#5 |
Пользователь
Регистрация: 15.02.2007
Сообщений: 12
|
![]()
Вот прога целиком (наработки)
unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls,IniFiles, Spin; type TForm1 = class(TForm) GroupBox1: TGroupBox; GroupBox2: TGroupBox; Memo1: TMemo; Button1: TButton; Label1: TLabel; Label2: TLabel; Label3: TLabel; Label4: TLabel; GroupBox3: TGroupBox; Edit1: TEdit; Label5: TLabel; RadioButton1: TRadioButton; RadioButton2: TRadioButton; RadioButton3: TRadioButton; RadioButton4: TRadioButton; RadioButton5: TRadioButton; RadioButton6: TRadioButton; RadioButton7: TRadioButton; SpinEdit1: TSpinEdit; Label6: TLabel; Procedure BOOTini; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; f: TextFile; //Вывод INI в виде текста buf: string; //Строка текстового файла TimeOut: integer;//Значение ТаймАут implementation {$R *.dfm} Procedure Tform1.BOOTini; var IniFile:TIniFile; Begin AssignFile(f, 'c:/boot.ini');//Открытие файла try Reset (f); // открыть для чтения except on EInOutError do begin ShowMessage('Ошибка доступа к файлу boot.ini' ); exit; end; end; // чтение из файла while not EOF(f) do begin readln(f, buf); // прочитать строку из файла Memo1.Lines.Add(buf); // добавить строку в поле Memol end; CloseFile(f); // закрыть файл begin IniFile := TIniFile.Create('c:\boot.INI'); //Открываем INI файл IniFile.ReadInteger('boot loader','timeout', 0); label4.Caption:=IntToStr(timeout) + ' сек'; end; end; procedure TForm1.Button1Click(Sender: TObject); begin bootini; button1.Enabled:=false; end; end. |
![]() |
![]() |
![]() |
#6 |
Участник клуба
Регистрация: 28.03.2007
Сообщений: 1,814
|
![]()
Наверно всё дело в том что он скрытый
|
![]() |
![]() |
![]() |
#7 |
Телепат с дипломом
Старожил
Регистрация: 10.06.2007
Сообщений: 4,929
|
![]()
procedure TForm1.Button1Click(Sender: TObject);
var sec: integer; IniFile: TIniFile; begin IniFile:=TIniFile.Create('c:\boot.i ni'); sec:=IniFile.ReadInteger('boot loader','timeout',0); edit1.Text:=inttostr(sec); end; у меня работает
The future is not a tablet with a 9" screen no more than the future was a 9" black & white screen in a box. It’s the paradigm that survives. (Kroc Camen)
Проверь себя! Онлайн тестирование | Мой блог |
![]() |
![]() |
![]() |
#8 |
;-)
Пользователь
Регистрация: 18.07.2007
Сообщений: 69
|
![]()
Проверь, может у тебя в boot.ini ноль и записан..
|
![]() |
![]() |
![]() |
#9 |
Участник клуба
Регистрация: 28.03.2007
Сообщений: 1,814
|
![]()
Проверил код Mutabora всё работает timeout=30
|
![]() |
![]() |
![]() |
#10 | |
Телепат с дипломом
Старожил
Регистрация: 10.06.2007
Сообщений: 4,929
|
![]() Цитата:
The future is not a tablet with a 9" screen no more than the future was a 9" black & white screen in a box. It’s the paradigm that survives. (Kroc Camen)
Проверь себя! Онлайн тестирование | Мой блог |
|
![]() |
![]() |