Delphi中的注释方法?

前端之家收集整理的这篇文章主要介绍了Delphi中的注释方法?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我有一段代码需要一些严格的记录,并且想询问是否可以为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;

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

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

原文链接:https://www.f2er.com/delphi/103419.html

猜你在找的Delphi相关文章