<returns> (Visual Basic)

指定属性或函数的返回值。

<returns>description</returns>

参数

  • description
    返回值的说明。

备注

在方法声明的注释中使用 <returns> 标记以描述返回值。

使用 /doc 进行编译可以将文档注释处理到文件中。

示例

此示例使用 <returns> 标记解释 DoesRecordExist 函数返回的内容。

''' <param name="id">The ID of the record to update.</param> 
''' <remarks>Updates the record <paramref name="id"/>. 
''' <para>Use <see cref="DoesRecordExist"/> to verify that 
''' the record exists before calling this method.</para> 
''' </remarks> 
Public Sub UpdateRecord(ByVal id As Integer)
    ' Code goes here. 
End Sub 
''' <param name="id">The ID of the record to check.</param> 
''' <returns><c>True</c> if <paramref name="id"/> exists, 
''' <c>False</c> otherwise.</returns> 
''' <remarks><seealso cref="UpdateRecord"/></remarks> 
Public Function DoesRecordExist(ByVal id As Integer) As Boolean 
    ' Code goes here. 
End Function

请参见

参考

建议的用于文档注释的 XML 标记 (Visual Basic)