Показать сообщение отдельно
  #1  
Старый 21.12.2007, 20:43
Аватар для Oleg
Oleg Oleg вне форума
Активный
 
Регистрация: 29.11.2007
Адрес: Оренбургская обл., Россия
Сообщения: 261
Репутация: 15
Вопрос Вопрос по ini файлам

Вот кусок кода:
...
procedure TForm1.Button1Click(Sender: TObject);
var
count:integer;
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;
...

Здесь не обновляется count всё время устанавливает в одной проге 1, а тут
Ну почему ???
И выводит
count=4357785
Ну помогите разобраться
Ответить с цитированием