referencing VisualBasic methods

In VB, I want to assign a (shared) method to a variable
And I'm asking if there is some namespace operator like :: in C++ and Java

class C
    public shared function m(a as integer) as integer
    end function
end class
sub Main() 
    dim localM = C::m
    console.writeline(localM.invoke(5))
sub

I know I could use function(a) C.m(a)
but that is not pretty
and I don't want to create a new function every time
and is also sensitive to argument changes

as for why would I do that
I'm actually passing it to function as an argument
(someFunction(3, C::m))



Read more here: https://stackoverflow.com/questions/67390413/referencing-visualbasic-methods

Content Attribution

This content was originally published by Superior at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: