Показать сообщение отдельно
  #2  
Старый 21.12.2007, 22:23
Аватар для <<D>>
<<D>> <<D>> вне форума
Активный
 
Регистрация: 06.05.2007
Адрес: ГДЕ ТО В СОЛНЕЧНОЙ СИСТЕМЕ
Сообщения: 207
Репутация: 15
Радость

Нужно просто было правильно объявить переменную count.

Код:
...
var
  Form1: TForm1;
  count:integer=0;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var
sFile: string;
Ini: TIniFile;
begin
if not FileExists(sFile) then
begin
Ini:=TIniFile.Create('D:\test.ini');
Ini.WriteInteger('General', 'count', 0);
Ini.Free;
end;
sFile := 'D:\test.ini';
if FileExists(sFile) then
begin
Ini := TIniFile.Create(sFile);
Ini.ReadInteger('General', 'count', count);
count:=count+1;
Ini.WriteInteger('General', 'count', count);
{èëè òàê
Ini.WriteInteger('General', 'count', count+1);
íèêàêîé ðàçíèöû}
Ini.Free;
end;
end;
__________________
Кому я должен - всем прощаю!!!!
Ответить с цитированием