を使用して、アプリのソース コードを Pascal コンパイル ユニットに整理します。File -> New Unit
次の Unit は正常にコンパイルされます ...
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;
...
ただし、これには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);
...
Exception
で定義されていると仮定するとSysUtils
(どうすればわかりますか?)uses SysUtils
前に置くことはできませんinterface
(コンパイラーは期待していると不平を言いますinterface
)
Exception
で定義されていることをコンパイラに伝えるにはどうすればよいSysUtils
ですか?