Reputation: 387
I found this macro code in Delphi/Pascal syntax but i can't use it! Does Delphi support macro codes like C/C++ or this macro is for another language such as Lazarus ???
The macro :
{$ifdef Profile}
{$define __TRACE__:= try }
{$define __END__:= finally ShowMessage('Hello !'); end;}
{$else}
{$define __TRACE__:= //}
{$define __END__:=}
{$endif}
I'm trying to use like this :
...
__TRACE__
// Somethings
__END__
...
I caught this compiler message :
[dcc32 Error] Unit1.pas(37): E2003 Undeclared identifier: '__TRACE__'
[dcc32 Error] Unit1.pas(38): E2066 Missing operator or semicolon
[dcc32 Error] Unit1.pas(39): E2003 Undeclared identifier: '__END__'
{Excuse me if my English is bad}
Upvotes: 0
Views: 1209
Reputation: 612954
These are Free Pascal macros. There's nothing at all like this available for the Delphi compiler. Some options:
__TRACE__
in the code, replace that with an inline $IFDEF
. Not appealing at all.Upvotes: 2