B
Brett
I'm trying to use the F1 function inside of F2 function below. I keep
getting the error posted below the code. If I remove the Shared
declaration from F2, it works fine. What exactly does the error mean?
Public Class myClass
Function F1(ByVal url As String) As Struct1
-- do something --
End Function
Public Shared Function F2(ByVal value2 As String) As String
F1(SomeValue) 'error references this line
-- do something --
End Function
End Class
Cannot refer to an instance member of a class from within a shared method or
shared member initializer without an explicit instance of the class.
I also tried this below the class declaration:
Public F1_ As new myClass
F1_.F1()
That gives an error saying 'Declaration Expected' on F1_, anywhere I try to
use it. Any suggestions on how I can reference F1 in F2?
Thanks,
Brett
getting the error posted below the code. If I remove the Shared
declaration from F2, it works fine. What exactly does the error mean?
Public Class myClass
Function F1(ByVal url As String) As Struct1
-- do something --
End Function
Public Shared Function F2(ByVal value2 As String) As String
F1(SomeValue) 'error references this line
-- do something --
End Function
End Class
Cannot refer to an instance member of a class from within a shared method or
shared member initializer without an explicit instance of the class.
I also tried this below the class declaration:
Public F1_ As new myClass
F1_.F1()
That gives an error saying 'Declaration Expected' on F1_, anywhere I try to
use it. Any suggestions on how I can reference F1 in F2?
Thanks,
Brett