Показать сообщение отдельно
  #7  
Старый 15.04.2012, 08:48
Аватар для R-18Rus
R-18Rus R-18Rus вне форума
Новичок
 
Регистрация: 08.04.2012
Сообщения: 68
Версия Delphi: Delphi 7
Репутация: 127
По умолчанию

А почему у меня при записи в ini, начиная со второй строки, выпрыгивает ошибка.
Прогу уже специально пробовал сделать с нуля, а всё равно.
Вот код:
Код:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, IniFiles, StdCtrls;

type
  TForm1 = class(TForm)
    CheckBox1: TCheckBox;
    CheckBox2: TCheckBox;
    CheckBox3: TCheckBox;
    GroupBox1: TGroupBox;
    RadioButton1: TRadioButton;
    RadioButton2: TRadioButton;
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  ini:TIniFile;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
ini:=TIniFile.Create(ExtractFilePath(Application.ExeName));
ShowMessage(ExtractFilePath(Application.ExeName));
with ini do
begin
WriteBool('Box','CheckBox1',CheckBox1.Checked);
WriteBool('Box','CheckBox2',CheckBox2.Checked);
WriteBool('Box','CheckBox3',CheckBox3.Checked);
WriteBool('Radio','RadioButton1',RadioButton1.Checked);
WriteBool('Radio','RadioButton2',RadioButton2.Checked);
end;
end;

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