Class Method?

I need to be able to call a method of a class by the name of the class vs off of an instance of the class.

If I have a class cMyClass and it has a method myMethod
I don’t want to have to create and instance of the class to call the method.

Is this a shared method of the class that I’m looking for?

Yes. You want to create a “Shared Method”.

Sorry it got a little more complicated.

Consider I have a MyClassA:MyBaseClass and MyClassB:MyBaseClass

dim x(-1) as MyClassA

Public method(p() as MyBaseClass)
// I need to call the method of MyClass.MySharedMethod… but the array is empty.

Does it matter if I declare MySharedMethod in the base class?

Looks like you want regular methods, then, and you need some instances. What are you trying to achieve?

Hi Brian,

Maybe try a Module, a module makes the code portable, and can be global, and does not need instantiation like a class. Create a new module and then call your method with something like:

Module1.method1(argument, arguement1)

Just a thought :slight_smile:

I have an empty array and I need to call a shared method in the derived class off of the instance of the empty array.

Class Shared method is the right thing