【发布时间】:2013-01-24 01:44:48
【问题描述】:
我正在使用 Documentation Insight 功能来记录 Delphi 库,目前这在 Delphi 2005 到 XE3 上运行良好。现在我也想添加对旧版本的 Delphi (5, 6, 7) 的支持。
但是当尝试在低于 2005 的 Delphi 版本(Delphi 5、6、7)中编译这样的代码时
{$REGION 'Documentation'}
/// <summary>
/// This is a sample text
/// </summary>
{$ENDREGION}
TFoo=class
procedure Tick;
end;
我收到编译器错误
编译器指令区域无效
这很好,因为在 Delphi IDE 更改为 Galileo (Delphi 2005) 时引入了 REGION 保留字。
因此,现在作为解决方法,我使用此语法将 Delphi 5 中的代码编译为 XE3。
{$IFDEF NODEF}{$REGION 'Documentation'}{$ENDIF}
/// <summary>
/// This is a sample text
/// </summary>
{$IFDEF NODEF}{$ENDREGION}{$ENDIF}
TFoo=class
procedure Tick;
end;
但是现在使用这样的代码,Documentation Insight 不再适用于 Delphi XE2 和 XE3。
所以问题是,我如何在旧版本的 Delphi 中编译文档化的 Delphi 代码而不影响较新的 Delphi 版本中的 Documentation Insight?
【问题讨论】:
标签: delphi documentation