Sign in Join
Wiki copytemporary

RunError: what changed

Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
11A **RunError** is a low-level error emitted by the Free Pascal [[RTL|Run Time Library]].
22
3-<figure>
4-<img src="runerror232.png" title="runerror232.png" />
5-<figcaption>runerror232.png</figcaption>
6-</figure>
3+![](/wiki-images/3/35/Runerror232.png)
74
8-<table>
9-<thead>
10-<tr>
11-<th><p>#</p></th>
12-<th><p>Short description</p></th>
13-<th><p>Explanation</p></th>
14-</tr>
15-</thead>
16-<tbody>
17-<tr>
18-<td><p>1</p></td>
19-<td><p>Invalid function number</p></td>
20-<td><p>An invalid operating system call was attempted.</p></td>
21-</tr>
22-<tr>
23-<td><p>2</p></td>
24-<td><p>File not found</p></td>
25-<td><p>Reported when trying to erase, rename or open a non-existent file.</p></td>
26-</tr>
27-<tr>
28-<td><p>3</p></td>
29-<td><p>Path not found</p></td>
30-<td><p>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.</p></td>
31-</tr>
32-<tr>
33-<td><p>4</p></td>
34-<td><p>Too many open files</p></td>
35-<td><p>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.</p></td>
36-</tr>
37-<tr>
38-<td><p>5</p></td>
39-<td><p>File access denied</p></td>
40-<td><p>Permission to access the file is denied. This error might be caused by one of several reasons:</p>
41-<ul>
42-<li>Trying to open for writing a file which is read-only, or which is actually a directory.</li>
43-<li>File is currently locked or used by another process.</li>
44-<li>Trying to create a new file, or directory while a file or directory of the same name already exists.</li>
45-<li>Trying to read from a file which was opened in write-only mode.</li>
46-<li>Trying to write from a file which was opened in read-only mode.</li>
47-<li>Trying to remove a directory or file while it is not possible.</li>
48-<li>No permission to access the file or directory.</li>
49-</ul></td>
50-</tr>
51-<tr>
52-<td><p>6</p></td>
53-<td><p>Invalid file handle</p></td>
54-<td><p>If this happens, the file variable you are using is trashed; it indicates that your memory is corrupted.</p></td>
55-</tr>
56-<tr>
57-<td><p>12</p></td>
58-<td><p>Invalid file access code</p></td>
59-<td><p>Reported when a reset or rewrite is called with an invalid FileMode value.</p></td>
60-</tr>
61-<tr>
62-<td><p>15</p></td>
63-<td><p>Invalid drive number</p></td>
64-<td><p>The number given to the Getdir or ChDir function specifies a non-existent disk.</p></td>
65-</tr>
66-<tr>
67-<td><p>16</p></td>
68-<td><p>Cannot remove current directory</p></td>
69-<td><p>Reported when trying to remove the currently active directory.</p></td>
70-</tr>
71-<tr>
72-<td><p>17</p></td>
73-<td><p>Cannot rename across drives</p></td>
74-<td><p>You cannot rename a file such that it would end up on another disk or partition.</p></td>
75-</tr>
76-<tr>
77-<td><p>100</p></td>
78-<td><p>Disk read error</p></td>
79-<td><p>An error occurred when reading from disk. Typically happens when you try to read past the end of a file.</p></td>
80-</tr>
81-<tr>
82-<td><p>101</p></td>
83-<td><p>Disk write error</p></td>
84-<td><p>Reported when the disk is full, and you’re trying to write to it.</p></td>
85-</tr>
86-<tr>
87-<td><p>102</p></td>
88-<td><p>File not assigned</p></td>
89-<td><p>This is reported by Reset, Rewrite, Append, Rename and Erase, if you call them with an unassigned file as a parameter.</p></td>
90-</tr>
91-<tr>
92-<td><p>103</p></td>
93-<td><p>File not open</p></td>
94-<td><p>Reported by the following functions : Close, Read, Write, Seek, EOf, FilePos, FileSize, Flush, BlockRead, and BlockWrite if the file is not open.</p></td>
95-</tr>
96-<tr>
97-<td><p>104</p></td>
98-<td><p>File not open for input</p></td>
99-<td><p>Reported by Read, BlockRead, Eof, Eoln, SeekEof or SeekEoln if the file is not opened with Reset.</p></td>
100-</tr>
101-<tr>
102-<td><p>105</p></td>
103-<td><p>File not open for output</p></td>
104-<td><p>Reported by write if a text file isn’t opened with Rewrite.</p></td>
105-</tr>
106-<tr>
107-<td><p>106</p></td>
108-<td><p>Invalid numeric format</p></td>
109-<td><p>Reported when a non-numeric value is read from a text file, and a numeric value was expected.</p></td>
110-</tr>
111-<tr>
112-<td><p>107</p></td>
113-<td><p>Invalid enumeration</p></td>
114-<td><p>Reported when a text representation of an enumerated constant cannot be created in a call to str or write(ln).</p></td>
115-</tr>
116-<tr>
117-<td><p>150</p></td>
118-<td><p>Disk is write-protected</p></td>
119-<td><p>(Critical error)</p></td>
120-</tr>
121-<tr>
122-<td><p>151</p></td>
123-<td><p>Bad drive request struct length</p></td>
124-<td><p>(Critical error)</p></td>
125-</tr>
126-<tr>
127-<td><p>152</p></td>
128-<td><p>Drive not ready</p></td>
129-<td><p>(Critical error)</p></td>
130-</tr>
131-<tr>
132-<td><p>154</p></td>
133-<td><p>CRC error in data</p></td>
134-<td><p>(Critical error)</p></td>
135-</tr>
136-<tr>
137-<td><p>156</p></td>
138-<td><p>Disk seek error</p></td>
139-<td><p>(Critical error)</p></td>
140-</tr>
141-<tr>
142-<td><p>157</p></td>
143-<td><p>Unknown media type</p></td>
144-<td><p>(Critical error)</p></td>
145-</tr>
146-<tr>
147-<td><p>158</p></td>
148-<td><p>Sector Not Found</p></td>
149-<td><p>(Critical error)</p></td>
150-</tr>
151-<tr>
152-<td><p>159</p></td>
153-<td><p>Printer out of paper</p></td>
154-<td><p>(Critical error)</p></td>
155-</tr>
156-<tr>
157-<td><p>160</p></td>
158-<td><p>Device write fault</p></td>
159-<td><p>(Critical error)</p></td>
160-</tr>
161-<tr>
162-<td><p>161</p></td>
163-<td><p>Device read fault</p></td>
164-<td><p>(Critical error)</p></td>
165-</tr>
166-<tr>
167-<td><p>162</p></td>
168-<td><p>Hardware failure</p></td>
169-<td><p>(Critical error)</p></td>
170-</tr>
171-<tr>
172-<td><p>200</p></td>
173-<td><p>Division by zero</p></td>
174-<td><p>The application attempted to divide a number by zero.</p></td>
175-</tr>
176-<tr>
177-<td><p>201</p></td>
178-<td><p>Range check error</p></td>
179-<td><p>If you compiled your program with range checking on, then you can get this error in the following cases:</p>
180-<ol>
181-<li>An array was accessed with an index outside its declared range.</li>
182-<li>Trying to assign a value to a variable outside its range (for instance an enumerated type).</li>
183-</ol></td>
184-</tr>
185-<tr>
186-<td><p>202</p></td>
187-<td><p>Stack overflow error</p></td>
188-<td><p>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.</p></td>
189-</tr>
190-<tr>
191-<td><p>203</p></td>
192-<td><p>Heap overflow error</p></td>
193-<td><p>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.</p></td>
194-</tr>
195-<tr>
196-<td><p>204</p></td>
197-<td><p>Invalid pointer operation</p></td>
198-<td><p>You will get this in several cases:</p>
199-<ul>
200-<li>if you call Dispose or Freemem with an invalid pointer</li>
201-<li>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.</li>
202-</ul></td>
203-</tr>
204-<tr>
205-<td><p>205</p></td>
206-<td><p>Floating point overflow</p></td>
207-<td><p>You are trying to use or produce real numbers that are too large.</p></td>
208-</tr>
209-<tr>
210-<td><p>206</p></td>
211-<td><p>Floating point underflow</p></td>
212-<td><p>You are trying to use or produce real numbers that are too small.</p></td>
213-</tr>
214-<tr>
215-<td><p>207</p></td>
216-<td><p>Invalid floating point operation</p></td>
217-<td><p>Can occur if you try to calculate the square root or logarithm of a negative number.</p></td>
218-</tr>
219-<tr>
220-<td><p>210</p></td>
221-<td><p>Object not initialized</p></td>
222-<td><p>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.</p></td>
223-</tr>
224-<tr>
225-<td><p>211</p></td>
226-<td><p>Call to abstract method</p></td>
227-<td><p>Your program tried to execute an abstract virtual method. Abstract methods should be overridden, and the overriding method should be called.</p></td>
228-</tr>
229-<tr>
230-<td><p>212</p></td>
231-<td><p>Stream registration error</p></td>
232-<td><p>This occurs when an invalid type is registered in the objects unit.</p></td>
233-</tr>
234-<tr>
235-<td><p>213</p></td>
236-<td><p>Collection index out of range</p></td>
237-<td><p>You are trying to access a collection item with an invalid index (objects unit).</p></td>
238-</tr>
239-<tr>
240-<td><p>214</p></td>
241-<td><p>Collection overflow error</p></td>
242-<td><p>The collection has reached its maximal size, and you are trying to add another element (objects unit).</p></td>
243-</tr>
244-<tr>
245-<td><p>215</p></td>
246-<td><p>Arithmetic overflow error</p></td>
247-<td><p>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.</p></td>
248-</tr>
249-<tr>
250-<td><p>216</p></td>
251-<td><p>[[General Protection fault]]</p></td>
252-<td><p>The application tried to access invalid memory space. This can be caused by several problems:</p>
253-<ol>
254-<li>Dereferencing a nil pointer.</li>
255-<li>Trying to access memory which is out of bounds (for example, calling move with an invalid length).</li>
256-</ol></td>
257-</tr>
258-<tr>
259-<td><p>217</p></td>
260-<td><p>Unhandled exception occurred</p></td>
261-<td><p>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.</p></td>
262-</tr>
263-<tr>
264-<td><p>218</p></td>
265-<td><p>Invalid value specified</p></td>
266-<td><p>Error 218 occurs when an invalid value was specified to a system call, for instance when specifying a negative value to a seek() call.</p></td>
267-</tr>
268-<tr>
269-<td><p>219</p></td>
270-<td><p>Invalid typecast</p></td>
271-<td><p>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.</p></td>
272-</tr>
273-<tr>
274-<td><p>222</p></td>
275-<td><p>Variant dispatch error</p></td>
276-<td><p>No dispatch method to call from variant.</p></td>
277-</tr>
278-<tr>
279-<td><p>223</p></td>
280-<td><p>Variant array create</p></td>
281-<td><p>The variant array creation failed. Usually when there is not enough memory.</p></td>
282-</tr>
283-<tr>
284-<td><p>224</p></td>
285-<td><p>Variant is not an array</p></td>
286-<td><p>This error occurs when a variant array operation is attempted on a variant which is not an array.</p></td>
287-</tr>
288-<tr>
289-<td><p>225</p></td>
290-<td><p>Var Array Bounds check error</p></td>
291-<td><p>This error occurs when a variant array index is out of bounds.</p></td>
292-</tr>
293-<tr>
294-<td><p>227</p></td>
295-<td><p>Assertion failed error</p></td>
296-<td><p>An assertion failed, and no [[AssertErrorProc]] procedural variable was installed.</p></td>
297-</tr>
298-<tr>
299-<td><p>229</p></td>
300-<td><p>Safecall error check</p></td>
301-<td><p>This error occurs is a safecall check fails, and no handler routine is available.</p></td>
302-</tr>
303-<tr>
304-<td><p>231</p></td>
305-<td><p>Exception stack corrupted</p></td>
306-<td><p>This error occurs when the exception object is retrieved and none is available.</p></td>
307-</tr>
308-<tr>
309-<td><p>232</p></td>
310-<td><p>Threads not supported</p></td>
311-<td><p>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).</p>
312-<p>Add <strong>{$define UseCThreads}</strong> in the top of the first Pascal unit (usually the project .lpr file)</p></td>
313-</tr>
314-</tbody>
315-</table>
5+**\#**
6+
7+**Short description**
8+
9+**Explanation**
10+
11+1
12+
13+Invalid function number
14+
15+An invalid operating system call was attempted.
16+
17+2
18+
19+File not found
20+
21+Reported when trying to erase, rename or open a non-existent file.
22+
23+3
24+
25+Path not found
26+
27+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.
28+
29+4
30+
31+Too many open files
32+
33+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.
34+
35+5
36+
37+File access denied
38+
39+Permission to access the file is denied. This error might be caused by one of several reasons:
40+
41+- Trying to open for writing a file which is read-only, or which is actually a directory.
42+- File is currently locked or used by another process.
43+- Trying to create a new file, or directory while a file or directory of the same name already exists.
44+- Trying to read from a file which was opened in write-only mode.
45+- Trying to write from a file which was opened in read-only mode.
46+- Trying to remove a directory or file while it is not possible.
47+- No permission to access the file or directory.
48+
49+6
50+
51+Invalid file handle
52+
53+If this happens, the file variable you are using is trashed; it indicates that your memory is corrupted.
54+
55+12
56+
57+Invalid file access code
58+
59+Reported when a reset or rewrite is called with an invalid FileMode value.
60+
61+15
62+
63+Invalid drive number
64+
65+The number given to the Getdir or ChDir function specifies a non-existent disk.
66+
67+16
68+
69+Cannot remove current directory
70+
71+Reported when trying to remove the currently active directory.
72+
73+17
74+
75+Cannot rename across drives
76+
77+You cannot rename a file such that it would end up on another disk or partition.
78+
79+100
80+
81+Disk read error
82+
83+An error occurred when reading from disk. Typically happens when you try to read past the end of a file.
84+
85+101
86+
87+Disk write error
88+
89+Reported when the disk is full, and you’re trying to write to it.
90+
91+102
92+
93+File not assigned
94+
95+This is reported by Reset, Rewrite, Append, Rename and Erase, if you call them with an unassigned file as a parameter.
96+
97+103
98+
99+File not open
100+
101+Reported by the following functions : Close, Read, Write, Seek, EOf, FilePos, FileSize, Flush, BlockRead, and BlockWrite if the file is not open.
102+
103+104
104+
105+File not open for input
106+
107+Reported by Read, BlockRead, Eof, Eoln, SeekEof or SeekEoln if the file is not opened with Reset.
108+
109+105
110+
111+File not open for output
112+
113+Reported by write if a text file isn’t opened with Rewrite.
114+
115+106
116+
117+Invalid numeric format
118+
119+Reported when a non-numeric value is read from a text file, and a numeric value was expected.
120+
121+107
122+
123+Invalid enumeration
124+
125+Reported when a text representation of an enumerated constant cannot be created in a call to str or write(ln).
126+
127+150
128+
129+Disk is write-protected
130+
131+(Critical error)
132+
133+151
134+
135+Bad drive request struct length
136+
137+(Critical error)
138+
139+152
140+
141+Drive not ready
142+
143+(Critical error)
144+
145+154
146+
147+CRC error in data
148+
149+(Critical error)
150+
151+156
152+
153+Disk seek error
154+
155+(Critical error)
156+
157+157
158+
159+Unknown media type
160+
161+(Critical error)
162+
163+158
164+
165+Sector Not Found
166+
167+(Critical error)
168+
169+159
170+
171+Printer out of paper
172+
173+(Critical error)
174+
175+160
176+
177+Device write fault
178+
179+(Critical error)
180+
181+161
182+
183+Device read fault
184+
185+(Critical error)
186+
187+162
188+
189+Hardware failure
190+
191+(Critical error)
192+
193+200
194+
195+Division by zero
196+
197+The application attempted to divide a number by zero.
198+
199+201
200+
201+Range check error
202+
203+If you compiled your program with range checking on, then you can get this error in the following cases:
204+
205+1. An array was accessed with an index outside its declared range.
206+2. Trying to assign a value to a variable outside its range (for instance an enumerated type).
207+
208+202
209+
210+Stack overflow error
211+
212+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.
213+
214+203
215+
216+Heap overflow error
217+
218+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.
219+
220+204
221+
222+Invalid pointer operation
223+
224+You will get this in several cases:
225+
226+- if you call Dispose or Freemem with an invalid pointer
227+- 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.
228+
229+205
230+
231+Floating point overflow
232+
233+You are trying to use or produce real numbers that are too large.
234+
235+206
236+
237+Floating point underflow
238+
239+You are trying to use or produce real numbers that are too small.
240+
241+207
242+
243+Invalid floating point operation
244+
245+Can occur if you try to calculate the square root or logarithm of a negative number.
246+
247+210
248+
249+Object not initialized
250+
251+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.
252+
253+211
254+
255+Call to abstract method
256+
257+Your program tried to execute an abstract virtual method. Abstract methods should be overridden, and the overriding method should be called.
258+
259+212
260+
261+Stream registration error
262+
263+This occurs when an invalid type is registered in the objects unit.
264+
265+213
266+
267+Collection index out of range
268+
269+You are trying to access a collection item with an invalid index (objects unit).
270+
271+214
272+
273+Collection overflow error
274+
275+The collection has reached its maximal size, and you are trying to add another element (objects unit).
276+
277+215
278+
279+Arithmetic overflow error
280+
281+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.
282+
283+216
284+
285+[[General Protection fault]]
286+
287+The application tried to access invalid memory space. This can be caused by several problems:
288+
289+1. Dereferencing a nil pointer.
290+2. Trying to access memory which is out of bounds (for example, calling move with an invalid length).
291+
292+217
293+
294+Unhandled exception occurred
295+
296+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.
297+
298+218
299+
300+Invalid value specified
301+
302+Error 218 occurs when an invalid value was specified to a system call, for instance when specifying a negative value to a seek() call.
303+
304+219
305+
306+Invalid typecast
307+
308+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.
309+
310+222
311+
312+Variant dispatch error
313+
314+No dispatch method to call from variant.
315+
316+223
317+
318+Variant array create
319+
320+The variant array creation failed. Usually when there is not enough memory.
321+
322+224
323+
324+Variant is not an array
325+
326+This error occurs when a variant array operation is attempted on a variant which is not an array.
327+
328+225
329+
330+Var Array Bounds check error
331+
332+This error occurs when a variant array index is out of bounds.
333+
334+227
335+
336+Assertion failed error
337+
338+An assertion failed, and no [[AssertErrorProc]] procedural variable was installed.
339+
340+229
341+
342+Safecall error check
343+
344+This error occurs is a safecall check fails, and no handler routine is available.
345+
346+231
347+
348+Exception stack corrupted
349+
350+This error occurs when the exception object is retrieved and none is available.
351+
352+232
353+
354+Threads not supported
355+
356+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).
357+
358+Add **{\$define UseCThreads}** in the top of the first Pascal unit (usually the project .lpr file)
316359
317360## See also
318361
319362- [[compile-time error|Compile time errors]]
320363- [List of Run-time errors](http://www.freepascal.org/docs-html/user/userap4.html)
321364
322365---
323366*From the Free Pascal wiki, page "RunError", as it stood on 2023-11-11 after a change by Bart, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*
324367Category: Debugging
325368Category: FPC
326369Category: Glossary
327370Category: Troubleshooting

Back to history