runerrors.pp 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331
  1. {$mode objfpc}
  2. unit runerrors;
  3. Interface
  4. Function GetRunError(Errno : Byte) : String;
  5. Implementation
  6. Resourcestring
  7. RunNoError = 'No error.';
  8. RunOutOfMemory = 'Runtime error 1';
  9. RunAbort = 'Operation aborted';
  10. RunAbstractError = 'Abstract method called';
  11. RunAccessDenied = 'Access denied';
  12. RunAccessViolation = 'Access violation';
  13. RunAssertError = '%s (%s, line %d)';
  14. RunAssertionFailed = 'Assertion failed';
  15. RunControlC = 'Control-C hit';
  16. RunDiskFull = 'Disk Full';
  17. RunDispatchError = 'No variant method call dispatch';
  18. RunDivByZero = 'Division by zero';
  19. RunEndOfFile = 'Read past end of file';
  20. RunExternalException = 'External exception.';
  21. RunFileNotAssigned = 'File not assigned';
  22. RunFileNotFound = 'File not found';
  23. RunFileNotOpen = 'File not open';
  24. RunFileNotOpenForInput = 'File not open for input';
  25. RunFileNotOpenForOutput = 'File not open for output';
  26. RunInValidFileName = 'Invalid filename';
  27. RunIntfCastError = 'Interface not supported';
  28. RunIntOverflow = 'Arithmetic overflow';
  29. RunInvalidCast = 'Invalid type cast';
  30. RunInvalidDrive = 'Invalid drive specified';
  31. RunInvalidFileHandle = 'Invalid file handle';
  32. RunInvalidInput = 'Invalid input';
  33. RunInvalidOp = 'Invalid floating point operation';
  34. RunInvalidPointer = 'Invalid pointer operation';
  35. RunInvalidVarCast = 'Invalid variant type case';
  36. RunInvalidVarOp = 'Invalid variant operation';
  37. RunOverflow = 'Floating point overflow';
  38. RunPrivilege = 'Privileged instruction';
  39. RunRangeError = 'Range check error';
  40. RunSafecallException = 'Exception in safecall method';
  41. RunTooManyOpenFiles = 'Too many open files';
  42. RunUnderflow = 'Floating point underflow';
  43. RunUnknown = 'Unknown run-time error code: ';
  44. RunVarArrayBounds = 'Variant array bounds error';
  45. RunVarArrayCreate = 'Variant array cannot be created';
  46. RunVarNotArray = 'Variant doesn''t contain an array';
  47. RunExceptionStack = 'Exception stack error';
  48. RunThreadsNotSupported = 'Threading not supported by this binary. Recompile with thread driver.';
  49. Const
  50. RunErrorArray : Array[0..255] of string = (
  51. { 0 } RunNoError,
  52. { 1 } RunOutOfMemory,
  53. { 2 } RunFileNotFound,
  54. { 3 } RunInvalidFileName,
  55. { 4 } RunTooManyOpenFiles,
  56. { 5 } RunAccessDenied,
  57. { 6 } RunInvalidFileHandle,
  58. { 7 } '',
  59. { 8 } '',
  60. { 9 } '',
  61. { 10 } '',
  62. { 11 } '',
  63. { 12 } '',
  64. { 13 } '',
  65. { 14 } '',
  66. { 15 } RunInvalidDrive,
  67. { 16 } '',
  68. { 17 } '',
  69. { 18 } '',
  70. { 19 } '',
  71. { 20 } '',
  72. { 21 } '',
  73. { 22 } '',
  74. { 23 } '',
  75. { 24 } '',
  76. { 25 } '',
  77. { 26 } '',
  78. { 27 } '',
  79. { 28 } '',
  80. { 29 } '',
  81. { 30 } '',
  82. { 31 } '',
  83. { 32 } '',
  84. { 33 } '',
  85. { 34 } '',
  86. { 35 } '',
  87. { 36 } '',
  88. { 37 } '',
  89. { 38 } '',
  90. { 39 } '',
  91. { 40 } '',
  92. { 41 } '',
  93. { 42 } '',
  94. { 43 } '',
  95. { 44 } '',
  96. { 45 } '',
  97. { 46 } '',
  98. { 47 } '',
  99. { 48 } '',
  100. { 49 } '',
  101. { 50 } '',
  102. { 51 } '',
  103. { 52 } '',
  104. { 53 } '',
  105. { 54 } '',
  106. { 55 } '',
  107. { 56 } '',
  108. { 57 } '',
  109. { 58 } '',
  110. { 59 } '',
  111. { 60 } '',
  112. { 61 } '',
  113. { 62 } '',
  114. { 63 } '',
  115. { 64 } '',
  116. { 65 } '',
  117. { 66 } '',
  118. { 67 } '',
  119. { 68 } '',
  120. { 69 } '',
  121. { 70 } '',
  122. { 71 } '',
  123. { 72 } '',
  124. { 73 } '',
  125. { 74 } '',
  126. { 75 } '',
  127. { 76 } '',
  128. { 77 } '',
  129. { 78 } '',
  130. { 79 } '',
  131. { 80 } '',
  132. { 81 } '',
  133. { 82 } '',
  134. { 83 } '',
  135. { 84 } '',
  136. { 85 } '',
  137. { 86 } '',
  138. { 87 } '',
  139. { 88 } '',
  140. { 89 } '',
  141. { 90 } '',
  142. { 91 } '',
  143. { 92 } '',
  144. { 93 } '',
  145. { 94 } '',
  146. { 95 } '',
  147. { 96 } '',
  148. { 97 } '',
  149. { 98 } '',
  150. { 99 } '',
  151. { 100 } RunEndOfFile,
  152. { 101 } RunDiskFull,
  153. { 102 } RunFileNotAssigned,
  154. { 103 } RunFileNotOpen,
  155. { 104 } RunFileNotOpenForInput,
  156. { 105 } RunFileNotOpenForOutput,
  157. { 106 } RunInvalidInput,
  158. { 107 } '',
  159. { 108 } '',
  160. { 109 } '',
  161. { 110 } '',
  162. { 111 } '',
  163. { 112 } '',
  164. { 113 } '',
  165. { 114 } '',
  166. { 115 } '',
  167. { 116 } '',
  168. { 117 } '',
  169. { 118 } '',
  170. { 119 } '',
  171. { 120 } '',
  172. { 121 } '',
  173. { 122 } '',
  174. { 123 } '',
  175. { 124 } '',
  176. { 125 } '',
  177. { 126 } '',
  178. { 127 } '',
  179. { 128 } '',
  180. { 129 } '',
  181. { 130 } '',
  182. { 131 } '',
  183. { 132 } '',
  184. { 133 } '',
  185. { 134 } '',
  186. { 135 } '',
  187. { 136 } '',
  188. { 137 } '',
  189. { 138 } '',
  190. { 139 } '',
  191. { 140 } '',
  192. { 141 } '',
  193. { 142 } '',
  194. { 143 } '',
  195. { 144 } '',
  196. { 145 } '',
  197. { 146 } '',
  198. { 147 } '',
  199. { 148 } '',
  200. { 149 } '',
  201. { 150 } '',
  202. { 151 } '',
  203. { 152 } '',
  204. { 153 } '',
  205. { 154 } '',
  206. { 155 } '',
  207. { 156 } '',
  208. { 157 } '',
  209. { 158 } '',
  210. { 159 } '',
  211. { 160 } '',
  212. { 161 } '',
  213. { 162 } '',
  214. { 163 } '',
  215. { 164 } '',
  216. { 165 } '',
  217. { 166 } '',
  218. { 167 } '',
  219. { 168 } '',
  220. { 169 } '',
  221. { 170 } '',
  222. { 171 } '',
  223. { 172 } '',
  224. { 173 } '',
  225. { 174 } '',
  226. { 175 } '',
  227. { 176 } '',
  228. { 177 } '',
  229. { 178 } '',
  230. { 179 } '',
  231. { 180 } '',
  232. { 181 } '',
  233. { 182 } '',
  234. { 183 } '',
  235. { 184 } '',
  236. { 185 } '',
  237. { 186 } '',
  238. { 187 } '',
  239. { 188 } '',
  240. { 189 } '',
  241. { 190 } '',
  242. { 191 } '',
  243. { 192 } '',
  244. { 193 } '',
  245. { 194 } '',
  246. { 195 } '',
  247. { 196 } '',
  248. { 197 } '',
  249. { 198 } '',
  250. { 199 } '',
  251. { 200 } RunDivByZero,
  252. { 201 } RunRangeError,
  253. { 202 } '',
  254. { 203 } RunOutOfMemory,
  255. { 204 } RunInvalidPointer,
  256. { 205 } RunOverFlow,
  257. { 206 } RunUnderFlow,
  258. { 207 } RunInvalidOp,
  259. { 208 } '',
  260. { 209 } '',
  261. { 210 } '',
  262. { 211 } RunAbstractError,
  263. { 212 } '',
  264. { 213 } '',
  265. { 214 } '',
  266. { 215 } RunIntOverFlow,
  267. { 216 } RunAccessViolation,
  268. { 217 } RunPrivilege,
  269. { 218 } RunControlC,
  270. { 219 } RunInvalidCast,
  271. { 220 } RunInvalidVarCast,
  272. { 221 } RunInvalidVarOp,
  273. { 222 } RunDispatchError,
  274. { 223 } RunVarArrayCreate,
  275. { 224 } RunVarNotArray,
  276. { 225 } RunVarArrayBounds,
  277. { 226 } '',
  278. { 227 } RunAssertionFailed,
  279. { 228 } RunExternalException,
  280. { 229 } RunIntfCastError,
  281. { 230 } RunSafecallException,
  282. { 231 } RunExceptionStack,
  283. { 232 } RunThreadsNotSupported,
  284. { 233 } '',
  285. { 234 } '',
  286. { 235 } '',
  287. { 236 } '',
  288. { 237 } '',
  289. { 238 } '',
  290. { 239 } '',
  291. { 240 } '',
  292. { 241 } '',
  293. { 242 } '',
  294. { 243 } '',
  295. { 244 } '',
  296. { 245 } '',
  297. { 246 } '',
  298. { 247 } '',
  299. { 248 } '',
  300. { 249 } '',
  301. { 250 } '',
  302. { 251 } '',
  303. { 252 } '',
  304. { 253 } '',
  305. { 254 } '',
  306. { 255 } ''
  307. );
  308. Function GetRunError(Errno : Byte) : String;
  309. begin
  310. Result:=RunErrorArray[Errno];
  311. If length(Result)=0 then
  312. {$ifdef VER1_0}
  313. begin
  314. Str(Errno,Result);
  315. Result:=RunUnknown+Result;
  316. end;
  317. {$else}
  318. Result:=RunUnknown+Str(Errno);
  319. {$endif}
  320. end;
  321. end.