加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

Delphi中的注释方法?

发布时间:2020-12-15 10:16:32 所属栏目:大数据 来源:网络整理
导读:我有一段代码需要一些严格的记录,并且想询问是否可以为Embarcadero Delphi提供类似于C#/ .NET的代码XML文档的功能。 我的目的是显示一些关于如何正确使用特定方法的信息,它将以Delphi XE3中的Autocompletion中突出显示。 这样的东西(C#): /// summary///
我有一段代码需要一些严格的记录,并且想询问是否可以为Embarcadero Delphi提供类似于C#/ .NET的代码XML文档的功能。
我的目的是显示一些关于如何正确使用特定方法的信息,它将以Delphi XE3中的Autocompletion中突出显示。

这样的东西(C#):

/// <summary>
/// Some useful information helping other developers use this method correctly
/// </summary>
public static void ADocumentedMethod();

Delphi XE3是否支持这样的东西?

谢谢你的阅读。

解决方法

该功能被命名为XML文档注释,并且是 documented here.它似乎已被模拟在等效的.net功能上,所以你应该在家里。

该文档包含此示例:

/// <summary> Removes the specified item from the collection
/// </summary>
/// <param name="Item">The item to remove
/// </param>
/// <param name="Collection">The group containing the item
/// </param>
/// <remarks>
/// If parameter "Item" is null,an exception is raised.
/// <see cref="EArgumentNilException"/>
/// </remarks>
/// <returns>True if the specified item is successfully removed;
/// otherwise False is returned.
/// </returns>
function RemoveItem(Item: Pointer; Collection: Pointer): Boolean;
begin
  // Non-XML DOC comment
  // ...
end;

这导致了这个帮助洞察提示:

还有其他各种方法来处理和使用文档。

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读