demolib.lpr 566 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. library WorkW3DClient;
  2. {$mode objfpc}
  3. {$h+}
  4. uses
  5. {$IFDEF FPC_DOTTEDUNITS}
  6. System.SysUtils,
  7. {$ELSE}
  8. SysUtils,
  9. {$ENDIF}
  10. wasm.exceptions;
  11. Type
  12. EMyException = class(Exception);
  13. EMyOtherException = class(TObject)
  14. function toString : RTLString; override;
  15. end;
  16. function EMyOtherException.toString : RTLString;
  17. begin
  18. Result:='Some nice error';
  19. end;
  20. procedure DoTest;
  21. begin
  22. raise EMyException.Create('My Exception message');
  23. end;
  24. procedure DoTest2;
  25. begin
  26. raise EMyOtherException.Create;
  27. end;
  28. exports DoTest,DoTest2;
  29. begin
  30. end.