Came across couple of scenarios that one would want to pass operators as a parameter in a function or a method. According to this post Java doesn't have that ability, hence need to create an Enum as the primary workaround.
E.g.
Function doCalcs(ByRef AND as LogicalOperator, ByRef greater ArithmeticOperator)
Although VBA has much lesser libraries compared to .Net, Java, creating Enum is well supported. Perhaps I am not aware, so if there's a possibility of that VBA has operator types or any other workarounds we could pass an operator, shoot that in. (other than if else/case to check a string that contains the operator paramter.. =) ) What I am asking is different from what's mentioned here.
- Question is asked in terms of reducing codes, optimization.
E.g. If you look at CountIFS, it has the ability to take in operators. Even if someone can explain the possible back-end work within this function,
- How does it convert these strings into a proper
operator? - Is that an
Enumstructure or anything more efficient than that or lesser than that?
An answer to these questions are still acceptable.