共用方式為


<returns> (Visual Basic)

更新:2007 年 11 月

指定屬性 (Property) 或函式的傳回值。

 <returns>description</returns>

參數

  • description
    為傳回值的描述。

備註

在方法宣告的註解內使用 <returns> 標記 (Tag) 來描述傳回值。

使用 /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)