![](/img/trans.png)
[英]What's the best way to check the first message that's received by the server?
[英]What's the best way to reference code over and over?
舉個例子,假設我想在多個區域引用一個 msgbox,我可以為此創建一個 function 嗎? 私人還是公共? 差異?
這是一個例子。
Public Function Message() As String
MsgBox("Test Message")
End Function
另外,為什么我會收到以下消息: Function 'Message' doesn't return a value on all code paths. A null reference exception could occur at run time when the result is used
Function 'Message' doesn't return a value on all code paths. A null reference exception could occur at run time when the result is used
它似乎只是一個警告,當我撥打 function 時它似乎起作用了。
將它設為Sub
,這樣它就不會期望返回值。
Public Sub Message() As String
MsgBox("Test Message")
End Sub
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.