The code below returns error after the return statement
Private Sub Command1_Click()
Dim str As String
str = display("test")
Msg开发者_开发知识库Box (str)
End Sub
Public Function display(s As String) As String
s = "updated"
Return s
End Function
Any ideas why?
Change display function. The difference is that in vb6 functions return a value not with return, but with it's name(in this case display), like below.
Public Function display(s As String) As String
s = "updated"
display = s
End Function
精彩评论