Hello,
I have a specific method which needs to accept either a Tool or a Flag (both of them are defined enumerations).
At first, I tried with “Item as Enumeration” but the compiler complains “There’s no class with this name”. Albeit every enumeration being its own type, I thought the base was still an enumeration, but it looks like it’s not accepted as a parameter type.
So now I’m trying with variant. I don’t like using variants but this looks the only compiling way.
In the method, I must now determine whether the parameter is a Tool or a Flag. As with Enumeration as a parameter type, writing “If Item isa Tool then” fails with “There’s no class with this name”.
The VarType function is also not suitable for this.
I guess comparing the parameter against all possible values (if Item=Tool.Tool1 or item=Tool.Tool2) and deciding which type it is would compile, but obviously isn’t great.
I don’t want to mix both enumerations in the first place, but they can be used for the same parameter. Is the language just lacking a “base class” for enumerations/an operator to test against an enumeration type?
Since an enumeration can be passed as a parameter, I’d expect a “generic” enumeration (i.e. “any”) to be allowed too.