sysconst.pp 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  1. {
  2. $Id$
  3. This file is part of the Free Pascal run time library.
  4. Copyright (c) 2003 by Florian Klaempfl
  5. member of the Free Pascal development team
  6. See the file COPYING.FPC, included in this distribution,
  7. for details about the copyright.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  11. **********************************************************************}
  12. {$mode objfpc}
  13. {$H+}
  14. unit sysconst;
  15. interface
  16. resourcestring
  17. { from old str*.inc files }
  18. SAbortError = 'Operation aborted';
  19. SAbstractError = 'Abstract method called';
  20. SAccessDenied = 'Access denied';
  21. SAccessViolation = 'Access violation';
  22. SArgumentMissing = 'Missing argument in format "%s"';
  23. SAssertError = '%s (%s, line %d)';
  24. SAssertionFailed = 'Assertion failed';
  25. SControlC = 'Control-C hit';
  26. SDiskFull = 'Disk Full';
  27. SDispatchError = 'No variant method call dispatch';
  28. SDivByZero = 'Division by zero';
  29. SEndOfFile = 'Read past end of file';
  30. SErrInvalidDateMonthWeek = 'Year %d, month %d, Week %d and day %d is not a valid date.';
  31. SErrInvalidDateWeek = '%d %d %d is not a valid dateweek';
  32. SErrInvalidDayOfWeek = '%d is not a valid day of the week';
  33. SErrInvalidDayOfWeekInMonth = 'Year %d Month %d NDow %d DOW %d is not a valid date';
  34. SErrInvalidDayOfYear = 'Year %d does not have a day number %d';
  35. SErrInvalidTimeStamp = 'Invalid date/timestamp : "%s"';
  36. SExceptionErrorMessage = 'exception at %p';
  37. SExceptionStack = 'Exception stack error';
  38. SExecuteProcessFailed = 'Failed to execute %s : %d';
  39. SExternalException = 'External exception %x';
  40. SFileNotAssigned = 'File not assigned';
  41. SFileNotFound = 'File not found';
  42. SFileNotOpen = 'File not open';
  43. SFileNotOpenForInput = 'File not open for input';
  44. SFileNotOpenForOutput = 'File not open for output';
  45. SInValidFileName = 'Invalid filename';
  46. SIntOverflow = 'Arithmetic overflow';
  47. SIntfCastError = 'Interface not supported';
  48. SInvalidArgIndex = 'Invalid argument index in format "%s"';
  49. SInvalidBoolean = '"%s" is not a valid boolean.';
  50. SInvalidCast = 'Invalid type cast';
  51. SinvalidCurrency = 'Invalid currency: "%s"';
  52. SInvalidDateTime = '%f is not a valid date/time value.';
  53. SInvalidDrive = 'Invalid drive specified';
  54. SInvalidFileHandle = 'Invalid file handle';
  55. SInvalidFloat = '"%s" is an invalid float';
  56. SInvalidFormat = 'Invalid format specifier : "%s"';
  57. SInvalidGUID = '"%s" is not a valid GUID value';
  58. SInvalidInput = 'Invalid input';
  59. SInvalidInteger = '"%s" is an invalid integer';
  60. SInvalidOp = 'Invalid floating point operation';
  61. SInvalidPointer = 'Invalid pointer operation';
  62. SInvalidVarCast = 'Invalid variant type case';
  63. SInvalidVarNullOp = 'Invalid NULL variant operation';
  64. SInvalidVarOp = 'Invalid variant operation';
  65. SInvalidVarOpWithHResultWithPrefix = 'Invalid variant operation (%s%.8x)'+LineEnding+'%s';
  66. SNoError = 'No error.';
  67. SNoThreadSupport = 'Threads not supported. Recompile program with thread driver.';
  68. SOSError = 'System error, (OS Code %d):'+LineEnding+'%s';
  69. SOutOfMemory = 'Out of memory';
  70. SOverflow = 'Floating point overflow';
  71. SPrivilege = 'Privileged instruction';
  72. SRangeError = 'Range check error';
  73. SSafecallException = 'Exception in safecall method';
  74. STooManyOpenFiles = 'Too many open files';
  75. SUnKnownRunTimeError = 'Unknown Run-Time error : %3.3d';
  76. SUnderflow = 'Floating point underflow';
  77. SUnkOSError = 'An operating system call failed.';
  78. SUnknown = 'Unknown run-time error code: ';
  79. SUnknownErrorCode = 'Unknown error code: %d';
  80. SVarArrayBounds = 'Variant array bounds error';
  81. SVarArrayCreate = 'Variant array cannot be created';
  82. SVarArrayLocked = 'Variant array locked';
  83. SVarBadType = 'Invalid variant type';
  84. SVarInvalid = 'Invalid argument';
  85. SVarNotArray = 'Variant doesn''t contain an array';
  86. SVarNotImplemented = 'Operation not supported';
  87. SVarOutOfMemory = 'Variant operation ran out memory';
  88. SVarOverflow = 'Variant overflow';
  89. SVarParamNotFound = 'Variant Parameter not found';
  90. SVarTypeAlreadyUsedWithPrefix = 'Custom variant type (%s%.4x) already used by %s';
  91. SVarTypeConvertOverflow = 'Overflow while converting variant of type (%s) into type (%s)';
  92. SVarTypeCouldNotConvert = 'Could not convert variant of type (%s) into type (%s)';
  93. SVarTypeNotUsableWithPrefix = 'Custom variant type (%s%.4x) is not usable';
  94. SVarTypeOutOfRangeWithPrefix = 'Custom variant type (%s%.4x) is out of range';
  95. SVarTypeRangeCheck1 = 'Range check error for variant of type (%s)';
  96. SVarTypeRangeCheck2 = 'Range check error while converting variant of type (%s) into type (%s)';
  97. SVarTypeTooManyCustom = 'Too many custom variant types have been registered';
  98. SVarUnexpected = 'Unexpected variant error';
  99. SFallbackError = 'An error, whose error code is larger than can be returned to the OS, has occured';
  100. SNoToolserver = 'Toolserver is not installed, cannot execute Tool';
  101. SShortMonthNameJan = 'Jan';
  102. SShortMonthNameFeb = 'Feb';
  103. SShortMonthNameMar = 'Mar';
  104. SShortMonthNameApr = 'Apr';
  105. SShortMonthNameMay = 'May';
  106. SShortMonthNameJun = 'Jun';
  107. SShortMonthNameJul = 'Jul';
  108. SShortMonthNameAug = 'Aug';
  109. SShortMonthNameSep = 'Sep';
  110. SShortMonthNameOct = 'Oct';
  111. SShortMonthNameNov = 'Nov';
  112. SShortMonthNameDec = 'Dec';
  113. SLongMonthNameJan = 'January';
  114. SLongMonthNameFeb = 'February';
  115. SLongMonthNameMar = 'March';
  116. SLongMonthNameApr = 'April';
  117. SLongMonthNameMay = 'May';
  118. SLongMonthNameJun = 'June';
  119. SLongMonthNameJul = 'July';
  120. SLongMonthNameAug = 'August';
  121. SLongMonthNameSep = 'September';
  122. SLongMonthNameOct = 'October';
  123. SLongMonthNameNov = 'November';
  124. SLongMonthNameDec = 'December';
  125. SShortDayNameMon = 'Mon';
  126. SShortDayNameTue = 'Tue';
  127. SShortDayNameWed = 'Wed';
  128. SShortDayNameThu = 'Thu';
  129. SShortDayNameFri = 'Fri';
  130. SShortDayNameSat = 'Sat';
  131. SShortDayNameSun = 'Sun';
  132. SLongDayNameMon = 'Monday';
  133. SLongDayNameTue = 'Tuesday';
  134. SLongDayNameWed = 'Wednesday';
  135. SLongDayNameThu = 'Thursday';
  136. SLongDayNameFri = 'Friday';
  137. SLongDayNameSat = 'Saturday';
  138. SLongDayNameSun = 'Sunday';
  139. Function GetRunError(Errno : Word) : String;
  140. Implementation
  141. Function GetRunError(Errno : Word) : String;
  142. begin
  143. Case Errno Of
  144. 0 : Result:=SNoError;
  145. 1 : Result:=SOutOfMemory;
  146. 2 : Result:=SFileNotFound;
  147. 3 : Result:=SInvalidFileName;
  148. 4 : Result:=STooManyOpenFiles;
  149. 5 : Result:=SAccessDenied;
  150. 6 : Result:=SInvalidFileHandle;
  151. 15 : Result:=SInvalidDrive;
  152. 100 : Result:=SEndOfFile;
  153. 101 : Result:=SDiskFull;
  154. 102 : Result:=SFileNotAssigned;
  155. 103 : Result:=SFileNotOpen;
  156. 104 : Result:=SFileNotOpenForInput;
  157. 105 : Result:=SFileNotOpenForOutput;
  158. 106 : Result:=SInvalidInput;
  159. 200 : Result:=SDivByZero;
  160. 201 : Result:=SRangeError;
  161. 203 : Result:=SOutOfMemory;
  162. 204 : Result:=SInvalidPointer;
  163. 205 : Result:=SOverFlow;
  164. 206 : Result:=SUnderFlow;
  165. 207 : Result:=SInvalidOp;
  166. 211 : Result:=SAbstractError;
  167. 215 : Result:=SIntOverFlow;
  168. 216 : Result:=SAccessViolation;
  169. 217 : Result:=SPrivilege;
  170. 218 : Result:=SControlC;
  171. 219 : Result:=SInvalidCast;
  172. 220 : Result:=SInvalidVarCast;
  173. 221 : Result:=SInvalidVarOp;
  174. 222 : Result:=SDispatchError;
  175. 223 : Result:=SVarArrayCreate;
  176. 224 : Result:=SVarNotArray;
  177. 225 : Result:=SVarArrayBounds;
  178. 227 : Result:=SAssertionFailed;
  179. 228 : Result:=SExternalException;
  180. 229 : Result:=SIntfCastError;
  181. 230 : Result:=SSafecallException;
  182. 231 : Result:=SExceptionStack;
  183. 232 : Result:=SNoThreadSupport;
  184. 255 : Result:=SFallbackError;
  185. {Error codes larger than 255 cannot be returned as an exit code to the OS,
  186. for some OS's. If this happens, error 255 is returned instead.
  187. Errors for which it is important that they can be distinguished,
  188. shall be below 255}
  189. {Error in the range 900 - 999 is considered platform specific}
  190. 900 : Result:=SNoToolserver; {Mac OS specific}
  191. end;
  192. If length(Result)=0 then
  193. {$ifdef VER1_0}
  194. begin
  195. Str(Errno:3,Result);
  196. Result:=SUnknown+Result;
  197. end;
  198. {$else}
  199. Result:=SUnknown+Str(Errno:3);
  200. {$endif}
  201. end;
  202. end.
  203. {
  204. $Log$
  205. Revision 1.13 2004-09-03 19:26:42 olle
  206. + added maxExitCode to all System.pp
  207. * constrained error code to be below maxExitCode in RunError et. al.
  208. Revision 1.12 2004/08/25 15:29:58 peter
  209. * disbaled error 900 that is out of range
  210. Revision 1.11 2004/08/20 10:18:58 olle
  211. + added error 900, for macos
  212. Revision 1.10 2004/06/12 13:23:17 michael
  213. + Fixed currency<->string conversion support
  214. Revision 1.9 2004/02/08 11:44:05 michael
  215. + OSERRor related constants
  216. Revision 1.8 2004/01/20 23:05:31 hajny
  217. * ExecuteProcess fixes, ProcessID and ThreadID added
  218. Revision 1.7 2004/01/10 19:35:17 michael
  219. + Moved all resource strings to rtlconst/sysconst
  220. Revision 1.6 2004/01/10 17:55:45 michael
  221. + Changed lookup table with Case: Array of resourcestring is not translated
  222. Revision 1.5 2003/11/30 15:04:56 michael
  223. + Removed old strings
  224. Revision 1.4 2003/11/27 20:39:43 michael
  225. + Added runerrors functionality to sysconst
  226. Revision 1.3 2003/11/26 20:34:19 michael
  227. + Some fixes to have everything compile again
  228. Revision 1.2 2003/11/26 20:00:19 florian
  229. * error handling for Variants improved
  230. Revision 1.1 2003/09/03 14:09:37 florian
  231. * arm fixes to the common rtl code
  232. * some generic math code fixed
  233. * ...
  234. }