Syntax rules for Lazarus Pascal procedural "Units"
I organise my app's source code into Pascal compilation Units using File
-> New Unit
The following Unit compiles OK ...
unit CryptoUnit;
{$mode objfpc}{$H+}
interface
function Encrypt(key, plaintext:string):string;
function Decrypt(key, ciphertext:string):string;
implementation
uses
Classes, SysUtils, Blowfish;
function Encrypt(key, plaintext:string):string;
...
However this one has compilation errors as it can't identify "Exception"
at line 6 ...
unit ExceptionUnit;
{$mode objfpc}{$H+}
interface
procedure DumpExceptionCallStack(E: Exception); // <--- problem
implementation
uses
Classes, SysUtils, FileUtil;
{ See http://wiki.freepascal.org/Logging_exceptions }
procedure DumpExceptionCallStack(E: Exception);
...
If I assume that Exception is defined in SysUtils (how can I tell?) I
can't put uses SysUtils before interface (the compiler complains it was
expecting interface)
How do I tell the compiler that Exception is defined in SysUtils?
No comments:
Post a Comment