How to reference function in shared function?
From: Brett (no_at_spam.net)
Date: 02/12/05
- Next message: barry: "Closing a form"
- Previous message: LP: "Update more than 1 table in a DataSet using SqlDataAdapter.Update"
- Next in thread: alejandro lapeyre: "Re: How to reference function in shared function?"
- Reply: alejandro lapeyre: "Re: How to reference function in shared function?"
- Reply: Jorge Serrano [MVP VB]: "RE: How to reference function in shared function?"
- Reply: Herfried K. Wagner [MVP]: "Re: How to reference function in shared function?"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 11 Feb 2005 22:23:19 -0500
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
- Next message: barry: "Closing a form"
- Previous message: LP: "Update more than 1 table in a DataSet using SqlDataAdapter.Update"
- Next in thread: alejandro lapeyre: "Re: How to reference function in shared function?"
- Reply: alejandro lapeyre: "Re: How to reference function in shared function?"
- Reply: Jorge Serrano [MVP VB]: "RE: How to reference function in shared function?"
- Reply: Herfried K. Wagner [MVP]: "Re: How to reference function in shared function?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|