Equivalent to Raising Exceptions in Free Pascal lazarus / 62-General ---------------------------------------------------------------------- bobby6478 · 2019-10-25 19:20 As part of a project that I am working on, I am using thousands of lines of free pascal pascal written without the {$mode OBJFPC}{H+} modifier added to the beginning, and thus the statement raise is not recognized because the project is compiled in FPC mode. One option is to add {$mode OBJFPC}{H+} to the beginning of each unit. This certainly converts all small integers to long integers (as integer becomes takes this redefinition when moving to OBJFPC, and all of the code that I have uses integers, it never specifies what length) but I can only assume it may have some unpredictable consequences once all of the errors are resolved. So my question is, how are errors created in FPC? I cannot raise an exception but errors must still exist in FPC for the code to know to stop. Can I do something equivalent to that? ---------------------------------------------------------------------- Thaddy · 2019-10-25 20:10 {$I-} and IOResult...and Halt() ---------------------------------------------------------------------- Jonas Maebe · 2019-10-25 20:23 You can enable support for exceptions separately via {$modeswitch exceptions} ---------------------------------------------------------------------- Thaddy · 2019-10-25 20:39 Quote from: Jonas Maebe on October 25, 2019, 10:23:06 pmYou can enable support for exceptions separately via {$modeswitch exceptions} As I read it, because of the integer remark, it is old code. pre- exceptions. ---------------------------------------------------------------------- bobby6478 · 2019-10-25 20:46 Quote from: Jonas Maebe on October 25, 2019, 10:23:06 pmYou can enable support for exceptions separately via {$modeswitch exceptions} That did the trick, thanks!