Using the Command window...

Code:
    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        MessageBox.Show(testFunc("Test"))
    End Sub

    Public Function testFunc(ByVal strString As String) As String

        Return strString /// return the value.

    End Function

or using your original function :
Code:
    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        MsgBox(testFunc) // will show Test.
    End Sub

    Public Function testFunc() As String

        testFunc = "Test"

    End Function
 
Does "command window" mean Message Box or Console Application

If you mean console:
Code:
Public Shared Sub Main()
 Console.Writeline(TestFunc)

 Console.Read
End Sub

Also use Return "Test" not TestFunc =
 
Hes asking how to use the visual studio command window. You use it to run functions and see their results at runtime.
 
Working in VS, turn on Dynamic Help, open the Command Window and select Command Window in the Dynamic Help....there are pointers there.
 
Back
Top