Parameterize a function or task

You need to be more specific about what you mean by parameterize. You can declare parameters in any scope, but the override mechanism exists only for instances of modules, interfaces and classes. It would really help to see the actual error messages you are getting since you only supplied a partial example.

And there are a few other things about your code that do not make sense.

Normally, a compare routine would be a virtual method of the class, not a stand alone routine. You would use inheritance to override the base class, not parameterization.

You should only use tasks for routines that have the possibility of consuming time. Otherwise, use a function.

You almost never need to pass class handle to a routine as a ref argument. A class variable is already a reference to a class object. You normally just want it to be an input. Passing arguments by ref have many more restrictions, that could be the source of some of your errors.