Share via


HOW TO:將註解加入至您的程式碼 (Visual Basic)

更新:2007 年 11 月

這個範例示範佔用整個原始程式碼行、程式碼行一部分及多行程式碼行的註解。

範例

' This entire line is a comment.
Dim DailyTotal As Decimal = 0   ' Sales total for today.
' This comment is so long that it requires more than one line, so 
' the comment character (') must be repeated on the second line.

這個程式碼範例也可以在 IntelliSense 程式碼片段中找到。在程式碼片段選擇器中,這個程式碼片段位於 [Visual Basic 語言] 中。如需詳細資訊,請參閱 HOW TO:在您的程式碼中插入程式碼片段 (Visual Basic)

編譯程式碼

這個範例需要:

  • System 命名空間的參考。

    注意事項:

    您無法使用行接續 (Line-Continuation) 序列 (_) 延續註解。您必須在每行註解開頭重複註解字元 (')。

請參閱

工作

HOW TO:在程式碼中中斷和合併陳述式

概念

程式碼中的註解