Содержание
- Lazarus runtime error 103
- Re: класс исключения runError(103
- Re: класс исключения runError(103
- Re: класс исключения runError(103
- Re: класс исключения runError(103
- Lazarus runtime error 103
- Re: Error 103
- Re: Error 103
- Re: Error 103
- Lazarus runtime error 103
- Re: класс исключения runError(103
- Re: класс исключения runError(103
- Re: класс исключения runError(103
- Re: класс исключения runError(103
- Lazarus runtime error 103
- Re: класс исключения runError(103
- Re: класс исключения runError(103
- Re: класс исключения runError(103
- Re: класс исключения runError(103
- Lazarus runtime error 103
- Re: класс исключения runError(103
- Re: класс исключения runError(103
- Re: класс исключения runError(103
- Re: класс исключения runError(103
Lazarus runtime error 103
lymar » 19.02.2012 14:36:47
Re: класс исключения runError(103
iskander » 19.02.2012 15:12:14
Re: класс исключения runError(103
Little_Roo » 19.02.2012 15:16:16
И лучше указывать ТТХ — версию ОС, лазаря, fpc и хоть кусок программы, где вызывается исключение
Re: класс исключения runError(103
lymar » 19.02.2012 15:20:14
FPC User’s Guide, Appendix D-Run-time errors:
.
103 File not open
Reported by the following functions : Close, Read, Write, Seek, EOf, FilePos, FileSize, Flush, BlockRead, and BlockWrite if the file is not open.
а можно по русский а то я в этом деле новичок позжалуйста
Добавлено спустя 6 минут 5 секунд:
windows xp fps 2.4.2
программа
Код: Выделить всё unit Unit1;
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls;
TForm1 = class(TForm)
Button1: TButton;
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
procedure Button1Click(Sender: TObject);
private
< private declarations >
public
< public declarations >
end;
var
Form1: TForm1;
procedure TForm1.Button1Click(Sender: TObject);
procedure korni(a,b,c:real;var x1,x2:real;var pr:boolean);
var d:real;
begin
d:=b*b-4*a*c;
if d 0 then
begin
x_:=-c_/b_;
writeln(‘x= ‘,x_);
end
else
writeln(‘нет коней’);
end
else
begin
korni(A_,B_,C_,X1_,X2_,PR_);
if pr_=false then
writeln(‘нет корней’)
else
writeln(‘x1=’,x1_ ,’x2=’,x2_);
end;
end;
end. .
Добавлено спустя 3 минуты 40 секунд:
дело в том что сама программа запускается а вот работать не хочет
прикладываю кусок с ошибкой:
writeln(‘a_:=’); вот здесь ошибка выделена серым цветом вся строка
readln(a_);
write(‘b_:=’);
readln(b_);
write(‘c_:=’);
readln(c_);
if a_=0 then
begin
if b_<>0 then
Re: класс исключения runError(103
Little_Roo » 19.02.2012 15:44:15
Пользуйтесь тегом Code
И потом, как в процедуре два var ?
И «Как, Холмс ?» можно в оконнную процедуру впихать консольную .
Подозрение, что сработал метод тупого копи-паста.
Или уж консольная программа — write-read — или оконное приложение — тогда используйте TEdit-TLabel
А в данном примере — ввод-вывод из несуществующей консоли — вот и 103 ошибка — не понятно, откуда читать, куда писать.
Источник
Lazarus runtime error 103
Mavlyudov » 12.12.2011 03:20:21
После компилирования при запуске возникает ошибка:
Runtime error 103 at
В программе нету работы с файлами.
Есть только обращение к таким процедурам
WRITEln(‘N=’);
READLN(N);
READLN;
В ошибке указан номер строчки , которой соответствует WRITEln(‘N=’);
Компилирую из командной строки(.bat фай) такого содержания
fpWbinwin32ppc386 -Sd -Sg -Un -O1 -Xs -gl %1
Компилятор версии 1.0.10 [2003/06/27].
Также пробовал версию 2.4.4 [2011/04/23]. При компилировании из командной строки ошибка таже самая,
а вот при компилировании из-под оболочки fp.exe всё компилируется и запускается без ошибок.
В чем может быт причина возникновения такой ошибки 103 и как ее устранить?
Re: Error 103
Сквозняк » 12.12.2011 04:48:52
Re: Error 103
Sergei I. Gorelkin » 12.12.2011 08:45:06
Re: Error 103
Mavlyudov » 13.12.2011 03:12:11
Сквозняк
Я предполагал, что fpc (или fp) использует ppc386 при компиляции, поэтому искал файл настроек с директивами, которые можно прописать и в командной строке. Как оказалось, fp и ppc386 — два независимых приложения.
Sergei I. Gorelkin
Видимо, речь все таки идет о ключе ключе -WС. Да, теперь компилируется.
Но при компиляции компилером версии 1.0.10 возникла другая ошибка 203. Переполнение кучи.
Runtime error 203 at адрес
и еще несколько адресов ниже
указана строка с кодом GetMem(ARRM[I], sizeof(ARRM[I]^));
При использовании компилятора версии 2.4.4 такой ошибки не возникает. Но нужно разобраться именно с ошибкой компилятора более ранней версии.
Компилирую как и раньше командной строкой через ppc386.
Настройки .bat файла:
FPC2.4.4bini386-win32ppc386 -Sd -Sg -Un -O1 -Xs -gl %1 -FU -Foc: -WC -WN
При запуске программы предполагается ввод большого числа(например, 20000), так чтобы выполнилась часть кода в except.
Код: Выделить всё program Project4;
type
MAS = array [0..NNMAT-1] of Double;
ARR = ^MAS;
MAS2 = array [0..NNARR] of ARR;
PMAS2 = ^MAS2;
var <——————————->
NMAT0, NMAT: INTEGER;
ARRM: array [0..NNARR] of ARR;
ARR0: ARR;
GE:DWORD;
procedure MAT_PRED(N:INTEGER);
var
NN, I: LONGINT;
begin
NN:= SQR(N);
I:= 0;
NMAT:= 0;
Источник
Lazarus runtime error 103
lymar » 19.02.2012 14:36:47
Re: класс исключения runError(103
iskander » 19.02.2012 15:12:14
Re: класс исключения runError(103
Little_Roo » 19.02.2012 15:16:16
И лучше указывать ТТХ — версию ОС, лазаря, fpc и хоть кусок программы, где вызывается исключение
Re: класс исключения runError(103
lymar » 19.02.2012 15:20:14
FPC User’s Guide, Appendix D-Run-time errors:
.
103 File not open
Reported by the following functions : Close, Read, Write, Seek, EOf, FilePos, FileSize, Flush, BlockRead, and BlockWrite if the file is not open.
а можно по русский а то я в этом деле новичок позжалуйста
Добавлено спустя 6 минут 5 секунд:
windows xp fps 2.4.2
программа
Код: Выделить всё unit Unit1;
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls;
TForm1 = class(TForm)
Button1: TButton;
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
procedure Button1Click(Sender: TObject);
private
< private declarations >
public
< public declarations >
end;
var
Form1: TForm1;
procedure TForm1.Button1Click(Sender: TObject);
procedure korni(a,b,c:real;var x1,x2:real;var pr:boolean);
var d:real;
begin
d:=b*b-4*a*c;
if d 0 then
begin
x_:=-c_/b_;
writeln(‘x= ‘,x_);
end
else
writeln(‘нет коней’);
end
else
begin
korni(A_,B_,C_,X1_,X2_,PR_);
if pr_=false then
writeln(‘нет корней’)
else
writeln(‘x1=’,x1_ ,’x2=’,x2_);
end;
end;
end. .
Добавлено спустя 3 минуты 40 секунд:
дело в том что сама программа запускается а вот работать не хочет
прикладываю кусок с ошибкой:
writeln(‘a_:=’); вот здесь ошибка выделена серым цветом вся строка
readln(a_);
write(‘b_:=’);
readln(b_);
write(‘c_:=’);
readln(c_);
if a_=0 then
begin
if b_<>0 then
Re: класс исключения runError(103
Little_Roo » 19.02.2012 15:44:15
Пользуйтесь тегом Code
И потом, как в процедуре два var ?
И «Как, Холмс ?» можно в оконнную процедуру впихать консольную .
Подозрение, что сработал метод тупого копи-паста.
Или уж консольная программа — write-read — или оконное приложение — тогда используйте TEdit-TLabel
А в данном примере — ввод-вывод из несуществующей консоли — вот и 103 ошибка — не понятно, откуда читать, куда писать.
Источник
Lazarus runtime error 103
lymar » 19.02.2012 14:36:47
Re: класс исключения runError(103
iskander » 19.02.2012 15:12:14
Re: класс исключения runError(103
Little_Roo » 19.02.2012 15:16:16
И лучше указывать ТТХ — версию ОС, лазаря, fpc и хоть кусок программы, где вызывается исключение
Re: класс исключения runError(103
lymar » 19.02.2012 15:20:14
FPC User’s Guide, Appendix D-Run-time errors:
.
103 File not open
Reported by the following functions : Close, Read, Write, Seek, EOf, FilePos, FileSize, Flush, BlockRead, and BlockWrite if the file is not open.
а можно по русский а то я в этом деле новичок позжалуйста
Добавлено спустя 6 минут 5 секунд:
windows xp fps 2.4.2
программа
Код: Выделить всё unit Unit1;
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls;
TForm1 = class(TForm)
Button1: TButton;
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
procedure Button1Click(Sender: TObject);
private
< private declarations >
public
< public declarations >
end;
var
Form1: TForm1;
procedure TForm1.Button1Click(Sender: TObject);
procedure korni(a,b,c:real;var x1,x2:real;var pr:boolean);
var d:real;
begin
d:=b*b-4*a*c;
if d 0 then
begin
x_:=-c_/b_;
writeln(‘x= ‘,x_);
end
else
writeln(‘нет коней’);
end
else
begin
korni(A_,B_,C_,X1_,X2_,PR_);
if pr_=false then
writeln(‘нет корней’)
else
writeln(‘x1=’,x1_ ,’x2=’,x2_);
end;
end;
end. .
Добавлено спустя 3 минуты 40 секунд:
дело в том что сама программа запускается а вот работать не хочет
прикладываю кусок с ошибкой:
writeln(‘a_:=’); вот здесь ошибка выделена серым цветом вся строка
readln(a_);
write(‘b_:=’);
readln(b_);
write(‘c_:=’);
readln(c_);
if a_=0 then
begin
if b_<>0 then
Re: класс исключения runError(103
Little_Roo » 19.02.2012 15:44:15
Пользуйтесь тегом Code
И потом, как в процедуре два var ?
И «Как, Холмс ?» можно в оконнную процедуру впихать консольную .
Подозрение, что сработал метод тупого копи-паста.
Или уж консольная программа — write-read — или оконное приложение — тогда используйте TEdit-TLabel
А в данном примере — ввод-вывод из несуществующей консоли — вот и 103 ошибка — не понятно, откуда читать, куда писать.
Источник
Lazarus runtime error 103
lymar » 19.02.2012 14:36:47
Re: класс исключения runError(103
iskander » 19.02.2012 15:12:14
Re: класс исключения runError(103
Little_Roo » 19.02.2012 15:16:16
И лучше указывать ТТХ — версию ОС, лазаря, fpc и хоть кусок программы, где вызывается исключение
Re: класс исключения runError(103
lymar » 19.02.2012 15:20:14
FPC User’s Guide, Appendix D-Run-time errors:
.
103 File not open
Reported by the following functions : Close, Read, Write, Seek, EOf, FilePos, FileSize, Flush, BlockRead, and BlockWrite if the file is not open.
а можно по русский а то я в этом деле новичок позжалуйста
Добавлено спустя 6 минут 5 секунд:
windows xp fps 2.4.2
программа
Код: Выделить всё unit Unit1;
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls;
TForm1 = class(TForm)
Button1: TButton;
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
procedure Button1Click(Sender: TObject);
private
< private declarations >
public
< public declarations >
end;
var
Form1: TForm1;
procedure TForm1.Button1Click(Sender: TObject);
procedure korni(a,b,c:real;var x1,x2:real;var pr:boolean);
var d:real;
begin
d:=b*b-4*a*c;
if d 0 then
begin
x_:=-c_/b_;
writeln(‘x= ‘,x_);
end
else
writeln(‘нет коней’);
end
else
begin
korni(A_,B_,C_,X1_,X2_,PR_);
if pr_=false then
writeln(‘нет корней’)
else
writeln(‘x1=’,x1_ ,’x2=’,x2_);
end;
end;
end. .
Добавлено спустя 3 минуты 40 секунд:
дело в том что сама программа запускается а вот работать не хочет
прикладываю кусок с ошибкой:
writeln(‘a_:=’); вот здесь ошибка выделена серым цветом вся строка
readln(a_);
write(‘b_:=’);
readln(b_);
write(‘c_:=’);
readln(c_);
if a_=0 then
begin
if b_<>0 then
Re: класс исключения runError(103
Little_Roo » 19.02.2012 15:44:15
Пользуйтесь тегом Code
И потом, как в процедуре два var ?
И «Как, Холмс ?» можно в оконнную процедуру впихать консольную .
Подозрение, что сработал метод тупого копи-паста.
Или уж консольная программа — write-read — или оконное приложение — тогда используйте TEdit-TLabel
А в данном примере — ввод-вывод из несуществующей консоли — вот и 103 ошибка — не понятно, откуда читать, куда писать.
Источник
Модератор: Модераторы
Error 103
После компилирования при запуске возникает ошибка:
Runtime error 103 at <адрес>
В программе нету работы с файлами.
Есть только обращение к таким процедурам
WRITEln(‘N=’);
READLN(N);
READLN;
В ошибке указан номер строчки , которой соответствует WRITEln(‘N=’);
Компилирую из командной строки(.bat фай) такого содержания
fpWbinwin32ppc386 -Sd -Sg -Un -O1 -Xs -gl %1
Компилятор версии 1.0.10 [2003/06/27].
Также пробовал версию 2.4.4 [2011/04/23]. При компилировании из командной строки ошибка таже самая,
а вот при компилировании из-под оболочки fp.exe всё компилируется и запускается без ошибок.
В чем может быт причина возникновения такой ошибки 103 и как ее устранить?
- Mavlyudov
- новенький
- Сообщения: 50
- Зарегистрирован: 24.01.2010 20:35:23
Re: Error 103
Сквозняк » 12.12.2011 04:48:52
Многие процедуры паскаля, в частности writeln, на нём не реализованы а представляют собой обёртку к системным функциям написанным на языке C. То есть, если очень постараться, можно словить баги этого языка. Попробуй компилировать из коммандной строки не компилятором ppc386 а более для этого предназначенным fpc и без опций. Если заработает, то компилируй снова и добавляй каждый раз по одной новой опции, так ты узнаешь, какая из них вызывает ошибку. Если не поможет, то пример кода вызвающий ошибку в студию
- Сквозняк
- энтузиаст
- Сообщения: 1006
- Зарегистрирован: 29.06.2006 22:08:32
Re: Error 103
Sergei I. Gorelkin » 12.12.2011 08:45:06
Скорее всего не хватает ключа -Wg или директивы {$apptype console} в начале программы.
-
Sergei I. Gorelkin - энтузиаст
- Сообщения: 1390
- Зарегистрирован: 24.07.2005 14:40:41
- Откуда: Зеленоград
-
- Профиль
- ICQ
Re: Error 103
Mavlyudov » 13.12.2011 03:12:11
Сквозняк
Я предполагал, что fpc (или fp) использует ppc386 при компиляции, поэтому искал файл настроек с директивами, которые можно прописать и в командной строке. Как оказалось, fp и ppc386 — два независимых приложения.
Sergei I. Gorelkin
Видимо, речь все таки идет о ключе ключе -WС. Да, теперь компилируется.
Но при компиляции компилером версии 1.0.10 возникла другая ошибка 203. Переполнение кучи.
Runtime error 203 at адрес
и еще несколько адресов ниже
указана строка с кодом GetMem(ARRM[I], sizeof(ARRM[I]^));
При использовании компилятора версии 2.4.4 такой ошибки не возникает. Но нужно разобраться именно с ошибкой компилятора более ранней версии.
Компилирую как и раньше командной строкой через ppc386.
Настройки .bat файла:
FPC2.4.4bini386-win32ppc386 -Sd -Sg -Un -O1 -Xs -gl %1 -FU<директория модулей> -Foc:<директория модулей> -WC -WN
При запуске программы предполагается ввод большого числа(например, 20000), так чтобы выполнилась часть кода в except.
Вот код:
- Код: Выделить всё
program Project4;//uses Windows, SysUtils, dos;
{ H+}
{ mode Delphi}
{ apptype console}const
NNMAT=30000;{8100;}{4096;}{16380;}
NNARR=30000;type
MAS = array [0..NNMAT-1] of Double;
ARR = ^MAS;
MAS2 = array [0..NNARR] of ARR;
PMAS2 = ^MAS2;var {-------------------------------}
NMAT0, NMAT: INTEGER;
ARRM: array [0..NNARR] of ARR;
ARR0: ARR;
GE:DWORD;procedure MAT_PRED(N:INTEGER);
var
NN, I: LONGINT;
begin
NN:= SQR(N);
I:= 0;
NMAT:= 0;while (NMAT < NN) AND (I < NNARR) DO
begin
try
GetMem(ARRM[I], sizeof(ARRM[I]^));
//sizeof(Double)*NNMAT
except
Writeln('It was GOTO',#$20,I,#$20,NMAT);
Dec(NMAT);
end;
Inc(I);
Inc(NMAT, NNMAT);
// writeln(I,' ',NMAT,' '{,MEMAVAIL,' ',MAXAVAIL});
end;
NMAT0:= NMAT;
Writeln(I,' ',NMAT0);
end;{MAT_PRED}var
N: INTEGER;
begin
WRITEln('N=');
READLN(N);
MAT_PRED(N);
WRITELN('Filled Memory: ',SQRT(NMAT0):9:3);
READLN;
end.
- Mavlyudov
- новенький
- Сообщения: 50
- Зарегистрирован: 24.01.2010 20:35:23
Re: Error 103
Сквозняк » 13.12.2011 06:54:25
- Код: Выделить всё
{$mode Delphi}
Без значка $ мой компилятор директиву не принимает.
Используя ppc386 напрямую, ты без пользы ломаешь кроссплатформенность своего скрипта — в каждой платформе этот компилятор называется по разному.
- Сквозняк
- энтузиаст
- Сообщения: 1006
- Зарегистрирован: 29.06.2006 22:08:32
Re: Error 103
Mavlyudov » 14.12.2011 01:45:22
Сквозняк
У меня без $, т.к. закомментированы. Все режимы выставлены через командную строку в ключах.
Вопрос не в кроссплатформенности, а в том, как отладить приведенный код
- Mavlyudov
- новенький
- Сообщения: 50
- Зарегистрирован: 24.01.2010 20:35:23
Re: Error 103
Sergei I. Gorelkin » 14.12.2011 14:15:28
Исключения обрабатываются только при подключенном модуле sysutils. Если он закомментарен, то вылет с runtime error — нормальное поведение.
-
Sergei I. Gorelkin - энтузиаст
- Сообщения: 1390
- Зарегистрирован: 24.07.2005 14:40:41
- Откуда: Зеленоград
-
- Профиль
- ICQ
Вернуться в Free Pascal Compiler
Кто сейчас на конференции
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 5
|
El petyx 0 / 0 / 0 Регистрация: 24.05.2017 Сообщений: 4 |
||||
|
1 |
||||
|
14.06.2017, 13:52. Показов 9255. Ответов 3 Метки нет (Все метки)
Здравствуйте. После попытки чтения выдается ошибка runerror 103. Что нужно исправить?
__________________
0 |
|
Супер-модератор 32451 / 20945 / 8105 Регистрация: 22.10.2011 Сообщений: 36,213 Записей в блоге: 7 |
|
|
14.06.2017, 14:41 |
2 |
|
Открываешь файл через переменную s (31-я строка), а читаешь через переменную f (33-я строка). Издержки копи-пасты?
0 |
|
El petyx 0 / 0 / 0 Регистрация: 24.05.2017 Сообщений: 4 |
||||
|
15.06.2017, 07:39 [ТС] |
3 |
|||
|
Не, издержки криворукости. Вот, подправил, но ошибка (103) таже появляется, а именно в строке 43
0 |
|
volvo Супер-модератор 32451 / 20945 / 8105 Регистрация: 22.10.2011 Сообщений: 36,213 Записей в блоге: 7 |
||||
|
15.06.2017, 09:22 |
4 |
|||
|
РешениеЦикл while не нужен, из файла и так прочитается столько значений, сколько туда было записано:
P.S. Ты в курсе, что в StringGrid будет транспонированная относительно StringGrid1 матрица?
0 |
A RunError is a low-level error emitted by the Free Pascal Run Time Library. In Lazarus, RunErrors are raised as exceptions.
- Trying to open for writing a file which is read-only, or which is actually a directory.
- File is currently locked or used by another process.
- Trying to create a new file, or directory while a file or directory of the same name already exists.
- Trying to read from a file which was opened in write-only mode.
- Trying to write from a file which was opened in read-only mode.
- Trying to remove a directory or file while it is not possible.
- No permission to access the file or directory.
- An array was accessed with an index outside its declared range.
- Trying to assign a value to a variable outside its range (for instance an enumerated type).
- if you call Dispose or Freemem with an invalid pointer
- in case New or GetMem is called, and there is no more memory available. The behavior in this case depends on the setting of ReturnNilIfGrowHeapFails. If it is True, then Nil is returned. if False, then runerror 204 is raised.
- Dereferencing a nil pointer.
- Trying to access memory which is out of bounds (for example, calling move with an invalid length).
Add {$define UseCThreads} in the top of the first Pascal unit (usually the project .lpr file)
Lazarus runtime error 103
Mavlyudov » 12.12.2011 03:20:21
После компилирования при запуске возникает ошибка:
Runtime error 103 at
В программе нету работы с файлами.
Есть только обращение к таким процедурам
WRITEln(‘N=’);
READLN(N);
READLN;
В ошибке указан номер строчки , которой соответствует WRITEln(‘N=’);
Компилирую из командной строки(.bat фай) такого содержания
fpWbinwin32ppc386 -Sd -Sg -Un -O1 -Xs -gl %1
Компилятор версии 1.0.10 [2003/06/27].
Также пробовал версию 2.4.4 [2011/04/23]. При компилировании из командной строки ошибка таже самая,
а вот при компилировании из-под оболочки fp.exe всё компилируется и запускается без ошибок.
В чем может быт причина возникновения такой ошибки 103 и как ее устранить?
Re: Error 103
Сквозняк » 12.12.2011 04:48:52
Re: Error 103
Sergei I. Gorelkin » 12.12.2011 08:45:06
Re: Error 103
Mavlyudov » 13.12.2011 03:12:11
Сквозняк
Я предполагал, что fpc (или fp) использует ppc386 при компиляции, поэтому искал файл настроек с директивами, которые можно прописать и в командной строке. Как оказалось, fp и ppc386 — два независимых приложения.
Sergei I. Gorelkin
Видимо, речь все таки идет о ключе ключе -WС. Да, теперь компилируется.
Но при компиляции компилером версии 1.0.10 возникла другая ошибка 203. Переполнение кучи.
Runtime error 203 at адрес
и еще несколько адресов ниже
указана строка с кодом GetMem(ARRM[I], sizeof(ARRM[I]^));
При использовании компилятора версии 2.4.4 такой ошибки не возникает. Но нужно разобраться именно с ошибкой компилятора более ранней версии.
Компилирую как и раньше командной строкой через ppc386.
Настройки .bat файла:
FPC2.4.4bini386-win32ppc386 -Sd -Sg -Un -O1 -Xs -gl %1 -FU -Foc: -WC -WN
При запуске программы предполагается ввод большого числа(например, 20000), так чтобы выполнилась часть кода в except.
Код: Выделить всё program Project4;
type
MAS = array [0..NNMAT-1] of Double;
ARR = ^MAS;
MAS2 = array [0..NNARR] of ARR;
PMAS2 = ^MAS2;
var <——————————->
NMAT0, NMAT: INTEGER;
ARRM: array [0..NNARR] of ARR;
ARR0: ARR;
GE:DWORD;
procedure MAT_PRED(N:INTEGER);
var
NN, I: LONGINT;
begin
NN:= SQR(N);
I:= 0;
NMAT:= 0;
Источник
Lazarus runtime error 103
Applications generated by Free Pascal might generate run-time errors when certain abnormal conditions are detected in the application. This appendix lists the possible run-time errors and gives information on why they might be produced. 1 Invalid function number An invalid operating system call was attempted. 2 File not found Reported when trying to erase, rename or open a non-existent file. 3 Path not found Reported by the directory handling routines when a path does not exist or is invalid. Also reported when trying to access a non-existent file. 4 Too many open files The maximum number of files currently opened by your process has been reached. Certain operating systems limit the number of files which can be opened concurrently, and this error can occur when this limit has been reached. 5 File access denied Permission to access the file is denied. This error might be caused by one of several reasons:
- Trying to open for writing a file which is read-only, or which is actually a directory.
- File is currently locked or used by another process.
- Trying to create a new file, or directory while a file or directory of the same name already exists.
- Trying to read from a file which was opened in write-only mode.
- Trying to write from a file which was opened in read-only mode.
- Trying to remove a directory or file while it is not possible.
- No permission to access the file or directory.
6 Invalid file handle If this happens, the file variable you are using is trashed; it indicates that your memory is corrupted. 12 Invalid file access code Reported when a reset or rewrite is called with an invalid FileMode value. 15 Invalid drive number The number given to the Getdir or ChDir function specifies a non-existent disk. 16 Cannot remove current directory Reported when trying to remove the currently active directory. 17 Cannot rename across drives You cannot rename a file such that it would end up on another disk or partition. 100 Disk read error An error occurred when reading from disk. Typically happens when you try to read past the end of a file. 101 Disk write error Reported when the disk is full, and you’re trying to write to it. 102 File not assigned This is reported by Reset , Rewrite , Append , Rename and Erase , if you call them with an unassigned file as a parameter. 103 File not open Reported by the following functions : Close, Read, Write, Seek, EOf, FilePos, FileSize, Flush, BlockRead, and BlockWrite if the file is not open. 104 File not open for input Reported by Read, BlockRead, Eof, Eoln, SeekEof or SeekEoln if the file is not opened with Reset . 105 File not open for output Reported by write if a text file isn’t opened with Rewrite . 106 Invalid numeric format Reported when a non-numeric value is read from a text file, and a numeric value was expected. 107 Invalid enumeration Reported when a text representation of an enumerated constant cannot be created in a call to str or write(ln). 150 Disk is write-protected (Critical error) 151 Bad drive request struct length (Critical error) 152 Drive not ready (Critical error) 154 CRC error in data (Critical error) 156 Disk seek error (Critical error) 157 Unknown media type (Critical error) 158 Sector Not Found (Critical error) 159 Printer out of paper (Critical error) 160 Device write fault (Critical error) 161 Device read fault (Critical error) 162 Hardware failure (Critical error) 200 Division by zero The application attempted to divide a number by zero. 201 Range check error If you compiled your program with range checking on, then you can get this error in the following cases: 1. An array was accessed with an index outside its declared range. 2. Trying to assign a value to a variable outside its range (for instance an enumerated type). 202 Stack overflow error The stack has grown beyond its maximum size (in which case the size of local variables should be reduced to avoid this error), or the stack has become corrupt. This error is only reported when stack checking is enabled. 203 Heap overflow error The heap has grown beyond its boundaries. This is caused when trying to allocate memory explicitly with New , GetMem or ReallocMem , or when a class or object instance is created and no memory is left. Please note that, by default, Free Pascal provides a growing heap, i.e. the heap will try to allocate more memory if needed. However, if the heap has reached the maximum size allowed by the operating system or hardware, then you will get this error. 204 Invalid pointer operation You will get this in several cases:
- if you call Dispose or Freemem with an invalid pointer
- in case New or GetMem is called, and there is no more memory available. The behavior in this case depends on the setting of ReturnNilIfGrowHeapFails . If it is True , then Nil is returned. if False , then runerror 204 is raised.
205 Floating point overflow You are trying to use or produce real numbers that are too large. 206 Floating point underflow You are trying to use or produce real numbers that are too small. 207 Invalid floating point operation Can occur if you try to calculate the square root or logarithm of a negative number. 210 Object not initialized When compiled with range checking on, a program will report this error if you call a virtual method without having called its object’s constructor. 211 Call to abstract method Your program tried to execute an abstract virtual method. Abstract methods should be overridden, and the overriding method should be called. 212 Stream registration error This occurs when an invalid type is registered in the objects unit. 213 Collection index out of range You are trying to access a collection item with an invalid index ( objects unit). 214 Collection overflow error The collection has reached its maximal size, and you are trying to add another element ( objects unit). 215 Arithmetic overflow error This error is reported when the result of an arithmetic operation is outside of its supported range. Contrary to Turbo Pascal, this error is only reported for 32-bit or 64-bit arithmetic overflows. This is due to the fact that everything is converted to 32-bit or 64-bit before doing the actual arithmetic operation. 216 General Protection fault The application tried to access invalid memory space. This can be caused by several problems: 1. Dereferencing a nil pointer. 2. Trying to access memory which is out of bounds (for example, calling move with an invalid length). 217 Unhandled exception occurred An exception occurred, and there was no exception handler present. The sysutils unit installs a default exception handler which catches all exceptions and exits gracefully. 218 Invalid value specified Error 218 occurs when an invalid value was specified to a system call, for instance when specifying a negative value to a seek() call. 219 Invalid typecast
Thrown when an invalid typecast is attempted on a class using the as operator. This error is also thrown when an object or class is typecast to an invalid class or object and a virtual method of that class or object is called. This last error is only detected if the -CR compiler option is used. 222 Variant dispatch error No dispatch method to call from variant. 223 Variant array create The variant array creation failed. Usually when there is not enough memory. 224 Variant is not an array This error occurs when a variant array operation is attempted on a variant which is not an array. 225 Var Array Bounds check error This error occurs when a variant array index is out of bounds. 227 Assertion failed error An assertion failed, and no AssertErrorProc procedural variable was installed. 229 Safecall error check This error occurs is a safecall check fails, and no handler routine is available. 231 Exception stack corrupted This error occurs when the exception object is retrieved and none is available. 232 Threads not supported Thread management relies on a separate driver on some operating systems (notably, Unixes). The unit with this driver needs to be specified on the uses clause of the program, preferably as the first unit ( cthreads on unix).
Источник
RunError
A RunError is a low-level error emitted by the Free Pascal Run Time Library. In Lazarus, RunErrors are raised as exceptions.

| # | Short description | Explanation |
|---|---|---|
| 1 | Invalid function number | An invalid operating system call was attempted. |
| 2 | File not found | Reported when trying to erase, rename or open a non-existent file. |
| 3 | Path not found | Reported by the directory handling routines when a path does not exist or is invalid. Also reported when trying to access a non-existent file. |
| 4 | Too many open files | The maximum number of files currently opened by your process has been reached. Certain operating systems limit the number of files which can be opened concurrently, and this error can occur when this limit has been reached. |
| 5 | File access denied | Permission to access the file is denied. This error might be caused by one of several reasons:
|
| 6 | Invalid file handle | If this happens, the file variable you are using is trashed; it indicates that your memory is corrupted. |
| 12 | Invalid file access code | Reported when a reset or rewrite is called with an invalid FileMode value. |
| 15 | Invalid drive number | The number given to the Getdir or ChDir function specifies a non-existent disk. |
| 16 | Cannot remove current directory | Reported when trying to remove the currently active directory. |
| 17 | Cannot rename across drives | You cannot rename a file such that it would end up on another disk or partition. |
| 100 | Disk read error | An error occurred when reading from disk. Typically happens when you try to read past the end of a file. |
| 101 | Disk write error | Reported when the disk is full, and you’re trying to write to it. |
| 102 | File not assigned | This is reported by Reset, Rewrite, Append, Rename and Erase, if you call them with an unassigned file as a parameter. |
| 103 | File not open | Reported by the following functions : Close, Read, Write, Seek, EOf, FilePos, FileSize, Flush, BlockRead, and BlockWrite if the file is not open. |
| 104 | File not open for input | Reported by Read, BlockRead, Eof, Eoln, SeekEof or SeekEoln if the file is not opened with Reset. |
| 105 | File not open for output | Reported by write if a text file isn’t opened with Rewrite. |
| 106 | Invalid numeric format | Reported when a non-numeric value is read from a text file, and a numeric value was expected. |
| 107 | Invalid enumeration | Reported when a text representation of an enumerated constant cannot be created in a call to str or write(ln). |
| 150 | Disk is write-protected | (Critical error) |
| 151 | Bad drive request struct length | (Critical error) |
| 152 | Drive not ready | (Critical error) |
| 154 | CRC error in data | (Critical error) |
| 156 | Disk seek error | (Critical error) |
| 157 | Unknown media type | (Critical error) |
| 158 | Sector Not Found | (Critical error) |
| 159 | Printer out of paper | (Critical error) |
| 160 | Device write fault | (Critical error) |
| 161 | Device read fault | (Critical error) |
| 162 | Hardware failure | (Critical error) |
| 200 | Division by zero | The application attempted to divide a number by zero. |
| 201 | Range check error | If you compiled your program with range checking on, then you can get this error in the following cases:
|
| 202 | Stack overflow error | The stack has grown beyond its maximum size (in which case the size of local variables should be reduced to avoid this error), or the stack has become corrupt. This error is only reported when stack checking is enabled. |
| 203 | Heap overflow error | The heap has grown beyond its boundaries. This is caused when trying to allocate memory explicitly with New, GetMem or ReallocMem, or when a class or object instance is created and no memory is left. Please note that, by default, Free Pascal provides a growing heap, i.e. the heap will try to allocate more memory if needed. However, if the heap has reached the maximum size allowed by the operating system or hardware, then you will get this error. |
| 204 | Invalid pointer operation | You will get this in several cases:
|
| 205 | Floating point overflow | You are trying to use or produce real numbers that are too large. |
| 206 | Floating point underflow | You are trying to use or produce real numbers that are too small. |
| 207 | Invalid floating point operation | Can occur if you try to calculate the square root or logarithm of a negative number. |
| 210 | Object not initialized | When compiled with range checking on, a program will report this error if you call a virtual method without having called its object’s constructor. |
| 211 | Call to abstract method | Your program tried to execute an abstract virtual method. Abstract methods should be overridden, and the overriding method should be called. |
| 212 | Stream registration error | This occurs when an invalid type is registered in the objects unit. |
| 213 | Collection index out of range | You are trying to access a collection item with an invalid index (objects unit). |
| 214 | Collection overflow error | The collection has reached its maximal size, and you are trying to add another element (objects unit). |
| 215 | Arithmetic overflow error | This error is reported when the result of an arithmetic operation is outside of its supported range. Contrary to Turbo Pascal, this error is only reported for 32-bit or 64-bit arithmetic overflows. This is due to the fact that everything is converted to 32-bit or 64-bit before doing the actual arithmetic operation. |
| 216 | General Protection fault | The application tried to access invalid memory space. This can be caused by several problems:
|
| 217 | Unhandled exception occurred | An exception occurred, and there was no exception handler present. The sysutils unit installs a default exception handler which catches all exceptions and exits gracefully. |
| 218 | Invalid value specified | Error 218 occurs when an invalid value was specified to a system call, for instance when specifying a negative value to a seek() call. |
| 219 | Invalid typecast | Thrown when an invalid typecast is attempted on a class using the as operator. This error is also thrown when an object or class is typecast to an invalid class or object and a virtual method of that class or object is called. This last error is only detected if the -CR compiler option is used. |
| 222 | Variant dispatch error | No dispatch method to call from variant. |
| 223 | Variant array create | The variant array creation failed. Usually when there is not enough memory. |
| 224 | Variant is not an array | This error occurs when a variant array operation is attempted on a variant which is not an array. |
| 225 | Var Array Bounds check error | This error occurs when a variant array index is out of bounds. |
| 227 | Assertion failed error | An assertion failed, and no AssertErrorProc procedural variable was installed. |
| 229 | Safecall error check | This error occurs is a safecall check fails, and no handler routine is available. |
| 231 | Exception stack corrupted | This error occurs when the exception object is retrieved and none is available. |
| 232 | Threads not supported | Thread management relies on a separate driver on some operating systems (notably, Unixes). The unit with this driver needs to be specified on the uses clause of the program, preferably as the first unit (cthreads on unix).
Add in the top of the first Pascal unit (usually the project .lpr file)
Источник Adblock |
Okay, it’s over a year late, but I’m going to add my comment to this, as it explains why this is happening.
I had the exact same problem in a multi-threaded application with code almost identical to the snippet above and I had critical sections protecting the code.
The problem occurred most readily when one logging operation swiftly followed another. The second operation would fail for the above reason.
I thought it was anti-virus software too, but the error happened on one machine and not the other, where both had Norton 360 installed. The machine with the problem was brand new Windows 7 and the one without was Windows XP. A colleague also had the problem running the system under a virtualised Windows Vista machine with no virus checker installed.
So my question was, «why was this XP machine so different?».
For one, it wasn’t virgin, and that is the answer it seems:
Opportunistic locking and NT caching were turned off. Most (mature) Delphi developers will know that when using BDE, these are turned off in order to maintain DBF and DB file integrity in multi-user situations. These settings were not disabled on the newer machines because we no longer develop for Paradox data files!
Delayed write caching seems to leave a read/write lock on the file until the OS has done its business, which could be several milliseconds later.
So, in my case, the second log event was being blocked by the first.
Okay, I’m not suggesting that you turn off opportunistic locking + NT Caching. One of the major reasons we moved away from BDE was to avoid persuading customers to tinker with such settings. So, there are four practical solutions:
1) To retry for an acceptable period of time, as mentioned by dangph.
2) to open the file when the application loads and hold it open for the full duration of the application. Not so useful if you are running multiple instances of the application.
3) Lazily put a sleep(1) before the logging code and hope that is long enough for the lock to be released. But that risks slowing your system down if you are doing lots of logging.
or 4) Put a try…except..end around your code. But then you are probably guaranteed to miss 100% of the second messages (referring to my case).

Сообщение было отмечено volvo как решение