Using the Command window...

Visual Basic:
    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 :
Visual Basic:
    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:
Visual Basic:
Public Shared Sub Main()
 Console.Writeline(TestFunc)

 Console.Read
End Sub

Also use Return "Test" not TestFunc =
 
He's asking how to use the visual studio command window. You use it to run functions and see their results at runtime.
 
Back
Top