This is my first post. Please forgive me for asking a basic question as I’m new to programming.
I have following code and it just didn’t compile
Module Module1 Public Sub Test dim a as New TestClass() dim b as string b = a.ReturnString() End Sub End Module Public Class TestClass Public Function ReturnString() as string Return "Hello World" End Function End Class
EDIT: problem solved
Lesson: Need to instantiate class before using it, many thanks to Gens and all of you!
Your TestClass need to be instantiated before use. To instantiate a class, use new keyword before the class name