Имя пользователя:
Пароль:
 

Название темы: где ошибка
Показать сообщение отдельно

Аватара для cookie_monster

Новый участник


Сообщения: 41
Благодарности: 9

Профиль | Отправить PM | Цитировать


Во первых - после else должна идти конструкция begin и заканчивается end;
Во вторых showmessage принимает аргументы типа String(Строка) а вы передаете переменную month_schetchik типа Double.

Попробуйте так:
Код: Выделить весь код
procedure TForm1.Button3Click(Sender: TObject);
var
year, month_file, month_schetchik_edit : string;
month_conf : textfile;
month_schetchik : double;
begin
year := Edit1.Text[7] + Edit1.Text[8];
month_file := (GetCurrentDir + '\tmp\01.01.' + year + '.tmp');

if FileExists(month_file) then
       begin
         AssignFile(month_conf,month_file);
         Reset(month_conf);
         readln(month_conf,month_schetchik_edit);
         CloseFile(month_conf);
         month_schetchik := StrToFloat(month_schetchik_edit);
       end
       else
         begin
           AssignFile(month_conf,month_file);
           ReWrite(month_conf);
           writeln(month_conf,'0');
           CloseFile(month_conf);
        end;

showmessage(month_schetchik_edit);

end;
Это сообщение посчитали полезным следующие участники:

Отправлено: 23:42, 07-02-2013 | #2

Название темы: где ошибка